> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Decrementing Token Balances

Your customers can spend tokens by purchasing a product that is priced in tokens, or by signing up for a subscription (represented by an `AutoBill` object) with a billing plan priced in tokens.

Reduce a customer’s token balance, as the result of a billing event, by making a `decrement` call. Because `decrement` calls are made directly on `Account` objects, the action lies outside of Vindicia’s transaction framework, with no accounting of the spent tokens unless you develop separate client-side mechanisms to maintain an audit trail. However, Vindicia tracks the action and makes it available on the Subscribe Portal (choose **Search** > **Token Activity**.) You may also obtain all token activities with SOAP 3.2 API calls.

Decrement an Account’s Token balance:

```

 // Reference an existing account from which the tokens 
 // are to be decremented
 $acct = new Account();
 $acct->setMerchantAccountId('9876-5432');
  
 // Refer to an existing token type using its id
 $tok = new Token();
 $tok->setMerchantTokenId("US_FREQ_BOOK_BUYER_PT");
  
 // create a TokenAmount object and populate it with token type and
 // quantity
 $tokAmt = new TokenAmount();
 $tokAmt->setToken($tok);
 $tokAmt->setAmount(20); // remove 20 tokens from the account's balance
  
 // Refer to another existing token type using its id
 $tok2 = new Token();
 $tok2->setMerchantTokenId("US_FREQ_DVD_BUYER_PT");
  
 // create a TokenAmount object and populate it with token 
 // type and quantity
 $tokAmt2 = new TokenAmount();
 $tokAmt2->setToken($tok2);
 $tokAmt2->setAmount(40); 
 // want to decrement 40 tokens from the account's balance
 $tokAmounts = array($tokAmt, $tokAmt2);
  
 // make the SOAP call to decrement tokens
 $response = $acct->decrementTokens($tokAmounts);
  
 if($response['returnCode']==200) {
 // the call returns new token balances on the account
 // print those out
 $newTokBalances = $response['tokenAmounts'];
 foreach ($newTokBalances as $newTokBal) {
 print "Token type" 
 . $newTokenBal->token->merchantTokenId; . "\n";
 print "Token amount available" . $newTokenBal->amount; ."\n";
 }
 }
```

* **[Transacting Purchases in Tokens](../topics/Transacting_Purchases_in)**

* **[Token Transactions in Real Time](../topics/Token_Transactions_in_Re)**

**Parent topic:**[Working with Tokens](../topics/ProgGuide_Tokens)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.