> For the complete documentation index, see [llms.txt](https://nextify.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nextify.gitbook.io/api/merchant-api.md).

# Merchant API

API quản lý merchant

## Lấy thông tin merchant

<mark style="color:blue;">`GET`</mark> `{{base_url}}/merchant`

Cho phép lấy thông tin merchant

#### Query Parameters

| Name              | Type   | Description     |
| ----------------- | ------ | --------------- |
| merchant\_id\_app | string | id merchant app |

#### Headers

| Name          | Type   | Description             |
| ------------- | ------ | ----------------------- |
| Authorization | string | Bearer \<access\_token> |

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

```
```

{% endtab %}
{% endtabs %}

## Tạo mới merchant

<mark style="color:green;">`POST`</mark> `{{base_url}}/merchant`

Cho phép tạo mới merchant

#### Headers

| Name          | Type   | Description             |
| ------------- | ------ | ----------------------- |
| Authorization | string | Bearer \<access\_token> |
| Content-Type  | string | application/json        |

#### Request Body

| Name                  | Type   | Description                           |
| --------------------- | ------ | ------------------------------------- |
| name                  | string | Tên merchant                          |
| phone                 | string | Số điện thoại                         |
| password              | string | Mật khẩu                              |
| confirm\_password     | string | Xác nhận mật khẩu                     |
| package               | string | Gói dịch vụ (id)                      |
| date\_start\_contract | string | Ngày bắt đầu hợp đồng                 |
| date\_end\_contract   | string | Ngày kết thúc hợp đồng                |
| business\_model\_id   | string | Mô hình kinh doanh (id)               |
| merchant\_id\_app     | string | id merchant phía bên đối tác quy định |
| email                 | string | Email                                 |
| sms\_provider         | string | SMS provider                          |
| user\_sms             | string | User SMS                              |
| pass\_sms             | string | Password SMS                          |
| quota                 | string | SMS quota                             |

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

```
```

{% endtab %}
{% endtabs %}

## Update thông tin merchant

<mark style="color:orange;">`PUT`</mark> `{{base_url}}/merchant`

Cho phép update thông tin merchant

#### Query Parameters

| Name              | Type   | Description     |
| ----------------- | ------ | --------------- |
| merchant\_id\_app | string | id merchant app |

#### Headers

| Name          | Type   | Description             |
| ------------- | ------ | ----------------------- |
| Authorization | string | Bearer \<access\_token> |
| Content-Type  | string | application/json        |

#### Request Body

| Name                  | Type   | Description             |
| --------------------- | ------ | ----------------------- |
| name                  | string | Tên merchant            |
| phone                 | string | Số điện thoại           |
| email                 | string | Email                   |
| password              | string | Mật khẩu                |
| confirm\_password     | string | Xác nhận mật khẩu       |
| package               | string | Gói dịch vụ (id)        |
| date\_start\_contract | string | Ngày bắt đầu hợp đồng   |
| date\_end\_contract   | string | Ngày kết thúc hợp đồng  |
| business\_model\_id   | string | Mô hình kinh doanh (id) |
| provider\_sms         | string | Provide SMS             |
| user\_sms             | string | User SMS                |
| pass\_sms             | string | Password SMS            |
| quota                 | string | Quota SMS               |

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

```
```

{% endtab %}
{% endtabs %}

## Lấy danh sách địa điểm của Merchant

<mark style="color:blue;">`GET`</mark> `{{base_url}}/merchant/shops`

Cho phép lấy danh sách địa điểm của merchant

#### Query Parameters

| Name           | Type   | Description                |
| -------------- | ------ | -------------------------- |
| merchant\_id   | string | id merchant                |
| merchant\_slug | string | tên merchant               |
| page           | string | trang hiện tại             |
| page\_limit    | string | giới hạn số bản ghi trả về |

#### Headers

| Name          | Type   | Description             |
| ------------- | ------ | ----------------------- |
| Authorization | string | Bearer \<access\_token> |

{% tabs %}
{% tab title="200 Thành công" %}

```javascript
{
	"status": 200,
	"message": "shops in merchant",
	"data":
	{
		"shops": [ Danh sách shop ],
		"total": total,
		"page": page,
		"page_limit": page_limit
	}
}
```

{% endtab %}
{% endtabs %}

Lưu ý: Bắt buộc phải truyền merchant\_id hoặc merchant\_slug

```
curl -X GET \
  '{{ base_url }}/merchant/shops?merchant_id={{ merchant_id }}' \
  -H 'Authorization: Bearer {{ access_token }}'
```
