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

# Create Checkout

> POST /v2/crossramp_checkout — create a new Crossramp Checkout session and get a hosted payment link.

## Request body

| Field            | Type   | Required | Description                                                                                                                                                                                                                                                                |
| ---------------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `currency_code`  | string | Yes      | Crypto currency to receive (e.g. `TRX_USDT_S2UZ`, `BTC`)                                                                                                                                                                                                                   |
| `amount_fiat`    | number | No\*     | Fixed BRL amount the customer pays                                                                                                                                                                                                                                         |
| `amount_crypto`  | number | No\*     | Fixed crypto amount the customer receives                                                                                                                                                                                                                                  |
| `webhook`        | string | No       | URL to receive status updates                                                                                                                                                                                                                                              |
| `return_url`     | string | No       | URL to redirect the customer after completion                                                                                                                                                                                                                              |
| `payer_document` | string | No       | Customer CPF or CNPJ (digits only). **Validated when supplied** — a value that is neither a valid CPF nor a valid CNPJ returns `400`. If provided and not on record, a client profile is created automatically, skipping the identity collection step in the checkout flow |
| `payer_name`     | string | No       | Customer name (used when creating a new client profile)                                                                                                                                                                                                                    |

> Provide either `amount_fiat` or `amount_crypto`. If both are omitted, the checkout page lets the customer enter the amount themselves.

Unknown fields are rejected: a typo'd or extra key returns `400` rather than being ignored.

## Response `200 OK`

The response body is just the hosted link:

```json theme={null}
{ "link": "https://checkout.noxpay.io/e2e/NOXabc123" }
```

Redirect the customer to this URL or embed it. The `NOX...` path segment is the transaction `end2end` ID — use it with [Get Checkout](/api-reference/crossramp-checkout/get) to retrieve or track the session. Note this returns `200`, not `201`.

## Status codes

| HTTP  | When                                                                                                        |
| ----- | ----------------------------------------------------------------------------------------------------------- |
| `200` | Created                                                                                                     |
| `400` | Invalid JSON, unknown field, missing `currency_code`, unrecognised currency, or an invalid `payer_document` |
| `401` | Missing or invalid `api-key`                                                                                |
| `405` | Method other than `POST` or `OPTIONS`                                                                       |
| `500` | Internal error                                                                                              |

<Note>
  On an error this endpoint returns a JSON body but sets `Content-Type: text/plain`. Parse the body and ignore the content type.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://checkout.noxpay.io/v2/crossramp_checkout \
    -H "api-key: <key>" \
    -H "Content-Type: application/json" \
    -d '{
      "currency_code": "TRX_USDT_S2UZ",
      "amount_fiat": 550.00,
      "webhook": "https://yourapp.com/webhooks/nox",
      "return_url": "https://yourapp.com/success",
      "payer_document": "12345678901"
    }'
  ```

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

  response = requests.post(
      "https://checkout.noxpay.io/v2/crossramp_checkout",
      headers={
          "api-key": "<key>",
          "Content-Type": "application/json",
      },
      json={
          "currency_code": "TRX_USDT_S2UZ",
          "amount_fiat": 550.00,
          "webhook": "https://yourapp.com/webhooks/nox",
          "return_url": "https://yourapp.com/success",
          "payer_document": "12345678901",
      },
  )
  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch("https://checkout.noxpay.io/v2/crossramp_checkout", {
    method: "POST",
    headers: {
      "api-key": "<key>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      currency_code: "TRX_USDT_S2UZ",
      amount_fiat: 550.00,
      webhook: "https://yourapp.com/webhooks/nox",
      return_url: "https://yourapp.com/success",
      payer_document: "12345678901",
    }),
  });
  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "link": "https://checkout.noxpay.io/e2e/NOXabc123"
  }
  ```
</ResponseExample>
