v2
You are reading v1 & v2. v1 and v2 are deprecated. They keep working and are still supported, but new integrations should use v3.

Confirm a fiat to crypto quote

Buy

POST/api/v1/buy/confirm

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

How authentication works
Either
Authorization: BearerorUser-Authorization: Bearer

Language

Environment

Credentials

Your credential, or the customer's

Choose an environment first.

cURL request
curl -X POST https://api.btcdirect.eu/api/v1/buy/confirm \  -H "Authorization: Bearer $BTCD_PARTNER_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "callbackUrl": "https://www.example.com/payment-completed",    "partnerOrderIdentifier": "4ea2b5e9-a413-4359-a8f6-9263ae8a0ee7",    "quote": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbmNyeXB0ZWQiOiJ0b2tlbiJ9.gj80-9FPf_Wl7CGg2eDEFHokoEVtXIT7l4F88ztgxnhGIuhjOrhZ6xZLT3vuJPKXam_jQskm1PuM7T0OQdawDw",    "returnUrl": "https://www.example.com/payment-finished",    "walletAddress": "3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5",    "destinationTag": "ABC12345",    "walletType": "unhosted"  }'
Choose an environment to run this.

Response

Returns a URL to pay for the order.
{  "orderId": 1234,  "paymentUrl": "https://www.example.com/pay?id=1234",  "expiresAt": "2025-04-07T18:30:00Z"}

Request

callbackUrlstring

After the order is finished, we will send a request to this url.

Examplehttps://www.example.com/payment-completed

partnerOrderIdentifierstring

Unique identifier provided by the partner.

Example4ea2b5e9-a413-4359-a8f6-9263ae8a0ee7

quotestringrequired

The quote generated by the sell/quote endpoint.

ExampleeyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJlbmNyeXB0ZWQiOiJ0b2tlbiJ9.gj80-9FPf_Wl7CGg2eDEFHokoEVtXIT7l4F88ztgxnhGIuhjOrhZ6xZLT3vuJPKXam_jQskm1PuM7T0OQdawDw

returnUrlstringrequired

After the payment is finished, we will redirect the user to this url.

Examplehttps://www.example.com/payment-finished

walletAddressstringrequired

The wallet address we send the cryptos to after the payment is completed.

Example3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5

destinationTagstring|integer

The destination tag where we send the cryptos to after the payment is completed.

ExampleABC12345

walletTypeone of

The type of wallet to which the funds will be sent.

Exampleunhosted

Responses

201Returns a URL to pay for the order.
400A list of possible errors for this endpoint.

Body of the success response

orderIdintegerrequired

The order id.

paymentUrlstringrequired

The URL the user should be redirected to, to complete their payment.

Examplehttps://www.example.com/pay?id=1234

expiresAtdate-time

The expiry date-time that expires this confirmed quote. After this period it's no longer possible to pay for this order. The date does not apply for order that are paid through bank transfer.

Defaultnull

Example2025-04-07T18:30:00Z

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