> 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-1/payment-requests.md).

# payment requests

Ask the connected customer to pay, or charge their auto-pay.

| Endpoint                                                                           | Purpose                  |
| ---------------------------------------------------------------------------------- | ------------------------ |
| [`POST /partner/v1/create-payment-request`](#post-partnerv1create-payment-request) | Create a payment request |

## POST /partner/v1/create-payment-request

**Create a payment request**

{% hint style="info" %}
Auth: send the customer token in the `X-Biti-Token` header. Do not send `client_id` or `client_secret`.
{% endhint %}

Ask the connected customer to pay (`mode: request`), or charge their auto-pay approval (`mode: charge`). The money goes to your Payout Wallet.

`mode: request` creates an order for this customer. It is valid for 24 hours. The customer gets a notification such as "Diyaar requests USD 24.50" that opens the request in Biti. The status is `pending`. The customer pays with the PIN or declines.

`mode: charge` needs an active mandate of your app and this customer, approved for the connected wallet. Biti charges at once with the mandate rules and returns `paid`.

The same `reference` always returns the same order.

**Errors:**

* Access token required, or the token has no `wallet.read` scope
* The currency is not the wallet currency
* The reference was used with other terms
* No usable mandate (mode `charge`)
* The charge is over the mandate limit
* Not enough balance

### Parameters

| Name          | Type           | Required | Description                                                                                                                 |
| ------------- | -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| `amount`      | number         | yes      | Amount to pay.                                                                                                              |
| `currency`    | string         | yes      | Must match the currency of the connected wallet.                                                                            |
| `reference`   | string         | yes      | Your unique id for this request, for example `ORD-1042`.                                                                    |
| `description` | string         | no       | Text shown to the customer.                                                                                                 |
| `mode`        | string         | no       | `request` (default) or `charge`.                                                                                            |
| `mandate_id`  | string         | no       | For `charge`: the mandate to use. If you omit it, Biti uses the oldest active mandate in the currency.                      |
| `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-payment-request" \
  -H "Content-Type: application/json" \
  -H "X-Biti-Token: YOUR_ACCESS_TOKEN" \
  -d '{
  "amount": 24.5,
  "currency": "USD",
  "reference": "ORD-1042",
  "mode": "request",
  "description": "Diyaar order ORD-1042"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/create-payment-request"
headers = {
    "Content-Type": "application/json",
    "X-Biti-Token": "YOUR_ACCESS_TOKEN",
}
payload = {
    "amount": 24.5,
    "currency": "USD",
    "reference": "ORD-1042",
    "mode": "request",
    "description": "Diyaar order ORD-1042",
}

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-payment-request", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Biti-Token": "YOUR_ACCESS_TOKEN"
  },
  body: JSON.stringify({
    "amount": 24.5,
    "currency": "USD",
    "reference": "ORD-1042",
    "mode": "request",
    "description": "Diyaar order ORD-1042"
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "order_id": "MPO-00041",
    "status": "pending"
  }
}
```


---

# 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-1/payment-requests.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.
