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

# Setup payment handler

> **Required scope:** billing:write

**Required scope:** `billing:write`

### Response

No response body. Stripe SetupIntent for collecting a payment method: \{client\_secret, setup\_intent\_id}.

### Status codes

| Code  | Meaning                                                                                  |
| ----- | ---------------------------------------------------------------------------------------- |
| `200` | Stripe SetupIntent for collecting a payment method: \{client\_secret, setup\_intent\_id} |
| `401` | Unauthorized — missing or invalid credentials                                            |
| `403` | Forbidden — the key/token lacks the required scope                                       |
| `404` | No Stripe customer for this org                                                          |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset                                       |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/billing/setup-payment' \
    --header 'X-API-Key: YOUR_API_KEY'
  ```
</RequestExample>
