> 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/deposit-holds.md).

# deposit holds

Reserve, capture and release deposits.

| Endpoint                                                             | Purpose                  |
| -------------------------------------------------------------------- | ------------------------ |
| [`POST /partner/v1/create-hold`](#post-partnerv1create-hold)         | Create a hold            |
| [`POST /partner/v1/capture-hold`](#post-partnerv1capture-hold)       | Capture a hold           |
| [`POST /partner/v1/release-hold`](#post-partnerv1release-hold)       | Release a hold           |
| [`POST /partner/v1/get-hold-status`](#post-partnerv1get-hold-status) | Get the status of a hold |

## POST /partner/v1/create-hold

**Create a hold**

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

Reserve money for a while. After you create the hold, ask the customer to approve it with `biti.requestHold({ hold_id })`, or send the customer to the web hold page. After the PIN, the status is `held`.

**Errors:**

* Invalid client credentials
* `release_by` is more than 30 days away
* 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 reserve.                                                                          |
| `currency`      | string | yes      | Currency code.                                                                              |
| `reference`     | string | yes      | Your unique id. The same `reference` returns the same hold.                                 |
| `release_by`    | string | yes      | ISO date and time, at most 30 days away. Biti releases the hold on its own after this time. |
| `description`   | string | no       | Text shown to the customer.                                                                 |
| `return_url`    | string | no       | Where the web hold page sends the customer back. It must be under your Allowed Origins.     |

### Request

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

```bash
curl -X POST "https://api.biti.so/partner/v1/create-hold" \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "amount": 50,
  "currency": "USD",
  "reference": "DEP-2041",
  "release_by": "2026-11-23T12:00:00",
  "description": "Room deposit"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/create-hold"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "amount": 50,
    "currency": "USD",
    "reference": "DEP-2041",
    "release_by": "2026-11-23T12:00:00",
    "description": "Room deposit",
}

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-hold", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "amount": 50,
    "currency": "USD",
    "reference": "DEP-2041",
    "release_by": "2026-11-23T12:00:00",
    "description": "Room deposit"
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "hold_id": "MHD-00003",
    "status": "pending"
  }
}
```

***

## POST /partner/v1/capture-hold

**Capture a hold**

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

Take all or part of the held money. The captured amount goes to your Payout Wallet. The rest returns to the customer.

**Errors:**

* Invalid client credentials
* The amount is more than the held amount
* The hold is not `held`
* The `release_by` time has passed

### Parameters

| Name            | Type   | Required | Description                                                   |
| --------------- | ------ | -------- | ------------------------------------------------------------- |
| `client_id`     | string | yes      | Your client ID.                                               |
| `client_secret` | string | yes      | Your client secret. Server only.                              |
| `hold_id`       | string | yes      | The hold to capture.                                          |
| `amount`        | number | no       | Amount to take. At most the held amount. Omit it to take all. |

### Request

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

```bash
curl -X POST "https://api.biti.so/partner/v1/capture-hold" \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "hold_id": "MHD-00003",
  "amount": 20
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/capture-hold"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "hold_id": "MHD-00003",
    "amount": 20,
}

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/capture-hold", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "hold_id": "MHD-00003",
    "amount": 20
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "hold_id": "MHD-00003",
    "status": "captured",
    "captured_amount": 20,
    "transaction_id": "9LM..."
  }
}
```

***

## POST /partner/v1/release-hold

**Release a hold**

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

Give all the money back to the customer. A release costs nothing, and the customer also gets back the fees of the held payment.

**Errors:**

* Invalid client credentials
* Unknown hold

### Parameters

| Name            | Type   | Required | Description                      |
| --------------- | ------ | -------- | -------------------------------- |
| `client_id`     | string | yes      | Your client ID.                  |
| `client_secret` | string | yes      | Your client secret. Server only. |
| `hold_id`       | string | yes      | The hold to release.             |

### Request

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

```bash
curl -X POST "https://api.biti.so/partner/v1/release-hold" \
  -H "Content-Type: application/json" \
  -d '{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "hold_id": "MHD-00003"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/release-hold"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "hold_id": "MHD-00003",
}

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/release-hold", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "hold_id": "MHD-00003"
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "hold_id": "MHD-00003",
    "status": "released"
  }
}
```

***

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

**Get the status of a hold**

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

Return the status of a hold.

`status` is `pending`, `held`, `captured`, `released` or `expired`. After a capture the answer also holds `captured_amount` and `transaction_id`.

**Errors:**

* Invalid client credentials
* Unknown hold

### Parameters

| Name            | Type   | Required | Description                      |
| --------------- | ------ | -------- | -------------------------------- |
| `client_id`     | string | yes      | Your client ID.                  |
| `client_secret` | string | yes      | Your client secret. Server only. |
| `hold_id`       | string | yes      | The hold to check.               |

### Request

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

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

{% endtab %}

{% tab title="Python" %}

```python
import requests

url = "https://api.biti.so/partner/v1/get-hold-status"
headers = {
    "Content-Type": "application/json",
}
payload = {
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "hold_id": "MHD-00003",
}

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-hold-status", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET",
    "hold_id": "MHD-00003"
  }),
});
console.log(await response.json());
```

{% endtab %}
{% endtabs %}

### Response

```json
{
  "success": true,
  "message": "",
  "data": {
    "hold_id": "MHD-00003",
    "status": "held",
    "amount": 50,
    "currency": "USD",
    "release_by": "2026-11-23 12:00: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/deposit-holds.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.
