---
title: Quick start
description: The whole integration, end to end, for both directions.
wide: true
---

Five calls, one redirect, one webhook. Only the checkout call is specific to
Unified Checkout; the rest is how you talk to us for anything.

## The flow

1. **Authenticate** (your server) `POST /api/v3/auth/tokens` — Exchange your partner username and password for an access token. Or skip this and send your api-key on every call instead.
2. **Load what you can offer** (your server) `GET /api/v3/currencies` — Which coins and networks are available, and in which direction. Read it often rather than holding it: a coin we add or suspend should reach your customers in minutes, not at your next deploy.
3. **Load how they can pay** (your server) `GET /api/v3/payment-methods` — Your own methods for the customer’s country. Not the global list.
4. **Price it, if you show a price** (your server) `POST /api/v3/quotes` — Optional. Only if you display the rate before sending the customer on: the checkout prices the trade itself.
5. **Create the checkout** (your server) `POST /api/v3/checkouts` — The trade, the customer, and where the value goes. Returns the link and the order id.
6. **Redirect** (the customer) — Send the browser to the returned url. Store the order id before you do.
7. **They pay, verify and receive** (BTC Direct) — Every screen from here is ours: payment, any verification, delivery.
8. **Back to you** (the customer) — The customer lands on your returnUrl. This says where they went, not what happened.
9. **The outcome** (BTC Direct) `order_completed` — A webhook tells you what actually happened. This is the signal to fulfil, not the redirect.

## Direction is not a parameter

There is no buy or sell flag anywhere above. Fiat in and crypto out is a buy,
crypto in and fiat out is a sell, and we derive it from the pair you name. A
fiat-to-fiat or crypto-to-crypto pair is refused rather than guessed at.

Two things change between the directions, and nothing else does:

- **The currencies**, swapped.
- **`destination`** — where the value the customer *receives* goes. `crypto`
  with a wallet address on a buy; on a sell either `bankAccount` with an IBAN,
  or `paymentInstrument` naming a payout account the customer already holds
  with us.

The same webhooks, the same read-back and the same statuses apply to both. A
sell just takes longer to finish, because it waits for the customer's coins to
confirm on-chain.

## The one call that matters

`POST /api/v3/checkouts`

```bash
curl -X POST https://api.btcdirect.eu/api/v3/checkouts \
  -H 'x-api-key: YOUR_API_KEY' \
  -H 'User-Identifier: YOUR_IDENTIFIER_FOR_THIS_CUSTOMER' \
  -H 'Content-Type: application/json' \
  -d '{
    "sourceCurrency": "swift:0/iso4217:EUR",
    "targetCurrency": "bip122:000000000019d6689c085ae165831e93/slip44:0",
    "sourceAmount": "100.00",
    "paymentMethod": "sepa",
    "destination": {
      "kind": "crypto",
      "address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq"
    }
  }'
```

```json
{
  "url": "https://checkout.btcdirect.eu/en-eu/?token=eyJvcmRlcklkIjoi…",
  "orderId": "42a77ced-7933-494f-94db-816af1f50567",
  "displayId": "7SM9LZJK",
  "direction": "buy"
}
```

Every field and every error is on the [endpoint reference](https://partner.btcdirect.eu/v3/api/create-checkout.md).
[Build one](https://partner.btcdirect.eu/v3/unified-checkout/builder.md) composes it for you, in either direction,
against real currencies.

## Three things people get wrong

**The link expires.** An hour by default, and `expiresIn` sets it — see
[how long a link lives](https://partner.btcdirect.eu/v3/unified-checkout/options.md#how-long-a-link-lives). For an
ordinary redirect, mint it as you redirect rather than when you render the
button.

**The redirect is not the outcome.** A customer can close the tab; a sell
finishes minutes after they leave. Fulfil on the [webhook](https://partner.btcdirect.eu/v3/webhooks.md).

**`User-Identifier` is a credential, not a label.** Sending one authenticates
the call as that customer. [User identifiers](https://partner.btcdirect.eu/v3/api/user-identifiers.md) covers what
happens when you pass one, linked or not.
