> For the complete documentation index, see [llms.txt](https://tri.gitbook.io/tri-doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tri.gitbook.io/tri-doc/liquidity-pool/reserve-invoices-qty.md).

# Reserve Invoices QTY

### Liquidity Pool

<mark style="color:green;">`POST`</mark> <https://sandbox.triangle.digital/api/v2/liquidity\\_pool/clients/{client\\_id}/reservations/invoices>

Holds for 10 minutes the carbon pool quantity that buying the given invoices will pull, so the purchase that follows cannot lose it to another buyer. Unlike [Reserve Pool Price QTY](/tri-doc/liquidity-pool/reserve-pool-price-qty.md), the caller does not say how much: the allocation the purchase would make is computed here — cheapest records first, exactly as [Purchase Assets](/tri-doc/liquidity-pool/purchase-assets.md) picks them — and held as computed. What that allocation looks like can be previewed with [Get Available Assets](/tri-doc/liquidity-pool/get-available-assets.md).

While the hold lasts, that quantity is not available to anyone else — including the same client in another purchase window.

The hold is all-or-nothing: if the pool cannot cover every invoice in full, nothing is reserved and the call is refused with `pool_changed`.

What the hold consists of is not reported. Call [Purchase Assets](/tri-doc/liquidity-pool/purchase-assets.md) with the `reservation_group` — it answers with what was actually bought.

An unused hold disappears by itself when it expires; a completed purchase releases its hold on the way out. To free it earlier — when the client cancels or closes the purchase flow — call [Release Reservation](/tri-doc/liquidity-pool/release-reservation.md).

**Path parameters**

<table data-full-width="true" data-search="false"><thead><tr><th width="230">Name</th><th width="110">Type</th><th>Description</th><th width="210">Where to take it from</th></tr></thead><tbody><tr><td><code>client_id</code></td><td>integer</td><td><strong>Required.</strong> The client the quantity is held for.</td><td><a href="/tri-doc/liquidity-pool/get-clients.md">Get Clients</a> — <code>client_id</code></td></tr></tbody></table>

**Headers**

<table data-full-width="true"><thead><tr><th>Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr></tbody></table>

**Body**

<table data-full-width="true" data-search="false"><thead><tr><th width="200">Name</th><th width="110">Type</th><th>Description</th><th width="260">Example</th></tr></thead><tbody><tr><td><code>hash</code></td><td>string</td><td><strong>Required.</strong> API key.</td><td>fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1</td></tr><tr><td><code>invoice_ids</code></td><td>array</td><td><strong>Required.</strong> Invoices whose quantity is held — the same list the purchase is then made with. Every id must belong to this client; duplicates are refused. From <a href="/tri-doc/liquidity-pool/get-invoices.md">Get Invoices</a> — <code>invoice_id</code>.</td><td><pre class="language-json"><code class="lang-json">[1041, 1042]
</code></pre></td></tr></tbody></table>

```json
{
    "hash": "fk5f0iuy-rr06-j4x3-i75b-fy2s67s4ilo1",
    "invoice_ids": [1041, 1042]
}
```

**Response fields**

<table data-full-width="true" data-search="false"><thead><tr><th width="360">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>message</code></td><td>string</td><td>Human-readable result of the call.</td></tr><tr><td><code>success</code></td><td>boolean</td><td>Whether the call succeeded; a refused call answers HTTP 400.</td></tr><tr><td><code>data.reservation_group</code></td><td>uuid</td><td>Identifier of the hold. Pass it to <a href="/tri-doc/liquidity-pool/purchase-assets.md">Purchase Assets</a> as <code>reservation_group</code> — a purchase made without it competes with this hold and can be refused.</td></tr><tr><td><code>data.expires_at</code></td><td>string</td><td>When the hold runs out, ISO 8601 in UTC.</td></tr><tr><td><code>data.expires_in_seconds</code></td><td>integer</td><td>Seconds left until the hold runs out, counted at the moment of the answer.</td></tr><tr><td><code>data.ttl_minutes</code></td><td>integer</td><td>How long a hold lasts, in minutes.</td></tr><tr><td><code>data.error_code</code></td><td>string</td><td>Present on a refusal by availability: <code>pool_changed</code> — the pool no longer covers the invoices, nothing is reserved.</td></tr><tr><td><code>operations_count</code></td><td>integer</td><td>Always <code>1</code>.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}
The quantity is held. Buy the invoices within `expires_in_seconds`, passing `reservation_group`.

{% code fullWidth="false" %}

```json
{
    "message": "QTY reserved successfully.",
    "success": true,
    "data": {
        "reservation_group": "6f7d2a41-8c3e-4b90-9a55-2f0c1de7b834",
        "expires_at": "2026-08-14T11:07:55Z",
        "expires_in_seconds": 600,
        "ttl_minutes": 10
    },
    "operations_count": 1
}
```

{% endcode %}
{% endtab %}

{% tab title="400" %}
Nothing is reserved. A refusal by availability carries `error_code` to branch on; a request that does not pass validation answers with the problem in `message` and an empty `data` (`Invalid request parameters.` — an id is missing, is not a number or does not belong to this client; `invoice_ids contains duplicates.`).

```json
{
    "message": "Pool availability has changed. Please refresh and try again.",
    "success": false,
    "data": {
        "error_code": "pool_changed"
    },
    "operations_count": 1
}
```

{% endtab %}
{% endtabs %}
