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

# Create a checkout session

> Create a Minisend checkout session from your backend to get a hosted payment URL. Customers can pay in USDC or USDT across 19+14 supported chains.

Creates a checkout session, assigns your deposit address, returns a hosted checkout URL. Expires in 30 minutes.

<Warning>
  Backend only. Never call from frontend.
</Warning>

## Endpoint

```text theme={null}
POST https://merchant.minisend.xyz/api/merchant/checkout
```

```text theme={null}
Authorization: Bearer ms_live_your_key_here
```

See [Authentication](/api-reference/authentication).

## Body

<ParamField body="amount" type="number" required>
  USDC amount (>0, two decimals). Customer pays as USDC or USDT-equivalent.
</ParamField>

<ParamField body="description" type="string">
  Shown to the customer on the checkout page.
</ParamField>

<ParamField body="external_id" type="string">
  Your reference (e.g., order ID). Echoed back in webhooks.
</ParamField>

<ParamField body="customer_email" type="string">
  Stored on the session for receipts.
</ParamField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://merchant.minisend.xyz/api/merchant/checkout \
    -H "Authorization: Bearer ms_live_your_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "amount": 25.00,
      "description": "Order #4821 - 2x T-shirts",
      "external_id": "order-4821",
      "customer_email": "customer@example.com"
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch('https://merchant.minisend.xyz/api/merchant/checkout', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ms_live_your_key_here',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      amount: 25.00,
      description: 'Order #4821 - 2x T-shirts',
      external_id: 'order-4821',
      customer_email: 'customer@example.com',
    }),
  });

  if (!res.ok) throw new Error((await res.json()).error);

  const { checkout_url, session_id } = await res.json();
  res.redirect(checkout_url);
  ```

  ```python Python theme={null}
  import requests

  res = requests.post(
      "https://merchant.minisend.xyz/api/merchant/checkout",
      headers={
          "Authorization": "Bearer ms_live_your_key_here",
          "Content-Type": "application/json",
      },
      json={
          "amount": 25.00,
          "description": "Order #4821 - 2x T-shirts",
          "external_id": "order-4821",
          "customer_email": "customer@example.com",
      },
  )

  res.raise_for_status()
  data = res.json()
  ```
</CodeGroup>

## Response (201)

```json theme={null}
{
  "session_id": "cs_7f8a9b2c-1234-5678-abcd-ef0123456789",
  "checkout_url": "https://merchant.minisend.xyz/checkout/cs_7f8a9b2c-1234-5678-abcd-ef0123456789",
  "deposit_address": "0x1234567890abcdef1234567890abcdef12345678",
  "amount_usdc": 25.00,
  "expires_at": "2026-04-13T14:30:00.000Z",
  "status": "pending"
}
```

<ResponseField name="session_id" type="string" required>
  Unique identifier. Always starts with `cs_`.
</ResponseField>

<ResponseField name="checkout_url" type="string" required>
  Hosted checkout page. Redirect the customer here.
</ResponseField>

<ResponseField name="deposit_address" type="string" required>
  Accepts USDC on 19 chains and USDT on 14 chains. See [supported networks](/payments/supported-currencies).
</ResponseField>

<ResponseField name="amount_usdc" type="number" required>
  USDC-equivalent amount.
</ResponseField>

<ResponseField name="expires_at" type="string" required>
  ISO 8601, 30 minutes after creation. Then `status` → `expired`.
</ResponseField>

<ResponseField name="status" type="string" required>
  Always `"pending"` on creation. Track via the [status endpoint](/api-reference/get-checkout) or webhooks.
</ResponseField>
