# Callback / IPN

Phía đối tác cần chuẩn bị Callback API để nhận về kết quả giao dịch **thành công** từ phía VinID Pay. (Với thanh toán thất bại, VinID Pay sẽ không thực hiện callback)

VinID sẽ cung cấp một Public Key cho đối tác để có thể thực hiện xác thực request do VinID gọi qua theo format sau :

```
Format: status;transactionID;orderID
signature = SHA256WithRSA(status;transactionID;orderID)
```

| **Tham số**     | **Định dạng** | **Mô tả**                                                                                                                       | **Ví dụ**                                                        |
| --------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| order\_id       | String        | <p>Order ID trong response trả về của VinID.</p><p><a href="/pages/-M0GTpiKayZXIIGUwCz_#create-order"><em>Xem thêm</em></a></p> | 20190101T00300000001                                             |
| pay\_status     | String        | Trạng thái thanh toán                                                                                                           | SUCCESS                                                          |
| signature       | String        | Chữ ký do VinID Pay tạo ra                                                                                                      | KFfoZvHz9n 6MimLnCNn+4/DtPFQenQH12 +3qX5RkfhBw2mfPTc/fHLfhSP4g== |
| transaction\_id | String        | Mã giao dịch của VinID                                                                                                          |                                                                  |
| extra\_data     | String        | Thông tin bổ sung của đơn hàng                                                                                                  |                                                                  |
| total\_discount | Number        | Tổng giá trị khuyến mãi của đơn hàng                                                                                            |                                                                  |
| user\_id        | String        | Mã người dùng đã thực hiện thanh toán                                                                                           |                                                                  |
| point\_amount   | Number        | Số điểm mà người dùng đã thanh toán                                                                                             |                                                                  |
| vnd\_amount     | Number        | Số tiền ví khách hàng đã thanh toán                                                                                             |                                                                  |

```
Method: GET
Query string:
○ order_id : mã đơn hàng
○ pay_status : trạng thái đơn hàng
○ transaction_id : mã giao dịch bên hệ thống của VinID
○ signature : chữ ký điện tử, để đối tác có thể verify request
Example: 
https://merchant-host.com?extra_data=&order_id=20190178900134567890&pay_status=SUCCESS&point_amount=0&total_discount=0&transaction_id=1234567890&user_id=12345&vnd_amount=99000&signature=sAHaSf1peit3rrMmD2PivrDSWq1dE%2BolCe1rknWH0f%2FV5eYZ5lJv7Kygrv7Wp9PUbZUO2lbbLUBSFfdF7y4UVwQLFIzFTUCBymPqYFyOz8nsTXFWAoneigFm0B4%2BoZIT1yVZERF2mqwnFdPLRhnkCN4zq9z8g%3D%3D
```


---

# 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://developers.vinid.net/tai-lieu-tich-hop/dich-vu-thanh-toan-vinid-pay/callback-ipn.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.
