Skip to main content
Vindicia Knowledge Center

Token Object

Token Object

Token Object

A Token object represents a metering or virtual-currency unit of a certain type, which is identified by the object’s unique ID (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 Account object, populate its tokenBalances attribute with TokenAmount objects to grant Tokens of various types to the customer. The Account object supports incrementTokens() and decrementTokens() calls, which allow you to manipulate the quantities of token types. To grant or revoke tokens owned by an Account object, you may also conduct a token-based Transaction with the object’s tokenTransaction() call. For more information, see The Account Object.
  • You may also define one or more TokenAmount objects on a Product object. When a customer acquires a product through an AutoBill instance, CashBox adds the Token amounts defined on the Product to the customer’s Account. For more information, see The Product Object.

Because 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.

For Users

Learn More
For Users

Cashbox Features

Learn More
Cashbox Features
Back to Top