> 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/order-splits.md).

# order splits

One payment can be shared between many receivers. Biti holds each split after the customer pays. You release each one when it is earned: a store when it accepts, a driver when the delivery is done. You keep what is not split. You pay the fees, so each receiver gets the exact amount.

## The Diyaar example

The customer pays 47.00. Store A gets 18.00, store B gets 15.00, driver 1 gets 4.00 and driver 2 gets 3.50. Diyaar keeps 6.50.

```json
{
  "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET",
  "amount": 47.00, "currency": "USD", "reference": "ORDER-1042",
  "splits": [
    { "ref": "store-a", "to_wallet": "619990611@biti", "amount": 18.00, "role": "store", "label": "Order 1042", "sms": "{app}: you earned {amount} for order {ref}", "note": "A commission 10%" },
    { "ref": "store-b", "to_wallet": "619990612@biti", "amount": 15.00, "role": "store", "label": "Order 1042" },
    { "ref": "driver-1", "to_wallet": "619990621@biti", "amount": 4.00, "role": "driver", "label": "Delivery 1042" },
    { "ref": "driver-2", "to_wallet": "619990622@biti", "amount": 3.50, "role": "driver", "label": "Delivery 1042" }
  ]
}
```

Send this body to [`create-order`](file:///sirihduSQLZLwiPgqdx7/08c9d12f-863a-4aa7-9df8-1450285914df/api-reference/orders.md#post-partnerv1create-order) or [`create-payment-request`](file:///sirihduSQLZLwiPgqdx7/08c9d12f-863a-4aa7-9df8-1450285914df/api-reference/payment-requests.md#post-partnerv1create-payment-request).

## Split fields

| Field       | Meaning                                                                                                       |
| ----------- | ------------------------------------------------------------------------------------------------------------- |
| `ref`       | Unique in the order, up to 60 characters                                                                      |
| `to_wallet` | Active Biti wallet id or number, in the order currency                                                        |
| `amount`    | More than 0                                                                                                   |
| `role`      | `store`, `driver` or `other` (default `other`)                                                                |
| `release`   | `on_confirm` (default): held until you call `release-splits`. `now`: paid at once when the order is paid.     |
| `label`     | Up to 40 characters. The title the receiver sees in History.                                                  |
| `sms`       | Up to 160 characters. Sent after the split is released. Placeholders: `{amount}`, `{ref}`, `{name}`, `{app}`. |
| `note`      | Up to 500 characters. Private. Stored and returned to you. Never shown to the receiver.                       |

An order has at most 20 splits. The sum must not be more than the order amount.

## Steps

1. The customer pays. Biti moves each split to its wallet and holds it. You get `payment.paid`, then `split.held` for each split. Splits with `release: "now"` are paid at once and give `split.released`.
2. Call [`release-splits`](file:///sirihduSQLZLwiPgqdx7/08c9d12f-863a-4aa7-9df8-1450285914df/api-reference/order-splits.md#post-partnerv1release-splits) with `order_id` and `refs`, for example `["store-a"]`. Without `refs`, every held split is released. A repeat call changes nothing and sends no second SMS.
3. [`get-order-status`](file:///sirihduSQLZLwiPgqdx7/08c9d12f-863a-4aa7-9df8-1450285914df/api-reference/orders.md#post-partnerv1get-order-status) returns each split with `status` (`pending`, `held`, `released`, `refunded`, `failed`) and `sms_status` (`none`, `sent`, `failed`).

## Refunds with splits

* A refund with no `refs` reverses held splits first.
* A refund with `refs` reverses only those held splits and returns their total to the customer. Do not send `amount` with `refs`. Use it to refund one store in a multi-store payment.
* After a release, a refund can be at most the order amount minus the released splits and earlier refunds.

See [Refunds](broken://pages/650eaacc81284935371ef2d8b4abe617b4cc3eca).

{% hint style="info" %}
The SMS goes out only after the money moved. A failed SMS never undoes a payment. Each app can send 1,000 SMS a day through splits and bulk sends together.
{% endhint %}


---

# 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/order-splits.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.
