---
description: The documentation covers an API designed to dynamically generate QR codes.
---

# Dynamic QR generate

{% hint style="info" %}
Take into consideration,  there is no test transaction via QR
{% endhint %}

1. To generate QR image, please send <mark style="color:orange;">POST</mark> request to the following endpoint

<mark style="color:orange;">POST</mark>  [ ](https://{url}.finipay.kg/gen/qr/dynamic)[https://{url}.finipay.kg/gen/qr/dynamic](https://{url}.finipay.kg/gen/qr/dynamic-qr)

Accessing the API requires passing credentials using <mark style="color:green;">Basic Authentication</mark> in the HTTP request **header**.

**Request body:**

| Name                                  | Type   | Description                                                      |
| ------------------------------------- | ------ | ---------------------------------------------------------------- |
| sum<mark style="color:red;">\*</mark> | int    | transaction amount in tyiyn (cents)                              |
| requisite                             | String | phone number, name of the enterprise (branch) shall be indicated |
| callback\_url                         | String | URL for callbacks is not required                                |

Example:

```json
{
    "sum": 100,
    "requisite": "996555000001",
    "callback_url": "https://example.com"
}
```

**Response:**

In the response you will receive an PNG image encoded in base64

File format: PNG

Image dimensions: 400x400 pixels



{% tabs %}
{% tab title="100" %}
```json
{
    "code": "100",
    "message": "SUCCESS",
    "data": Картинка QR, закодированная в base64
}
```
{% endtab %}

{% tab title="104" %}
```json
{
    "code": "104",
    "message": "BAD_REQUEST",
    "data": null
}
```
{% endtab %}

{% tab title="105" %}
```json
{
    "code": "105",
    "message": "INTERNAL_ERROR",
    "data": null
}
```
{% endtab %}

{% tab title="106" %}
```json
{
    "code": "106",
    "message": "MERCHANT_NOT_FOUND",
    "data": null
}
```
{% endtab %}
{% endtabs %}



2. To generate QR data, please send <mark style="color:orange;">POST</mark> request to the following endpoint

<mark style="color:orange;">POST</mark>   [https://{url}.finipay.kg/gen/qr/dynamic/data](https://{url}.finipay.kg/gen/qr/dynamic/data)

**Request** **Body:**

| Name          | Type   | Description                                                      |
| ------------- | ------ | ---------------------------------------------------------------- |
| sum           | int    | transaction amount in tyiyn (cents)                              |
| requisite     | String | phone number, name of the enterprise (branch) shall be indicated |
| callback\_url | String | URL for callbacks is not required                                |

**Example:**

```json
{
    "sum": 100,
    "requisite": "996555000001",
    "callback_url": "https://example.com"
}
```

**Response:**

You will receive QR data in response

{% tabs %}
{% tab title="100" %}
```json
{
    "code": "100",
    "message": "SUCCESS",
    "data": qr_data
}
```
{% endtab %}

{% tab title="104" %}
```json
{
    "code": "104",
    "message": "BAD_REQUEST",
    "data": null
}
```
{% endtab %}

{% tab title="105" %}
```json
{
    "code": "105",
    "message": "INTERNAL_ERROR",
    "data": null
}
```
{% endtab %}

{% tab title="106" %}
```json
{
    "code": "106",
    "message": "MERCHANT_NOT_FOUND",
    "data": null
}
```
{% endtab %}
{% endtabs %}





## Status

To get status, send <mark style="color:green;">GET</mark> request to the following endpoint

<mark style="color:green;">GET</mark> [https://{urll}.finipay.kg/gen/qr/transaction/status](https://prod.finipay.kg/gen/qr/transaction/status)

**Request Param:**

| Key             | Value                            |
| --------------- | -------------------------------- |
| transaction\_id | FNP89a867313cc34613ac8608ec31b1c |

<mark style="color:yellow;">**Example**</mark>: [https://{url}.finipay.kg/gen/qr/transaction/status?transaction\_id=QPF89a867313bb34613ac8608ec31b1c](https://{url}.finipay.kg/gen/qr/transaction/status?transaction_id=QPF89a867313bb34613ac8608ec31b1c)

**Response**

{% hint style="info" %}
The date field contains information about the payment statusl.
{% endhint %}

{% tabs %}
{% tab title="100" %}
```json
// Промежуточный
{
    "code": "100",
    "message": "Success",
    "data": "СREATED"
}



// Финальный
{
    "code": "100",
    "message": "Success",
    "data": "SUCCESSFUL"
}

```
{% endtab %}

{% tab title="104" %}
```json
{
    "code": "104",
    "message": "Bad request",
    "data": null
}
```
{% endtab %}
{% endtabs %}

