# Checking the remaining balance on the account

{% hint style="danger" %}
**ATTENTION: New Error Response Format**\
In the near future, errors in our system will be classified as **expected** and **unexpected**. Depending on the type of error, the format of the JSON response will be changed. Please review the new formats on the [**Error Codes**](https://docs.tarlanpayments.kz/eng/agws/error-codes) page. This change will be applied to all APIs in the AGWS system **except** ''[Make a payment](https://docs.tarlanpayments.kz/eng/agws/make-a-payment)'.&#x20;

Click [here ](#examples-of-error-responses-before-the-changes)to view the old and new JSON error responses. Please take note of this update and ensure your system is ready for these changes, if necessary.
{% endhint %}

<mark style="color:green;">`POST`</mark> <https://agwsapi.tarlanpayments.kz/showcase-gateway/api/v1/showcase/balance>

**Headers**

| Name         | Value                                                                              |
| ------------ | ---------------------------------------------------------------------------------- |
| Content-Type | `application/json`                                                                 |
| X-Signature  | [Authorization hash](https://docs.tarlanpayments.kz/eng/agws/creating-a-signature) |

**Body**

| Name                                       | Type   | Description                    |
| ------------------------------------------ | ------ | ------------------------------ |
| `agent`<mark style="color:red;">`*`</mark> | String | Showcase code in Tarlan system |

**Response**

| Name            | Type   | Description                                       |
| --------------- | ------ | ------------------------------------------------- |
| status          | bool   | Request processing status                         |
| status\_code    | uint   | Error code                                        |
| message         | string | Description of error                              |
| result          | Object | The result of a request that contains information |
| -showcase\_code | String | Showcase code in Tarlan system                    |
| -balance        | float  | Current balance                                   |

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

```json
{
    "status": true,
    "status_code": 0,
    "message": "Success",
    "result": {
        "showcase_code": "daw",
        "balance": 0
    }
}
```

{% endtab %}
{% endtabs %}

#### Examples of error responses *before* the changes

{% tabs %}
{% tab title="404 Not Found" %}

```json
{
    "status": false,
    "status_code": 8015,
    "message": "account doesn't exist",
    "result": {}
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

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

{% endtab %}
{% endtabs %}

#### Examples of error responses *after* the changes

{% tabs %}
{% tab title="200 OK: Expected error" %}

```json
{
    "status": true,
    "status_code": 0,
    "message": "Success",
    "result": {
        "error_code": 8015,
        "message": "account doesn't exist",
        "data": null
    }
}
```

{% endtab %}

{% tab title="400 Bad Request: Unexpected error" %}

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

{% endtab %}
{% endtabs %}
