# 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](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  |
| 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="reason-for-operation-rejection">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"
    }
}
```
