merchantTokenId).
Token objects enable you to define a credit system in your application without conducting actual monetary transactions. For example, a cell-phone company can use a Token object to represent a one-minute phone call; an online game company can have a Token object represent a player’s game time, and another Token object represent virtual goods. An airline might use a Token object to represent 1000 frequent-flier miles earned by a customer.
Token objects are meaningful when associated with Account objects. A certain number of Token objects of a certain type associated with an Account object define the customer’s credit recognized by your application and allow the customer access to resources within the application.
With a TokenAmount object (see the Account object), you can couple a token type with a quantity, and then associate various token amounts with an Account. For example:
- While creating an
Accountobject, populate itstokenBalancesattribute withTokenAmountobjects to grant Tokens of various types to the customer. TheAccountobject supportsincrementTokens()anddecrementTokens()calls, which allow you to manipulate the quantities of token types. To grant or revoke tokens owned by anAccountobject, you may also conduct a token-based Transaction with the object’stokenTransaction()call. For more information, see The Account Object. - You may also define one or more
TokenAmountobjects on aProductobject. When a customer acquires a product through anAutoBillinstance, Subscribe adds the Token amounts defined on the Product to the customer’s Account. For more information, see The Product Object.
Token objects are meaningful only when attached to Account objects, most of the token-related methods are defined on the Account object. The Token object itself offers methods only for creating new token types and for fetching tokens.
Note: Use of the forward slash character (/) in identifiers is not allowed. See Merchant Identifiers for more information.

