> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tilta.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# BNPL checkout

> Run a buy now, pay later checkout in two requests: create the order with a hosted checkout, then capture it with the invoice and its files.

> [!NOTE]
>
> Coming soon – the checkout, confirmation and capture endpoints in this guide aren't available yet. Until they ship, they return `501 Not Implemented` with the error code `NOT_IMPLEMENTED`. The guide and the API reference describe them ahead of their release so that you can build against them.

The order-centric checkout puts the order at the centre of the integration. Each request creates everything it needs: the checkout request creates the order, and the buyer and its contacts if they are new, and the capture request creates the invoice, its files and its services. A typical integration needs two requests.

## Key concepts

| Step | Order status | What it means |
| - | - | - |
| **Creation** | `OPEN` | The order exists. Tilta holds no amount for it, and it has no deadline. |
| **Authorization** | `AUTHORIZED` | The buyer submits the hosted checkout. Tilta checks the order against the buyer's credit and holds the order amount. |
| **Confirmation** | `CONFIRMED` | You commit to the order. Tilta keeps holding the order amount until you capture it. |
| **Capture** | `CAPTURED` | You invoice the order. The captured amount moves from the order to the invoice, and Tilta creates the financing, collection and insurance services for the invoice. |

Two windows apply:

* **24-hour confirmation window.** You have 24 hours to confirm an `AUTHORIZED` order. An order that is not confirmed in time moves to `EXPIRED` and releases the held amount.
* **90-day capture window.** You have 90 days to capture a `CONFIRMED` order. An order that is not captured in time moves to `EXPIRED` and releases the held amount.

## Happy path: checkout, then capture

**1. Create the order checkout**

Call [`POST /v1/orders/checkout`](https://docs.tilta.ai/api-reference/orders/create-order-checkout) with the order fields of [`POST /v1/orders`](https://docs.tilta.ai/api-reference/orders/create-order) at the top level. `payment_term` and `payment_method` are optional: send both to preselect a payment option that the buyer can still change, or neither to let the buyer choose. Reference an existing buyer with its `buyer_external_id`, or send the full `buyer` with its `contacts` – exactly one of the two. With `buyer_external_id`, Tilta uses the buyer as stored, `contacts` are optional, and an unknown ID returns `404` with `NOT_FOUND`. With `buyer`, `contacts` are required and at least one contact must have an email. Tilta creates the buyer, or uses an existing buyer with the same `external_id` without updating it if its details match.

The response contains the `OPEN` order and a hosted checkout session. Redirect the buyer to the returned `url`, or pass the `token` to the Tilta JS SDK.

**2. The buyer authorizes the order**

The buyer chooses a payment term, or keeps the preselected one, and submits the checkout. Tilta checks the order against the buyer's credit and holds the order amount. The order moves to `AUTHORIZED`, and the 24-hour confirmation window starts.

**3. Capture the order**

When the merchant fulfils the order, call [`POST /v1/orders/{external_id}/capture`](https://docs.tilta.ai/api-reference/orders/capture-order) with the invoice and its files. Capturing an `AUTHORIZED` order also confirms it, so you do not need a separate confirmation request. The order moves to `CAPTURED`.

### Separate confirmation

If you capture later than 24 hours after the buyer's authorization, confirm the order first. Call [`POST /v1/orders/{external_id}/confirm`](https://docs.tilta.ai/api-reference/orders/confirm-order) with an empty body while the order is `AUTHORIZED`. The order moves to `CONFIRMED`: Tilta keeps the held amount, replaces the 24-hour confirmation window with the 90-day capture window, and does not run a new credit check. Then capture the order within 90 days.

## Buyer-absent path: confirm, then capture

When the buyer is not present for a checkout – for example for a phone order or a recurring delivery – confirm the order directly:

**1. Create and confirm the order**

Call [`POST /v1/orders/confirm`](https://docs.tilta.ai/api-reference/orders/create-and-confirm-order) with the same body as [`POST /v1/orders`](https://docs.tilta.ai/api-reference/orders/create-order), including the `payment_term` and the `payment_method`. The buyer rules are the same as in the checkout request: send either `buyer_external_id`, with optional `contacts`, or the full `buyer` with its `contacts`, at least one of which has an email. Tilta creates the order, checks it against the buyer's credit and confirms it in the same request. The order is `CONFIRMED` in the response and never becomes `AUTHORIZED`. The 90-day capture window starts.

**2. Capture the order**

Call [`POST /v1/orders/{external_id}/capture`](https://docs.tilta.ai/api-reference/orders/capture-order) within 90 days.

## Payment links for an existing order

To send the buyer a payment link for an order that already exists, call [`POST /v1/orders/{external_id}/checkout`](https://docs.tilta.ai/api-reference/orders/create-checkout-for-order). It returns a hosted checkout session for the order, as the checkout request does. The order must be `OPEN`, `CANCELLED` or `EXPIRED`, and it must have no linked invoice.

## Cancelling and confirming again

Cancel an order that has no linked invoice with [`POST /v1/orders/{external_id}/cancel`](https://docs.tilta.ai/api-reference/orders/cancel-order). Cancelling releases the held amount. A `CAPTURED` order cannot be cancelled – correct it with a credit note instead.

To reactivate a `CANCELLED` or `EXPIRED` order, either send the buyer a new checkout for it, or confirm it with [`POST /v1/orders/{external_id}/confirm`](https://docs.tilta.ai/api-reference/orders/confirm-order). It uses the order's stored `payment_term` and `payment_method` unless you send new ones – if the order has none stored, send both. Confirming it again runs a fresh credit check against the buyer's current credit. If the check declines the order, the order keeps its status. Tilta sends `ORDER.CONFIRMED` each time an order is confirmed, so the event can arrive more than once for the same order.

## Capture

[`POST /v1/orders/{external_id}/capture`](https://docs.tilta.ai/api-reference/orders/capture-order) creates the invoice and uploads its files in one request. Send the files base64-encoded in the JSON body, at most five per request. Tilta creates the financing, collection and insurance services for the invoice, one each, so you don't send any services. The response is the invoice without its services; to read them, call [List services](https://docs.tilta.ai/api-reference/utilities/list-invoice-services.md).

The captured amount moves from the order to the invoice, and the order moves to `CAPTURED`. Tilta keeps the buyer's credit reserved from the authorization until the financing is booked.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.