---
title: "Create a donor widget token"
description: "Generate a JWT access token to be used to render donor widgets in your product for B2C use cases."
canonical: https://www.charitips.com/docs/api-reference/create-donor-widget-token
---

# Create a donor widget token

`POST /v1/authentication/donor/widget`

Generate a JWT access token to be used to render donor widgets in your product for B2C use cases. ⚠️ This endpoint is rate limited, it should only be called on previous token expiration which should be once a day.

**Authentication**: Bearer access token.

## Body

- `donorId` (string, required, UUID)

## Response 200

- `accessToken` (string, required)

## Errors

- 400 `A field is missing, has the wrong type, or is not part of the request schema.`: `message` lists every problem. Unknown fields are rejected, not ignored: remove them rather than sending extra data. See https://www.charitips.com/docs/api-reference/errors.md.
- 401 `Unauthorized`: The access token is missing, expired or invalid. Create a new one with your client id and secret, send it as `Authorization: Bearer <accessToken>`, then retry once. Sandbox tokens only work on api.sandbox.charitips.com. See https://www.charitips.com/docs/get-started/authentication.md.
- 402 `Plan upgrade required`: Your plan does not include this feature. Upgrade the plan from the dashboard, then retry. See https://www.charitips.com/docs/overview/plans.md.
- 403 `Account closed`: The account behind these credentials is closed: no token is issued and every call is refused, reads included. Contact Charitips to reopen it. See https://www.charitips.com/docs/api-reference/troubleshooting.md#calls-answer-403-account-not-active-account-not-validated-or-account-closed.

## Example

```bash
curl -X POST https://api.sandbox.charitips.com/v1/authentication/donor/widget \
  -H "Authorization: Bearer $CHARITIPS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "donorId": "<donorId>"
  }'
```

```javascript
const response = await fetch('https://api.sandbox.charitips.com/v1/authentication/donor/widget', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CHARITIPS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "donorId": "<donorId>"
  }),
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
const data = await response.json();
```

```python
import os, requests

response = requests.post(
    "https://api.sandbox.charitips.com/v1/authentication/donor/widget",
    headers={"Authorization": f"Bearer {os.environ['CHARITIPS_TOKEN']}"},
    json={
      "donorId": "<donorId>"
    },
)
response.raise_for_status()
data = response.json()
```

## Response example (200, placeholder values)

```json
{
  "accessToken": "<accessToken>"
}
```
