---
title: Create a hosted checkout
endpoint: POST /api/v3/checkouts
description: Prices the trade and returns a link the customer completes on our pages. Where POST /api/v3/orders takes a quote you already hold, this is the whole flow in one call. Called for a known customer (a `User-Identifier` or user token), it creates the order at once. Called without one, the customer signs in or registers on the page and the order is created when they confirm there; the trade is held as you specified it (lock it with `fixed`), and only refusals that hold for every customer, such as an amount below the minimum or a disabled currency, are answered now.
---

`POST /api/v3/checkouts`

Prices the trade and returns a link the customer finishes on our pages. Where
[create an order](https://partner.btcdirect.eu/v3/api/create-order.md) takes a quote you already hold, this is
the whole flow in one call, which is why a Unified Checkout integration is
mostly this endpoint plus a webhook.

Only three fields are required: the two currencies and the payment method. The
direction follows from the currencies, and the amount can be left out entirely
if you want the customer to choose it on our page.

## With or without a customer

Send the customer's credential (a `User-Identifier` or their session) and the
order is created at once, for that customer.

Leave it out and nobody owns an order yet. The link then carries the trade you
specified, and the customer signs in or registers on our page, verifies, picks
where the value goes and confirms there. The order exists from that moment and
carries your `partnerOrderIdentifier`, so the webhooks about it are matched to
your record exactly as they would be otherwise. Lock what the customer may not
change with `fixed`. Only refusals that hold for every customer, such as an
amount below the minimum or a disabled currency, are answered by this call;
everything about who the customer is gets decided when they confirm.

On a sell where you do not name the customer, you cannot name a payout account: their
accounts do not exist for you before they sign in, so they choose one on the
page.

## What comes back

- **url** — Where to send the customer. Redirect, do not embed it.
- **orderId** — The uuid to store against your own record and to read back later. Only when you name the customer in the call (a User-Identifier or their token): otherwise there is no order yet.
- **displayId** — The short id a human reads out to support. Show this one; key on orderId. Only when you name the customer in the call.
- **offerId** — Only when you do not name the customer: the trade the link carries until they confirm it. The order created from it reaches you through webhooks, matched by partnerOrderIdentifier.
- **partnerOrderIdentifier** — Your own reference, echoed back. Send one and every webhook about this order carries it. When you do not name the customer it is how you recognise the order at all.

> **The return URL is not a result**
>
> A customer can close the tab before we redirect them, and a payment can settle
> minutes after they leave. What happened to the order comes from the webhook.
> See [webhooks](https://partner.btcdirect.eu/v3/webhooks.md).

## Returning to your app

`returnUrl` can be your app's own link (`yourapp://…`) instead of a web
address, once that scheme is enabled for your account. Ask your account
manager. The page then sends the customer back into your app rather than to a
website, and on a sell whose coins your app sends, the deposit screen leads
with a button back into it. See
[sell from your own app](https://partner.btcdirect.eu/v3/unified-checkout/sell-from-your-app.md).

## Request

| Field | Type | Required | Example | Description |
| --- | --- | --- | --- | --- |
| `sourceCurrency` | string | required | `swift:0/iso4217:EUR` |  |
| `targetCurrency` | string | required | `bip122:000000000019d6689c085ae165831e93/slip44:0` |  |
| `sourceAmount` | string | optional | `100.00` |  |
| `targetAmount` | string | optional | `0.00126555` |  |
| `paymentMethod` | string | required | `ideal` |  |
| `destination` | object | optional |  | Where the value the customer receives goes. Which kinds are valid follows from the trade's direction. |
| `destination.kind` | string | required |  | One of: crypto, paymentInstrument, bankAccount. |
| `destination.address` | string | optional | `bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq` | kind=crypto. The wallet the customer receives to. |
| `destination.memo` | string | optional | `106548921` | kind=crypto. Destination tag or memo, on chains that use one. |
| `destination.saveToBook` | boolean | optional |  | kind=crypto. Keep the address in the customer's address book. It is added only once the order completes; a cancelled or failed order leaves it out. |
| `destination.paymentInstrumentId` | string | optional | `7c9e6679-7425-40de-944b-e07fc1f90ae7` | kind=paymentInstrument. Must belong to the order's owner. |
| `destination.instrumentKind` | string | optional |  | kind=paymentInstrument, read only. Which sort of instrument the payout went to. One of: paypal, card. |
| `destination.paypalEmail` | string | optional | `satoshi@example.com` | kind=paymentInstrument, read only. The PayPal account that was paid out to. |
| `destination.cardBrand` | string | optional | `visa` | kind=paymentInstrument, read only. Card scheme, unformatted. |
| `destination.cardLast4` | string | optional | `4242` | kind=paymentInstrument, read only. Last four digits; never the full PAN. |
| `destination.iban` | string | optional | `NL91ABNA0417164300` | kind=bankAccount. |
| `destination.holderName` | string | optional | `S. de Vries` | kind=bankAccount. Legally required. |
| `returnUrl` | string | optional | `https://your.app/checkout/return` | Where the customer goes when they are done: an absolute http(s) URL, or your app's own link when its scheme is enabled for you. |
| `partnerOrderIdentifier` | string | optional | `your-ref-8842` | Your own reference for the trade. It comes back on the order and on every webhook about it, which is how you match an order created on the checkout to your own records. |
| `fixed` | object | optional |  | Pins parts of the trade so the customer cannot change them on the page. |
| `fixed.amount` | boolean | optional |  |  |
| `fixed.currency` | boolean | optional |  |  |
| `fixed.paymentMethod` | boolean | optional |  |  |
| `showWalletAddress` | boolean | optional |  |  |
| `locale` | string | optional | `nl-NL` | The language the hosted checkout page renders in — a language subtag with an optional region, e.g. `nl` or `nl-NL`. Casing is ignored and the region is discarded: it selects no content, so `de-AT` and `de-DE` render the same German. Supported languages are `nl`, `en`, `de`, `fr` and `es`; anything else is refused rather than quietly served in English, because a link minted for a language we do not ship would 404 for the customer. Omitted means English. |
| `expiresIn` | integer | optional |  | How long the returned `url` stays valid, in seconds. Between 300 (5 minutes) and 604800 (7 days); omitted means 3600 (1 hour). Refused rather than clamped if it is outside that range. Note that the order behind the link is priced when it is created, so a long window means a customer can open a link quoting an older rate. Applies to a checkout for a known customer; one created without a customer is priced when the customer confirms. |
| `identifier` | string | optional | `your-customer-8842` | Your own identifier for this customer, registered as part of creating the checkout so you do not need the separate POST /api/v3/users/identifiers call. Needs a partner access token: an api-key call that sets one is refused 403 `server_credential_required`. The User-Identifier header may name the same customer; both at once must be equal (400 `identifier_mismatch`). Already linked, the returned `url` signs that customer in on the page (a one-time login, 15 minutes, single use); not yet linked, the customer registers (which links it) or signs in and is asked once to connect. The `url` never carries this value, only an opaque handle: use it exactly as returned. |
| `ipv4` | string | optional | `203.0.113.0/24` | Locks the link to the customer's IPv4 address: a bare address (exact match) or a CIDR range. The first time the customer opens the link their IP is checked against it and the outcome (`match`, `mismatch` or `no-lock-for-family`, and for a mismatch how far off it was) is recorded on the order for your chargeback analysis. It is recorded, never enforced: a customer on a different address is not turned away. Refused with 400 if it is not an IPv4 address or range. |
| `ipv6` | string | optional | `2001:db8:1:2::/64` | Locks the link to the customer's IPv6 address: a bare address or a CIDR range, compared on the /64 so a rotating privacy address inside one network still matches. Recorded the same way as `ipv4`, never enforced. Refused with 400 if it is not an IPv6 address or range. |

## Responses

| Status | Meaning |
| --- | --- |
| 201 | The checkout. |
| 400 | Unknown currency, untradeable pair, unknown payment method, or a missing amount. Also answered, with code `quote_unconfirmable`, when the trade cannot be confirmed for this customer: the same refusal `POST /api/v3/quotes` reports as `unconfirmableReasons`, such as a customer who has not completed verification, a limit, or no customer at all. No order is created. |
| 403 | The Business-Identifier header names a business the customer does not represent. A quote for a business is checked against that business's limits, so the customer must represent it. |
| 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 or checkout was created; the same request is accepted once trading reopens (`reopensAt`, when the pause has an end). 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). |

| Field | Type | Required | Example | Description |
| --- | --- | --- | --- | --- |
| `url` | string | required | `https://checkout.btcdirect.eu/c/9RVQ2M7KX0` | Send the customer here to complete the trade. |
| `orderId` | uuid | optional | `3fa85f64-5717-4562-b3fc-2c963f66afa6` | Set when the checkout was created for a known customer. |
| `displayId` | string | optional | `K7M4RPQ2` | Set when the checkout was created for a known customer. |
| `offerId` | uuid | optional | `3fa85f64-5717-4562-b3fc-2c963f66afa6` | Set when the checkout was created without a customer: the trade the customer completes after signing in. |
| `direction` | string | required |  | One of: buy, sell. |
| `partnerOrderIdentifier` | string | optional | `your-ref-8842` |  |
