# Calculation of the upper commission

<mark style="color:yellow;">`POST`</mark> `https://agwsapi.tarlanpayments.kz/showcase-gateway/api/v1/calculate/upper/commission`&#x20;

### Headers

| Name         | Value                                                   |
| ------------ | ------------------------------------------------------- |
| Content-Type | application/json                                        |
| X-Signature  | [Authorization hash](/eng/agws/creating-a-signature.md) |

### Request body parameters

<table><thead><tr><th width="165">Name</th><th width="135">Type</th><th>Description</th></tr></thead><tbody><tr><td>agent</td><td>string</td><td>The code of the showcase in the Tarlanpayments system</td></tr><tr><td>project</td><td>string</td><td>The Project code in the Tarlanpayments system</td></tr><tr><td>service_code</td><td>string</td><td>The service code in the Tarlanpayments system</td></tr><tr><td>amount</td><td>float64</td><td>The amount to calculate the top commission for</td></tr></tbody></table>

### Response body parameters

<table><thead><tr><th width="241">Name</th><th width="147">Type</th><th>Description</th></tr></thead><tbody><tr><td>status</td><td>boolean</td><td>Request processing status</td></tr><tr><td>status_code</td><td>uint</td><td>Error code</td></tr><tr><td>message</td><td>string</td><td>Error description</td></tr><tr><td>result</td><td>object</td><td>The object that stores the query result</td></tr><tr><td>-amount</td><td>float64</td><td>The amount for which it was necessary to calculate the top commission</td></tr><tr><td>-amount_with_commission</td><td>float64</td><td><p>Total amount with top commission</p><p>(amount + commission)</p></td></tr><tr><td>-commission</td><td>float64</td><td>The amount of the top commission</td></tr></tbody></table>

{% tabs %}
{% tab title="200: OK  Example of a successful response" %}

```
{
    "status": true,
    "message": "Success",
    "status_code": 0,
    "result": {
        "amount": 10.4,
        "amount_with_commission": 11.84,
        "commission": 1.44
    }
}
```

{% endtab %}

{% tab title="400: Bad Request Example of an error response" %}

```
{
    "status": false,
    "status_code": 1014,
    "message": "Invalid signature",
    "result": {}
}
```

{% endtab %}
{% endtabs %}

```bash
curl --location 'https://agwsapi.tarlanpayments.kz/showcase-gateway/api/v1/calculate/upper/commission' \
--header 'X-Signature: 7ff51c9f26c287e42fa37537df719974e297a751c4e2eba26d7622sgwgf225543sa' \
--header 'Content-Type: application/json' \
--data '{
    "agent":"agent",
    "project":"project",
    "service_code":"service",
    "amount": 10.42
}'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tarlanpayments.kz/eng/calculation-of-the-upper-commission.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
