v3

Create an order from a quote

Turns a quote into an order. The direction comes from the quote, and determines which destination kinds are accepted: a buy pays out in crypto, a sell to a payment instrument or bank account.

POST/api/v3/orders

Send two credentials: your own, and the customer's.

How authentication works
Yours
x-api-keyorAuthorization: Bearer
The customer's
User-Authorization: BearerorUser-Identifier

Language

Environment

Credentials

Your credential

The customer's credential

Choose an environment first.

cURL request
curl -X POST https://api.btcdirect.eu/api/v3/orders \  -H "x-api-key: $BTCD_API_KEY" \  -H "User-Authorization: Bearer $BTCD_USER_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "quote": "eyJhbGciOiJIUzI1NiJ9.eyJxdW90ZUlkIjoiM2ZhODVmNjQ",    "destination": {      "kind": "crypto",      "address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",      "saveToBook": true    },    "returnUrl": "https://your.app/checkout/return",    "partnerOrderIdentifier": "your-ref-8842"  }'
Choose an environment to run this.

Response

The order.
{  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",  "displayId": "K7M4RPQ2",  "direction": "buy",  "paymentUrl": "https://ideal.example/pay/9RVQ2M7KX0",  "checkoutUrl": "https://checkout.btcdirect.eu/c/9RVQ2M7KX0",  "partnerOrderIdentifier": "your-ref-8842",  "deposit": {    "address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",    "memo": "9911"  }}

Request

quotestringrequired

The signed quote from POST /api/v3/quotes. Authoritative for currencies, amounts, fees and payment method.

ExampleeyJhbGciOiJIUzI1NiJ9.eyJxdW90ZUlkIjoiM2ZhODVmNjQ

destinationobjectrequired

Where the value the customer receives goes. Which kinds are valid follows from the trade's direction.

returnUrlstring

Examplehttps://your.app/checkout/return

partnerOrderIdentifierstring

Your own reference. Echoed back and stored on the order.

Exampleyour-ref-8842

localestring

The language the returned `checkoutUrl` renders in. Same rules as the checkout endpoint: a language subtag with an optional region, casing ignored, region discarded, one of `nl`, `en`, `de`, `fr`, `es`. Omitted means English.

Examplenl-NL

actingAsstring

Can be one ofindividualbusiness

businessIdstring

Example4f1d0f6e-9b7a-4c31-8a2e-6d5b0c9e7f14

bankIdstring

Pay by Bank only.

ExampleINGBNL2A

bankCountrystring

Pay by Bank only.

ExampleNL

debtorPaymentInstrumentIdstring

Pay by Bank only. Which of the customer's own accounts they pay from.

Example7c9e6679-7425-40de-944b-e07fc1f90ae7

debtorIbanstring

Pay by Bank only; 400 otherwise. An IBAN the customer entered for the account they pay from, when they did not pick a saved one. Not together with debtorPaymentInstrumentId. Sent to the bank only if it requires the payer's IBAN.

ExampleNL91TRIO0321110110

psuIdstring

Pay by Bank only; 400 otherwise. The customer's login or customer number at their bank, for banks that require it (the bank's requiredInput names psuId).

Examplevr-netkey-alias

Responses

201The order.
400Invalid or expired quote, or a destination that contradicts the direction.
401No authenticated customer.
403The payment instrument does not belong to this owner.
409Support rejected the customer for this payment method at its first-use review (`code: payment_method_rejected`). Another payment method can still be used.
503`trading_paused` — an operator has paused this side of trading for this partner, coin or payment method. Nothing is wrong with the request and no order was created; the same request is accepted once trading reopens (`reopensAt`, when the pause has an end). A quote taken before the pause is refused too, whatever its expiry. Told apart from any other 503 by `code`. Or `maintenance`: full maintenance is on, and every endpoint refuses every request until it ends (`endsAt`, when it has an end).

Body of the success response

iduuidrequired

Example3fa85f64-5717-4562-b3fc-2c963f66afa6

displayIdstringrequired

The customer-facing handle. Show this rather than the id.

ExampleK7M4RPQ2

directionstringrequired

Can be one ofbuysell

paymentUrlstringrequired

Signed hosted payment page for this order.

Examplehttps://ideal.example/pay/9RVQ2M7KX0

checkoutUrlstringrequired

Examplehttps://checkout.btcdirect.eu/c/9RVQ2M7KX0

partnerOrderIdentifierstring

Exampleyour-ref-8842

depositobject

Where the customer sends the coins that fund a sell. Absent on a buy, whose customer pays through paymentUrl, and on a sell whose journey has not yet allocated an address.

Every failure answers with a message and a code. Switch on the code — messages are written for people and can change.