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

# Set Cashback

> Configure automatic cashback when customers hit a spending threshold

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

Sets up a cashback program: once a customer spends `spend_threshold` (in your chosen currency) at your business, they automatically get `reward_tokens` credited. Cashback resets on every threshold crossing, and any spend overflow rolls into the next cycle.

Use [`/process-cashback`](/api-reference/tokens/governance/process-cashback) to record each customer purchase.

### Request Body

<ParamField body="spend_threshold" type="number" required>
  Amount in `currency` that triggers cashback (e.g. `500`)
</ParamField>

<ParamField body="currency" type="string" required>
  Currency of the threshold (e.g. `"KES"`, `"USD"`). [See codes](/api-reference/general/codes)
</ParamField>

<ParamField body="reward_tokens" type="number" required>
  Tokens awarded each time the threshold is crossed. Decimals allowed.
</ParamField>

### Response

<ResponseField name="tx_hash" type="string">
  Reference identifier for the configuration
</ResponseField>

```javascript theme={null}
// Award 5 tokens when a customer spends KES 500
await fetch("https://tokens.shakesco.com/set-cashback", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ spend_threshold: 500, currency: "KES", reward_tokens: 5 }),
});
```

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