> 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/set-markup.md).

# Set Markup

### Liquidity Pool

<mark style="color:purple;">`PATCH`</mark> <https://sandbox.triangle.digital/api/v2/liquidity\\_pool/clients/{client\\_id}/markup>

Sets or removes the markup of a Business account. The answer is the stored markup, as [Get Markup](/tri-doc/liquidity-pool/get-markup.md) answers it.

**What the markup changes.** It is added to the total of every purchase made for the client's Carbon Pool companies and Individual Consumptions (`payer_type` `company` or `individual_consumption`):

* `percent` — that percentage of the purchase total, rounded to the cent;
* `usd` — that fixed amount once per payment: once per [Buy Carbon Pool](/tri-doc/liquidity-pool/buy-carbon-pool.md) purchase, once per invoice of a company employee or an Individual Consumption in [Purchase Assets](/tri-doc/liquidity-pool/purchase-assets.md).

The price of the lines does not change — `pool_px` and the line `notional` stay as quoted; the markup is in `data.notional`, the amount charged, and is reported on its own as `data.markup`. The minimum of a purchase (1 QTY and $25.00) is measured before the markup.

A QTY hold keeps the markup in force when it was taken: a purchase made with the `reservation_group` of [Reserve Pool Price QTY](/tri-doc/liquidity-pool/reserve-pool-price-qty.md) or [Reserve Invoices QTY](/tri-doc/liquidity-pool/reserve-invoices-qty.md) is charged the markup that hold answered, even if the markup was changed since.

When a purchase paid from the Spending Capacity balance is only partly delivered, the money returned for the undelivered part includes its share of a `percent` markup; a `usd` markup is returned only when nothing was delivered.

The answer is the markup resource itself, without the `{message, success, data, operations_count}` envelope. Errors are answered as `application/problem+json` with `title`, `status`, `code` and, when there is more to say, `detail` and `param` — the request field at fault. Repeating the request stores the same value.

**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 whose markup is set — a Business account.</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>

**Query parameters**

<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></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>markup_type</code></td><td>string</td><td>How the markup is counted. One of: <code>percent</code>, <code>usd</code>. <strong>Required</strong> unless <code>markup_value</code> removes the markup.</td><td>percent</td></tr><tr><td><code>markup_value</code></td><td>string</td><td><strong>Required.</strong> The size of the markup, digits only, up to two decimals, up to 999999.99. No symbols or thousands separators — <code>"1,5"</code> or <code>"5%"</code> are refused. An empty value or <code>0</code> removes the markup.</td><td>5</td></tr></tbody></table>

```json
{
    "markup_type": "percent",
    "markup_value": "2.5"
}
```

**Response fields**

<table data-full-width="true" data-search="false"><thead><tr><th width="230">Field</th><th width="110">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>markup</code></td><td>object</td><td>The markup stored by this call. <code>null</code> when the call removed it.</td></tr><tr><td><code>markup.type</code></td><td>string</td><td>One of: <code>percent</code>, <code>usd</code>.</td></tr><tr><td><code>markup.value</code></td><td>string</td><td>The size of the markup as a decimal string with two decimals.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}
{% code fullWidth="false" %}

```json
{
    "markup": {
        "type": "usd",
        "value": "10.00"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="404" %}
The client does not exist, is not available to the API key, or is not a Business account. Nothing was changed.

```json
{
    "title": "Client not found",
    "status": 404,
    "code": "not_found",
    "detail": "The client is not a Carbon Pool Partner."
}
```

{% endtab %}

{% tab title="422" %}
`markup_value` is missing or is not a valid amount, `markup_type` is not one of the allowed values, the value has more than two decimals, or it is above the limit. `param` names the field at fault. Nothing was changed.

```json
{
    "title": "The markup is not valid",
    "status": 422,
    "code": "invalid_markup",
    "detail": "Enter the markup as a number with up to 2 decimals.",
    "param": "markup_value"
}
```

{% endtab %}
{% endtabs %}
