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

# Top Up Credits

> Create a Stripe checkout session to add credits.

## Request

```bash theme={null}
curl -X POST https://identity.contra.id/v1/billing/top-up \
  -H "x-api-key: $CONTRA_KEY" -H "Content-Type: application/json" \
  -d '{
    "amount_in_dollars": 200,
    "success_url":       "https://yourapp.com/billing/success",
    "cancel_url":        "https://yourapp.com/billing/cancel"
  }'
```

| Body                | Type   | Required | Description                        |
| ------------------- | ------ | -------- | ---------------------------------- |
| `amount_in_dollars` | number | **yes**  | Minimum **\$50**.                  |
| `success_url`       | url    | no       | Redirect after successful payment. |
| `cancel_url`        | url    | no       | Redirect on cancel.                |

## Response · 200

```json theme={null}
{
  "checkout_session_id":  "cs_live_a1b2…",
  "checkout_session_url": "https://checkout.stripe.com/c/pay/cs_live_a1b2…"
}
```

Redirect the user to `checkout_session_url`. The balance updates within \~5 seconds of a successful payment.
