Skip to content

Create Order

Request

Allows your customer to create a buy or sell crypto order with Banxa. Upon success, the response will contain a checkout URL which will be unique for the order. The customer will be redirected to this URL to complete the checkout process, which will expire after 1 minute if a redirect does not occur.

Security
sec0
Headers
Acceptstring
Default:"application/json"
X-Request-Idstring

This is the correlation ID related to the request.

Bodyapplication/json
account_referencestringrequired

Unique customer reference provided by you. Used to check whether customer has completed KYC.

payment_method_idinteger, (int32)

Payment method ID associated with the order.

sourcestringrequired

Source currency or cryptocurrency code. This parameter indicates whether the order is a buy or a sell cryptocurrency order.

source_amountstring

Source amount

targetstringrequired

Target currency or cryptocurrency code. This parameter indicates whether the order is a buy or a sell cryptocurrency order.

target_amountstring

Target amount. This will be overridden if a source_amount is also passed.

wallet_addressstringrequired

Wallet address to receive cryptocurrency. Should be sent for buy cryptocurrency orders only.

wallet_address_tagstringrequired

Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only. This is required when the Customer's wallet address has a Memo or Tag such as BNB (Memo) and XRP (Tag).

blockchainstring

Blockchain network code. If not provided, the default blockchain configured for the cryptocurrency will be used. Refer to the Get Crypto Currencies endpoint to retrieve a list of supported blockchain network codes.

return_url_on_successstringrequired

Return URL when the customer has completed the checkout process.

return_url_on_cancelledstring

Return URL when the customer cancels the checkout process.

return_url_on_failurestring

Return URL when the customer fails to complete the checkout process.

meta_datastring

Free form string that you can use to send us any information that will be returned in the Get Orders endpoint

refund_addressstringrequired

Refund wallet address. Should be sent for sell cryptocurrency orders only. Used in the event in the event that a refund is necessary and the transferred coins need to be returned.

refund_address_tagstring

Refund wallet address tag or memo. Should be sent for sell cryptocurrency orders only. This is required when the Customer's wallet address has a Memo or Tag such as BNB (Memo) and XRP (Tag).

source_addressstring

Source wallet address. Should be sent for sell cryptocurrency orders only.

source_address_tagstring

Source wallet address tag or memo. Should be sent for sell cryptocurrency orders only. Required when source wallet address for BNB (Memo) or XRP (Tag).

emailstring

Customer's email address. This will pre-populate the customers' email address field when they are redirected to Banxa checkout

mobilestring

Customer's mobile number. This will pre-populate the customers' mobile number field when they are redirected to Banxa checkout

discount_codestring

(Beta) A code that can be passed to change your commission rate on this order. Please contact your account manager for code setup.

Default:"VIP"
curl -i -X POST \
  https://docs.banxa.com/_mock/products/legacy-api/openapi/api/orders \
  -H 'Accept: application/json' \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -H 'X-Request-Id: string' \
  -d '{
    "account_reference": "string",
    "payment_method_id": 0,
    "source": "string",
    "source_amount": "string",
    "target": "string",
    "target_amount": "string",
    "wallet_address": "string",
    "wallet_address_tag": "string",
    "blockchain": "string",
    "return_url_on_success": "string",
    "return_url_on_cancelled": "string",
    "return_url_on_failure": "string",
    "meta_data": "string",
    "refund_address": "string",
    "refund_address_tag": "string",
    "source_address": "string",
    "source_address_tag": "string",
    "email": "string",
    "mobile": "string",
    "discount_code": "VIP"
  }'

Responses

200

Bodyapplication/json
One of:
dataobject
Response
{ "data": { "order": {} } }