> For the complete index of the 402pay docs, see [llms.txt](https://developer.402pay.co/llms.txt).

# Update checkout settings

Turn coins and card payments on or off, and change the quote window, tolerance and redirect.

`PATCH https://dash.402pay.co/api/v1/settings/checkout`

Send only what changes. New settings apply to checkouts opened afterward: a quote that's already open keeps its address, amount and expiry. You receive `checkout_settings.updated`.

### Body

- `accepted_assets` (array): Pairs to turn on or off, each `{ asset, network, enabled }`. Pairs you leave out keep their setting, and at least one must stay on. See [supported networks](https://developer.402pay.co/guides/networks.md).
- `accepted_rails` (array): Must include `crypto`. Add `card` to take card payments, or leave it out to stop.
- `fee_payer` (string): `business` or `customer`: who pays 402pay's fees. With `customer`, checkout adds them to each customer's total.
- `quote_minutes` (integer): 5, 10, 15, 30 or 60.
- `underpayment_tolerance_pct` (number): 0, 0.5, 1, 2 or 5.
- `success_redirect_enabled` (boolean): Whether to send customers to `success_redirect_url` after paying.
- `success_redirect_url` (string): An `https://` URL, or `null` to clear it.
- `collect_email` (boolean): Whether checkout asks crypto customers for an email.

### Errors

- 400 `invalid_request` A field is unknown or has a value it can't take, such as `accepted_rails` without `crypto`. `field` names it.
- 403 `test_mode_unavailable` A test key can't change checkout settings on a live business, so use a live key.

Any request can also fail on its key or its body. See [errors](https://developer.402pay.co/api/errors.md).

Request, cURL:

```bash
curl -X PATCH "https://dash.402pay.co/api/v1/settings/checkout" \
  -H "Authorization: Bearer $PAY402_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "accepted_assets": [
      {
        "asset": "BTC",
        "network": "bitcoin",
        "enabled": true
      }
    ],
    "quote_minutes": 15
  }'
```

Request, Node.js:

```js
const response = await fetch("https://dash.402pay.co/api/v1/settings/checkout", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.PAY402_SECRET_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accepted_assets: [
      {
        asset: "BTC",
        network: "bitcoin",
        enabled: true
      }
    ],
    quote_minutes: 15
  }),
});
const { data } = await response.json();
```

Request, Python:

```python
import os

import requests

response = requests.patch(
    "https://dash.402pay.co/api/v1/settings/checkout",
    headers={
        "Authorization": f"Bearer {os.environ['PAY402_SECRET_KEY']}",
    },
    json={
        "accepted_assets": [
            {
                "asset": "BTC",
                "network": "bitcoin",
                "enabled": True
            }
        ],
        "quote_minutes": 15
    },
)
data = response.json()["data"]
```

Response, 200 OK:

```json
{
  "data": {
    "kind": "checkout_settings",
    "accepted_assets": [
      {
        "asset": "USDC",
        "network": "polygon",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "USDC",
        "network": "ethereum",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "USDC",
        "network": "solana",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "USDT",
        "network": "tron",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "USDT",
        "network": "ethereum",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "USDT",
        "network": "solana",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "BTC",
        "network": "bitcoin",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "ETH",
        "network": "ethereum",
        "enabled": true,
        "offered": true
      },
      {
        "asset": "SOL",
        "network": "solana",
        "enabled": true,
        "offered": true
      }
    ],
    "accepted_rails": ["crypto", "card"],
    "fee_payer": "business",
    "quote_minutes": 15,
    "underpayment_tolerance_pct": 0.5,
    "success_redirect_enabled": false,
    "success_redirect_url": null,
    "collect_email": true,
    "card_available": true
  }
}
```
