Voucher use cases
Vouchers let customers buy and redeem prepaid at a time that suits them. The following examples demonstrate how the Smile API lets you write applications that use prepaid vouchers.
Example: Add prepaid to an existing user
The following workflow lets an existing customer redeem a prepaid voucher:
- authenticate() checks the
customer's credentials and returns the subscription USN.Note: This method is located on the authentication endpoint.
- redeemVoucher() consumes the voucher and adds prepaid to the specified USN.
Example: Add prepaid to a new user
The following workflow lets a new customer redeem a prepaid voucher:
- validateVoucher() checks
that the voucher is valid.
This step ensures that Smile does not create an account for an invalid voucher.
- orderAccount() creates a new account and subscription.
- authenticate() checks the new account's credentials and returns the subscription USN.
- redeemVoucher() consumes the voucher and adds prepaid to the specified USN.