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:
  1. authenticate() checks the customer's credentials and returns the subscription USN.
    Note: This method is located on the authentication endpoint.
  2. 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:
  1. validateVoucher() checks that the voucher is valid.

    This step ensures that Smile does not create an account for an invalid voucher.

  2. orderAccount() creates a new account and subscription.
  3. authenticate() checks the new account's credentials and returns the subscription USN.
  4. redeemVoucher() consumes the voucher and adds prepaid to the specified USN.