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

# Redeem Tokens

> Deduct tokens from a customer's balance when they redeem a reward

<span style={{display:"none"}}>For the complete documentation index, see [llms.txt](/llms.txt).</span>

Call this when a customer spends tokens in your app. The amount is removed from their available balance and returned to your token's reserve, ready to be re-awarded to other customers.

<Info>
  Treat this as a transaction. If the response doesn't arrive, check the customer's [`/balance`](/api-reference/tokens/read/balance) before retrying. Re-running the call deducts twice.
</Info>

### Request Body

<ParamField body="customer_ref" type="string" required>
  Your unique identifier for this customer
</ParamField>

<ParamField body="amount" type="number" required>
  Number of tokens to redeem. Decimals allowed (`1.5`).
</ParamField>

### Response

<ResponseField name="tx_hash" type="string">
  Reference identifier for this redemption
</ResponseField>

```javascript theme={null}
await fetch("https://tokens.shakesco.com/redeem-tokens", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ customer_ref: "customer-123", amount: 5 }),
});
```

<ResponseExample>
  ```json 200 OK theme={null}
  { "tx_hash": "0xdef456..." }
  ```

  ```json 400 Insufficient Balance theme={null}
  { "error": "Insufficient token balance" }
  ```
</ResponseExample>
