# Картаны байластыру

1. Project\_client\_id көрсете отырып, картаны байластыру үшін транзакция құру.
2. 10 теңгеге төлем жасалады.
3. Мерчант төлем бетіне қайта жібереді.
4. Төлем жүргізілгеннен кейін 10 теңге қайтарылады.

{% hint style="info" %}
Мерчант картасын байластыру нәтижесін пайдаланушының байластырылған карталарының тізімін алу әдісінен біле аласыз, Webhook қаражатты есептен шығарғаннан кейін жіберіледі. Келесі төлемдер кезінде пайдаланушыға бұрын байластырылған карталар қолжетімді болады.
{% endhint %}

## Картаны байластыру үшін транзакция құру.

<mark style="color:green;">`POST`</mark> `https://prapi.tarlanpayments.kz/transaction/api/v1/transaction/primal/card-link`

#### Headers

| Name                                            | Type   | Description                                                                                               |
| ----------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer Авторотациялық хэш ([Қолтаңбаны қалыптасуына ](/az/t-lem-shlyuzi/olta-bany-alyptastyru.md)қараңыз) |

#### Request Body

| Name                                                     | Type    | Description                                                                                                                                            |
| -------------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| project\_id<mark style="color:red;">\*</mark>            | Integer | Төлем жүйесі беретін жобаның сәйкестендіргіші                                                                                                          |
| merchant\_id<mark style="color:red;">\*</mark>           | Integer | Төлем жүйесі беретін мерчант сәйкестендіргіші                                                                                                          |
| project\_client\_id<mark style="color:red;">\*</mark>    | String  | Жоба жағындағы клиент сәйкестендіргіші                                                                                                                 |
| success\_redirect\_url<mark style="color:red;">\*</mark> | String  | Сәтті төлегеннен кейін пайдаланушының редиректісі орындалатын жоба беті                                                                                |
| failure\_redirect\_url<mark style="color:red;">\*</mark> | String  | Сәтсіз төлемнен кейін пайдаланушының редиректісі орындалатын жоба беті. Егер параметр берілмесе, редирект success\_redirect\_url-де орындалатын болады |
| description<mark style="color:red;">\*</mark>            | String  | Төлемнің сипаты                                                                                                                                        |
| additional\_data                                         | Object  | Қосымша параметрлер                                                                                                                                    |
| callback\_url                                            | String  | Транзакция мәртебесімен коллбэкті түзету үшін жобаның URL-і (Сallback жіберуді қараңыз)                                                                |

{% tabs %}
{% tab title="200: OK Сәтті жауап үлгісі " %}

```json
{
    "status": true,
    "message": "Success",
    "result": "https://process.tarlanpayments.kz?hash=$2a$10$nhrUYWm9sDVYqCL4LKxn9ugrdC4Pszz5wGaUsDYYIqCGc8ZA4Vu0y&transaction_id=100474"
}
```

{% endtab %}

{% tab title="500: Internal Server Error Қатесі бар жауап үлгісі" %}

```json
{
    "status": false,
    "status_code": 5000,
    "message": "transaction already exists",
    "result": {}
}
```

{% endtab %}
{% endtabs %}

{% code fullWidth="true" %}

```bash
curl --location 'https://prapi.tarlanpayments.kz/transaction/api/v1/transaction/primal/card-link'  \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sign' \
--data-raw '{
    "callback_url": "https://test.site/callback_url",
    "description": "desc",
    "failure_redirect_url": "https://www.test.com",
    "merchant_id": 2222,
    "project_client_id": "999",
    "project_id": 111,
    "success_redirect_url": "https://www.test.com",
    "additional_data": {
        "test": "value",
        "qwerty": "123"
    }
}'
```

{% endcode %}


---

# 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/az/t-lem-shlyuzi/t-lem-nysanymen-zara-is-imyl/kartany-bailastyru.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.
