> For the complete documentation index, see [llms.txt](https://docs.biti.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.biti.so/orders-checkout.md).

# orders checkout

An order is a checkout that your server creates. The amount, currency and payee come from your call, never from the page.

## Steps

1. Your server calls [`create-order`](file:///sirihduSQLZLwiPgqdx7/08c9d12f-863a-4aa7-9df8-1450285914df/api-reference/orders.md#post-partnerv1create-order). You get an `order_id`. An order expires after 15 minutes.
2. In the Biti mini browser, your page calls `biti.requestPayment({ order_id })`.
3. In a normal browser, send the customer to `{BASE}/pay/<order_id>?return=<your url>`.
4. Confirm with [`get-order-status`](file:///sirihduSQLZLwiPgqdx7/08c9d12f-863a-4aa7-9df8-1450285914df/api-reference/orders.md#post-partnerv1get-order-status) or the `payment.paid` webhook.

```bash
curl -X POST "https://api.biti.so/partner/v1/create-order" \
  -H "Content-Type: application/json" \
  -d '{"client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET",
       "amount": 174, "currency": "USD", "reference": "BK-2041",
       "description": "Lido Beach Hotel, 2 nights",
       "return_url": "https://diyaar.so/checkout/done"}'
```

## Return URL

After a web checkout, Biti sends the customer to your `return_url` with `?biti_order=<id>&status=paid` or `&status=cancelled`. The `return_url` must be under your Allowed Origins.

{% hint style="warning" %}
Verify with `get-order-status` before you trust the query string.
{% endhint %}

## Order status

`pending`, `paid`, `expired`, `cancelled`, `failed`, `partially_refunded` or `refunded`.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.biti.so/orders-checkout.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
