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

# Daily Earnings

> How many tokens a customer has earned in the current 24-hour window

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

Returns how much of the daily cap a customer has used up in their current rolling 24-hour window. Use this to show "you've earned X / Y today" in your UI, or to predict when a customer will hit the cap.

### Query Parameters

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

### Response

<ResponseField name="earned_today" type="string">
  Tokens this customer has earned since their window started
</ResponseField>

<ResponseField name="last_reset_time" type="string">
  Unix timestamp (seconds) when the current 24-hour window started. Add 86400 to know when it resets.
</ResponseField>

<ResponseField name="cap" type="string">
  Current per-day cap (same value as `daily-cap-settings.cap`)
</ResponseField>

```javascript theme={null}
const res = await fetch(
  "https://tokens.shakesco.com/daily-earnings?customer_ref=customer-123",
  { headers: { Authorization: `Bearer ${API_KEY}` } }
);
const { earned_today, last_reset_time, cap } = await res.json();
```

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "earned_today": "12.0",
    "last_reset_time": "1715000000",
    "cap": "50.0"
  }
  ```
</ResponseExample>
