Skip to content
Last updated

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

FieldTypeRequiredDescription
cryptostringYesCryptocurrency code the customer wants to sell (e.g., ETH, BTC).
blockchainstringYesBlockchain network for the crypto asset (e.g., ETH, BNB).
fiatstringYesFiat currency the customer wants to receive (e.g., AUD, EUR, BRL).
walletAddressstringYesCustomer's sending wallet address.
cryptoAmountstringYesAmount of cryptocurrency the customer wants to sell.
redirectUrlstringYesURL to redirect the customer to after checkout completes or is cancelled.
paymentMethodIdstringNoPre-selects the payout method. If omitted, the customer chooses in checkout.
externalCustomerIdstringYesYour stable identifier for this customer. See best practices.
externalOrderIdstringNoYour own order reference to attach to this transaction. Banxa stores it and returns it in order responses and webhooks for reconciliation.
walletAddressTagstringNoSecondary wallet identifier required by some blockchains (e.g., memo for XLM, destination tag for XRP). Required when the source wallet requires a tag.
discountCodestringNoDiscount code to apply to the order.
subPartnerIdstringNoIdentifier for a sub-partner or segment within your account (e.g., different sites or resellers).
metadatastringNoAdditional free-form data to attach to the order. Returned as-is in order responses and webhooks.

Payment method IDs (sell)

ValuePayout method
payid-bank-transferPayID bank transfer (AUD)
sepa-bank-transferSEPA bank transfer (EUR)
pixPIX (BRL)

Example requests

PayID (AUD)

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)

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)

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

{
  "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"
}
FieldDescription
checkoutUrlURL to redirect or embed for the customer to complete their transaction.
idBanxa order ID. Store this for order lookup and reconciliation.
externalOrderIdYour order reference (externalOrderId from the request). Null if not provided.
externalCustomerIdThe customer identifier you provided.
fiatFiat currency code (string).
fiatAmountFiat amount as a string.
cryptoCryptocurrency code (string).
cryptoAmountCrypto amount as a string. Null if not provided in the request.
blockchainBlockchain network.

Use order lookup or 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.