# Payment System Callback

The method is designed to notify the project system about the payment status.

**Backoff Policy**\
To increase the reliability of receiving a response, Backoff policies are applied when making requests:

* **ntervals between retry attempts**: 500 milliseconds
* **Time jitter between retries**: 0.5 seconds
* **Maximum interval between retries**: 60 seconds
* **Total retry duration**: 10 minutes

After completing the payment, the payment system sends a request to the partner project to notify the payment status. The request is made to the URL specified in the **callback\_url** field during the payment process.

If an HTTP status other than 200 is received, the BackOff policies will be applied.

## Sending the callback

<mark style="color:green;">`POST`</mark>`https://merchant-website/result`

**Headers**

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

**Body**

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| agent<mark style="color:red;">\*</mark>         | String | Showcase code in Tarlan system  |
| project<mark style="color:red;">\*</mark>       | String | Project Code assigned by Tarlan |
| service\_code<mark style="color:red;">\*</mark> | String | Service ID on the showcase side |
| external\_id<mark style="color:red;">\*</mark>  | String | Payment ID on the showcase side |

**Response**

<table><thead><tr><th width="251">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>status_code</td><td>String</td><td>Transaction status code</td></tr><tr><td>status_message</td><td>String</td><td>Description of transaction status</td></tr><tr><td>username</td><td>String</td><td>User ID</td></tr><tr><td>amount</td><td>Float</td><td>Amount credited</td></tr><tr><td>datetime</td><td>String</td><td>Time of payment initiation in the storefront system. ISO 8601 Current Timestamp format</td></tr><tr><td>project</td><td>String</td><td>Project Code assigned by Tarlan</td></tr><tr><td>fail_reason</td><td>Object</td><td>Field Containing the <a href="/pages/jaku2OP7dRxTRwcpd0lz">Failure Reason</a></td></tr><tr><td>-code</td><td>Int</td><td>Rejection Reason Code</td></tr><tr><td>-message</td><td>String</td><td>Description of the Operation Rejection Reason</td></tr><tr><td>service_code</td><td>String</td><td>Service ID on the showcase side</td></tr><tr><td>external_id</td><td>String</td><td>Payment ID on the showcase side</td></tr></tbody></table>

```json
{
    "project": "Testing",
    "service_code": "70958",
    "external_id": "proident",
    "status_code": "4",
    "status_message": "Transaction was failed",
    "amount": 100.82,
    "datetime": "fugiat sed",
    "username": "enim culpa eiusmod laborum",
    "fail_reason": {
        "code": 6132012,
        "message": "nulla Ut eu dolore"
    }
}
```


---

# 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/agws/payment-system-callback.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.
