> 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/api-reference/orders.md).

# orders

Create a checkout order and check its status.

| Endpoint                                                               | Purpose                    |
| ---------------------------------------------------------------------- | -------------------------- |
| [`POST /partner/v1/create-order`](#post-partnerv1create-order)         | Create an order            |
| [`POST /partner/v1/get-order-status`](#post-partnerv1get-order-status) | Get the status of an order |

## POST /partner/v1/create-order

**Create an order**

{% hint style="info" %}
Auth: send `client_id` and `client_secret` in the request body. Call it from your server only.
{% endhint %}

Create a checkout order. The order expires after 15 minutes. The money goes to your Payout Wallet. Your app must be Published.

Amount, currency and payee come from this call, never from the page. The same `reference` returns the same order.

**Errors:**

* Invalid client credentials
* The app is not Published
* `return_url` is not under your Allowed Origins
* The reference was used with other terms

### Parameters

| Name            | Type           | Required | Description                                                                                                                 |
| --------------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `client_id`     | string         | yes      | Your client ID.                                                                                                             |
| `client_secret` | string         | yes      | Your client secret. Server only.                                                                                            |
| `amount`        | number         | yes      | Amount to pay.                                                                                                              |
| `currency`      | string         | yes      | Currency code, for example `USD`.                                                                                           |
| `reference`     | string         | yes      | Your unique id for this order.                                                                                              |
| `description`   | string         | no       | Text shown to the customer.                                                                                                 |
| `return_url`    | string         | no       | Where the web checkout sends the customer back. It must be under your Allowed Origins.                                      |
| `splits`        | array of Split | no       | List of up to 20 splits. See Order splits. The sum must not be more than `amount`. Send it as a JSON string in a form body. |

### Request

{% tabs %}
{% tab title="curl" %}

```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"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/create-order"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "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",
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const response = await fetch("https://api.biti.so/partner/v1/create-order", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "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"
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "order_id": "MPO-00042",
    "status": "pending",
    "expires_at": "2026-11-18 10:45:00",
    "checkout_url": "/pay/MPO-00042"
  }
}
```

***

## POST /partner/v1/get-order-status

**Get the status of an order**

{% hint style="info" %}
Auth: send `client_id` and `client_secret` in the request body. Call it from your server only.
{% endhint %}

Check any order or payment request, with its splits. Ship goods only after the status is `paid`.

`status` is one of `pending`, `paid`, `expired`, `cancelled`, `failed`, `partially_refunded` or `refunded`.

If the order has splits, the answer also holds `splits`. See [Order splits](#) for the fields.

**Errors:**

* Invalid client credentials
* Unknown order

### Parameters

| Name            | Type   | Required | Description                                                     |
| --------------- | ------ | -------- | --------------------------------------------------------------- |
| `client_id`     | string | yes      | Your client ID.                                                 |
| `client_secret` | string | yes      | Your client secret. Server only.                                |
| `order_id`      | string | yes      | The `order_id` from `create-order` or `create-payment-request`. |

### Request

{% tabs %}
{% tab title="curl" %}

```bash
curl -X POST "https://api.biti.so/partner/v1/get-order-status" \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "order_id": "MPO-00041"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/get-order-status"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "order_id": "MPO-00041",
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const response = await fetch("https://api.biti.so/partner/v1/get-order-status", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "order_id": "MPO-00041"
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "order_id": "MPO-00041",
    "reference": "ORD-1042",
    "status": "paid",
    "amount": 24.5,
    "currency": "USD",
    "transaction_id": "5Q5QNT72JH",
    "paid_at": "2026-11-18 10:30:00"
  }
}
```


---

# 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/api-reference/orders.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.
