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

# Claim Tokens

> Award tokens to a customer for completing an event

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

Award tokens to a customer when they complete an event you've configured (e.g. `signup`, `purchase`, `birthday`). The event must already exist for your token; configure events via [`/set-event-details`](/api-reference/tokens/events/set-event-details) or from the [dashboard](https://users.shakesco.com/loyalty-program).

<Info>
  Treat this as a transaction. Wait for the `200 OK` before telling the customer. If you don't get a response, query [`/has-claimed-event`](/api-reference/tokens/read/has-claimed-event) before retrying to avoid double-crediting.
</Info>

### Request Body

<ParamField body="event_name" type="string" required>
  The event identifier (must match an event configured on your token)
</ParamField>

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

### Response

<ResponseField name="tx_hash" type="string">
  A reference identifier for this credit. Store it for your audit trail.
</ResponseField>

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

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

  ```json 404 Event Not Found theme={null}
  { "error": "Event not found" }
  ```

  ```json 409 Already Claimed theme={null}
  { "error": "Event already claimed" }
  ```

  ```json 429 Daily Cap Exceeded theme={null}
  { "error": "Daily earning cap exceeded" }
  ```
</ResponseExample>
