Skip to main content
Because token balances are associated with an Account object, to allow customers to purchase tokens, you must define Product objects and specify how many tokens of a certain type to grant to a customer (Account object) when that customer purchases the related products. After each purchase, Subscribe adds the appropriate number of tokens to the balance attached to the Account object. The following example creates a Product object that grants 10 tokens, of the type defined in the previous example, to an Account object that purchases the Product object. Use a Product purchase to grant Tokens:
The Product object created can be used in both one-time and recurring billing:
  • **Recurring billing:**Construct an AutoBill object with the Product object. With successful capture of each recurring transaction generated by the AutoBill, Subscribe adds the tokens granted by the Product to the Account object associated with the AutoBill.
  • **Real-time billing:**Construct a one-time transaction that refers to the Product object as one of its transaction items. Specify the SKU of TransactionItem as merchantProductId for Product. With a successful capture of a one-time transaction, Subscribe adds the tokens granted by Product to the Account object associated with the transaction.
Use a Product that grants Tokens in a one-time Transaction:
Parent topic:Incrementing Token Balances