# Create Sell Order

Create an off-ramp order (crypto → fiat) for a customer. Returns a `checkoutUrl` to redirect or embed so the customer can complete their transaction.

## Endpoint


```
POST /{partnerRef}/v2/sell
```

## Request body

| Field | Type | Required | Description |
|  --- | --- | --- | --- |
| `crypto` | string | Yes | Cryptocurrency code the customer wants to sell (e.g., `ETH`, `BTC`). |
| `blockchain` | string | Yes | Blockchain network for the crypto asset (e.g., `ETH`, `BNB`). |
| `fiat` | string | Yes | Fiat currency the customer wants to receive (e.g., `AUD`, `EUR`, `BRL`). |
| `walletAddress` | string | Yes | Customer's sending wallet address. |
| `cryptoAmount` | string | Yes | Amount of cryptocurrency the customer wants to sell. |
| `redirectUrl` | string | Yes | URL to redirect the customer to after checkout completes or is cancelled. |
| `paymentMethodId` | string | No | Pre-selects the payout method. If omitted, the customer chooses in checkout. |
| `externalCustomerId` | string | Yes | Your stable identifier for this customer. See [best practices](/products/hosted-checkout/docs/getting-started/integration-best-practices#externalcustomerid). |
| `externalOrderId` | string | No | Your own order reference to attach to this transaction. Banxa stores it and returns it in order responses and webhooks for reconciliation. |
| `walletAddressTag` | string | No | Secondary wallet identifier required by some blockchains (e.g., memo for XLM, destination tag for XRP). Required when the source wallet requires a tag. |
| `discountCode` | string | No | Discount code to apply to the order. |
| `subPartnerId` | string | No | Identifier for a sub-partner or segment within your account (e.g., different sites or resellers). |
| `metadata` | string | No | Additional free-form data to attach to the order. Returned as-is in order responses and webhooks. |


## Payment method IDs (sell)

| Value | Payout method |
|  --- | --- |
| `payid-bank-transfer` | PayID bank transfer (AUD) |
| `sepa-bank-transfer` | SEPA bank transfer (EUR) |
| `pix` | PIX (BRL) |


## Example requests

### PayID (AUD)


```bash
curl -X POST "https://api.banxa-sandbox.com/{partnerRef}/v2/sell" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "crypto": "ETH",
    "blockchain": "ETH",
    "fiat": "AUD",
    "cryptoAmount": "0.5",
    "walletAddress": "0xcbf80ee36fbf03307962576f338fc50b942e0591",
    "redirectUrl": "https://yourapp.com/order-complete",
    "paymentMethodId": "payid-bank-transfer"
  }'
```

### SEPA (EUR)


```bash
curl -X POST "https://api.banxa-sandbox.com/{partnerRef}/v2/sell" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "crypto": "ETH",
    "blockchain": "ETH",
    "fiat": "EUR",
    "cryptoAmount": "0.5",
    "walletAddress": "0xcbf80ee36fbf13307962576f338fc50b942e0591",
    "redirectUrl": "https://yourapp.com/order-complete",
    "paymentMethodId": "sepa-bank-transfer"
  }'
```

### PIX (BRL)


```bash
curl -X POST "https://api.banxa-sandbox.com/{partnerRef}/v2/sell" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "crypto": "ETH",
    "blockchain": "ETH",
    "fiat": "BRL",
    "cryptoAmount": "0.0015",
    "walletAddress": "0xcbf80ee37fbf03307962576f327fc50b942e0591",
    "redirectUrl": "https://yourapp.com/order-complete",
    "paymentMethodId": "pix"
  }'
```

## Response

**201 Created**


```json
{
  "checkoutUrl": "https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx",
  "id": "191fa5b4b1f45e1cf784422e09317d56",
  "externalOrderId": "a4b427ccb872a1744b317456bd0d165f",
  "externalCustomerId": "user_12345",
  "fiat": "AUD",
  "fiatAmount": "1000.00",
  "crypto": "ETH",
  "cryptoAmount": null,
  "blockchain": "ETH"
}
```

| Field | Description |
|  --- | --- |
| `checkoutUrl` | URL to redirect or embed for the customer to complete their transaction. |
| `id` | Banxa order ID. Store this for order lookup and reconciliation. |
| `externalOrderId` | Your order reference (`externalOrderId` from the request). Null if not provided. |
| `externalCustomerId` | The customer identifier you provided. |
| `fiat` | Fiat currency code (string). |
| `fiatAmount` | Fiat amount as a string. |
| `crypto` | Cryptocurrency code (string). |
| `cryptoAmount` | Crypto amount as a string. Null if not provided in the request. |
| `blockchain` | Blockchain network. |


Use [order lookup](/products/hosted-checkout/docs/transaction-lifecycle/order-lookup) or [webhooks](/products/hosted-checkout/docs/transaction-lifecycle/webhooks) to track the order after checkout.

## Custodial vs. non-custodial flows

The sell flow has two variants depending on how the crypto transfer is handled:

- **Non-custodial** — the customer initiates the crypto transfer themselves. Banxa displays a wallet address and QR code in checkout, and the customer sends the crypto manually.
- **Custodial** — your platform handles the crypto transfer on behalf of the customer. After the customer completes checkout, Banxa notifies you via webhook and you execute the transfer, then confirm it via `POST /v2/orders/{id}/confirm`.


→ See [Custodial vs. Non-Custodial](/products/hosted-checkout/docs/on-ramp-off-ramp/custodial-vs-non-custodial).