Allows your customer to create a buy 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.
This is the blockchain that is associated with the crypto token. If none is provided, then a default will be used.
The amount of fiat the user wants to buy. Either fiatAmount OR cryptoAmount must be provided. If both are provided, then cryptoAmount will be used.
The amount of crypto the user wants to buy. Either fiatAmount OR cryptoAmount must be provided. If both are provided, then cryptoAmount will be used.
The customer’s receiving wallet: the address Banxa sends the purchased crypto to.
Memo or tag of the customer’s receiving wallet. Required when the wallet uses a memo or tag, such as BNB (memo) and XRP (tag).
The URL the user will be redirected to after the buy flow has been completed. If the case of an order failure or cancellation, then the returnUrl will be appended with the status e.g. /?status=failure, /?status=cancel
Your defined ID for associating an order with. e.g. you may use this to differentiate between channels such as Exchange, Wallet, Web, Mobile.
Free form string that you can use to send us any information that will be returned in the Get Orders endpoint
Unique customer reference provided by you. Recommended on every order: used to check whether the customer has completed KYC and to recognise returning customers.
An order ID that you may define and will be returned to you in a Get Order call.
Allows you to configure the discount to your commission rate per order. This can be a promotion code such as XMAS or a way to differentiate between your customers.
IP binding. The customer's IP address, taken from the customer's own request that started the order. One or two items, at most one per IP family. Required when Banxa has turned on IP binding for your account, unless you send ipBindingOmitted.
Sent instead of ipBinding when the customer uses iCloud Private Relay. Never sent together with ipBinding.
- Mock serverhttps://docs.banxa.com/_mock/products/hosted-checkout/openapi/{partner}/v2/buy
- https://api.banxa.comhttps://api.banxa.com/{partner}/v2/buy
curl -i -X POST \
'https://docs.banxa.com/_mock/products/hosted-checkout/openapi/{partner}/v2/buy' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"crypto": "ETH",
"fiat": "AUD",
"fiatAmount": "200",
"walletAddress": "0xe3BDEFdAeFF070925eB7FfC49F9B30c647Cb751e",
"redirectUrl": "https://yourapp.com/order-complete",
"paymentMethodId": "debit-credit-card",
"externalCustomerId": "user_12345",
"email": "[email protected]"
}'Order created.
Checkout URL to redirect the customer to. Expires after 1 minute if a redirect does not occur.
The externalOrderId from the request. null if not provided.
{ "checkoutUrl": "https://partner.banxa.com/portal?expires=xxx&oid=xxx&signature=xxx", "id": "191fa5b4b1f45e1cf784422e09317d56", "externalOrderId": "a4b427ccb872a1744b317456bd0d165f", "externalCustomerId": "awasdf-fg34fg-34hhsdf", "fiat": "CAD", "fiatAmount": "1000.00", "crypto": "USDC", "cryptoAmount": null, "blockchain": "TRON" }