> 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/wificode-api.md).

# WifiCode API

API quản lý wificode

## Tạo mới Wifi Code

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

Cho phép tạo mới wifi code bằng profile

#### Query Parameters

| Name     | Type    | Description                                                     |
| -------- | ------- | --------------------------------------------------------------- |
| code     | string  | Wifi code, nếu không truyền vào code sẽ tự động được gen        |
| shop\_id | string  | id địa điểm ( lấy trong api danh sách địa điểm của merchant )   |
| profile  | string  | id profile ( lấy trong api danh sách wifiprofile của merchant ) |
| phone    | string  | Số điện thoại khách hàng                                        |
| email    | boolean | Email khách hàng                                                |

#### Headers

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

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

```
{
    "status": 200,
    "message": "Success!",
    "data": {
        "profile": "5d723a961cd06c752cf8fb2d",
        "phone": "0912321321",
        "shop_id": "5c8725ddaeb2ff3c5779ffae",
        "code": "x4uqt8",
        "merchant_id": "5a616f383fd79c2db9147c6a",
        "when": "02:05:27 20-11-2019",
        "email": "myhoney68@gmail.com",
        "expire_at": "00:00:00 01-01-1970",
        "_id": "5dd49f6766f725ec95b3c4c9"
    }
}
```

{% endtab %}

{% tab title="401 access token not found" %}

```
{
    "status_code": "401",
    "message": "access_token not found! Please contact Nextify at support@nextify.vn for help"
}
```

{% endtab %}

{% tab title="404 shop\_id là bắt buộc" %}

```
{
    "status": 404,
    "message": "shop_id required!"
}
```

{% endtab %}
{% endtabs %}
