# Synchronize master agent

{% hint style="danger" %}
Customers and partners who are not under the master agent category can skip this step.
{% endhint %}

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

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

**Headers**

<table><thead><tr><th width="209.5703125">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**

<table data-full-width="false"><thead><tr><th width="211">Name</th><th width="106.296875">Type</th><th width="88.3671875">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>merchants</code></td><td>List object</td><td>Yes</td><td>List of agents to be synchronized.</td></tr><tr><td><code>merchantId</code></td><td>String</td><td>Yes</td><td>Agent ID. (Set to null if it is a new synchronization)</td></tr><tr><td><code>merchantFullName</code></td><td>String</td><td>Yes</td><td>Agent name.</td></tr><tr><td><code>merchantName</code></td><td>String</td><td>Yes</td><td><p>Agent short name.</p><p>Must not contain Vietnamese accents, spaces, or special characters.</p></td></tr><tr><td><code>merchantAddress</code></td><td>String</td><td>Yes</td><td>Registered business address.</td></tr><tr><td><code>merchantIdentity</code></td><td>String</td><td>Yes</td><td>Tax Identification Number (MST) / Citizen Identification Number (CCCD) / Business Registration Number (ĐKKD)</td></tr><tr><td><code>checkSum</code></td><td>String</td><td>Yes</td><td><p>MD5 hash string of the combination:</p><p>(password + merchantName + merchantIdentity)</p><p>(<code>password</code>+ <code>merchantName</code>+<code>merchantIdentity</code>)</p></td></tr><tr><td><code>contactEmail</code></td><td>String</td><td>Optional</td><td>Agent’s contact email address.</td></tr><tr><td><code>contactPhone</code></td><td>String</td><td>Optional</td><td>Agent’s contact phone number.</td></tr><tr><td><code>career</code></td><td>String</td><td>Optional</td><td>Registered business industry.</td></tr></tbody></table>

**Response**

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

```json
{
    "status": "SUCCESS",
    "data": [
        {
            "mid": "ID_đại_lý",
            "merchantName": "tên_rút_gọn_đại_lý"
        }
    ]
}
```

{% endtab %}

{% tab title="400" %}

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

{% endtab %}
{% endtabs %}

### Sample Code

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

```
curl --location 'https://api.vietqr.org/vqr/api/mid/synchronize/v1' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhdXRob3JpdGllcyI6WyJST0xFX1VTRVIiXSwidXNlciI6IlkzVnpkRzl0WlhJdGJtZDFlV1Z1TFhWelpYSXlORGt5IiwiaWF0IjoxNzIxMzc1MzUzLCJleHAiOjE3MjEzNzU2NTN9.Wi5BTmJ63f7h_p7rimfaycfGIs4TNBkzVGlCUSkOxzWU-QaYZF3rCNndlgPjO89LpRmU3VliSYcf5iHHNrnC7A' \
--header 'Cookie: JSESSIONID=068E5AFD023BFA9AAFBA841C0BF00B62' \
--data-raw '{
    "merchants": [ // List of stores to be synchronized.
        {
            "merchantFullName": "Full name of the agent.",
            "merchantName": "Abbreviated name.",
            "merchantAddress": "Agent’s address.",
            "merchantIdentity": "Tax Identification Number.",
            "contactEmail": "Contact email",
            "contactPhone": "Contact phone number",
            "checkSum": "HASHMD5 128bit của: mật_khẩu_get_token + merchant_name + merchantIdentity"
        }
    ]
}'
```

{% endtab %}
{% endtabs %}

### Frequently Asked Questions (FAQs)


---

# 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/synchronize-master-agent.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.
