# Đồng bộ điểm bán

<mark style="color:green;">**`POST`**</mark> API Sync TID

```
https://<vietqr-host>/<basepath>/api/tid/synchronize/v1
```

**Headers**

<table><thead><tr><th width="283">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization</td><td><code>Bearer &#x3C;token></code></td></tr></tbody></table>

**Body**

{% hint style="warning" %}
Đối tác truyền `merchantId` thì không cần truyền `merchantName`.
{% endhint %}

<table data-full-width="false"><thead><tr><th width="240">Name</th><th width="110">Type</th><th width="98">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>terminals</code></td><td>List object</td><td>Yes</td><td>Danh sách các điểm bán.</td></tr><tr><td><code>merchantId</code></td><td>String</td><td>Yes</td><td>ID của đại lý.</td></tr><tr><td><code>merchantName</code></td><td>String</td><td>Yes</td><td>Tên rút gọn đại lý.</td></tr><tr><td><code>terminalCode</code></td><td>String</td><td>Yes</td><td>Mã cửa hàng/điểm bán.</td></tr><tr><td><code>terminalName</code></td><td>String</td><td>Yes</td><td>Tên cửa hàng/điểm bán.</td></tr><tr><td><code>terminalAddress</code></td><td>String</td><td>Yes</td><td>Địa chỉ cửa hàng/điểm bán.</td></tr><tr><td><code>bankCode</code></td><td>String</td><td>Yes</td><td>Mã ngân hàng.</td></tr><tr><td><code>bankAccount</code></td><td>String</td><td>Yes</td><td>Số tài khoản ngân hàng.</td></tr><tr><td><code>checkSum</code></td><td>String</td><td>Yes</td><td><p>Chuỗi mã hóa MD5 của tổ hợp:</p><p>(<code>password</code> + <code>bankCode</code> + <code>bankAccount</code>)</p></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "status": "SUCCESS",
    "data": [
        {
            "tid": "ID_điểm_bán",
            "terminalName": "tên_điểm_bán",
            "terminalCode": "mã_điểm_bán",
            "bankAccount": "số_tài_khoản_áp_dụng_cho_điểm_bán",
            "bankCode": "mã_ngân_hàng"
        }
    ]
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "status": "FAILED",
    "message": "mã_lỗi_và_mô_tả_lỗi"
}
```

{% endtab %}
{% endtabs %}

***

### Code mẫu

{% tabs %}
{% tab title="cURL" %}

```
curl --location 'https://api.vietqr.org/vqr/api/tid/synchronize/v1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwidXNlciI6IlkzVnpkRzl0WlhJdGJtZDFlV1Z1TFhWelpYSXlORGt5IiwiaWF0IjoxNzIwMDg4MDE3LCJleHAiOjE3MjAwODgwNzZ9.3_jljTg8llYVANJW4MVqW6YsJZbFl10r2AC66NNXCuSDWMyNYd2MlbnStNuyjHIqYDO5E5jD0izl4puPckYSyw' \
--header 'Cookie: JSESSIONID=EB9099326C4526CAA29AD331FFE6B789' \
--data '{
    "terminals": [ //DANH SÁCH CỬA HÀNG CỦA ĐẠI LÝ C ̀N ĐỒNG BỘ
        {
            "mid": "id_của_đại_lý", 
            "merchantName": "tên_viết_tắt_của_đại_lý", 
            "terminalName": "tên_cửa_hàng",
            "terminalCode": "mã_code_của_cửa_hàng",
            "terminalAddress": "địa_chỉ_của_cửa_hàng",
            "bankAccount": "số_tài_khoản_ngân_hàng",
            "bankCode": "mã_code_của_ngân_hàng",
            "checkSum": "HASHMD5 128 bit của: password_khi_get_token + bank_code + bankAccount" 
            
        }
    ]
}'
```

{% endtab %}
{% endtabs %}

***

### Các câu hỏi thường gặp


---

# 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://api.vietqr.vn/en/vn/api-vietqr-callback/synchronize-information/dong-bo-diem-ban.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.
