1 Background
SUNMI Store is a store management system provided by SUNMI for merchants to manage the IoT devices in stores.
As an open platform, SUNMI Store support the interface with the data of third-party SaaS suppliers including product information, transaction information and membership system interface.
2 Interface Specifications
2.1 Protocols
Currently, Open APIs use HTTPS method only, and all messages use POST method.
Not: the message payload should not exceed 1M, and any request larger than 1M will be rejected directly.
Content-Type | application/x-www-form-urlencoded |
---|---|
Data format | Return in JSON format |
Character encoding | UTF-8 character encodings |
Signature Algorithm | MD5 |
Sign rules | Refer to 2.2 for sign rules |
2.2 Sign Rules
Please refer to Open API – Authentication.
2.3 Common Parameters
Parameter | Required | Type | Descriptions | Example |
---|---|---|---|---|
app_id | Yes | string | The unique ID of the one who applies for interfacing, which can be obtained from SUNMI | EF3OG8R5B32X0 |
random | Yes | string | A random character string (6-10 digit) which is constituted by numbers and alphabets | 123123 |
timestamp | Yes | int | The current unix timestamp (a 10-digit number) which is accurate to second | 1578969281 |
sign | Yes | string | Signature information. Please refer to 3.2.2 for details | 57178021FE900A04C6F98DA6281598AF |
3 Specifications for Store Design
Please refer to Open API – Align Merchants/Stores.
4 The Interface for Device Management
4.1 Interface Description
Those interfaces are used to manage the essential attributes (name, e.g.) of an IPC.
4.2 Interface List
Interface | Description |
---|---|
/device/ipc/getList | Acquire the list of devices |
/device/ipc/getInfo | Acquire the basic information of devices |
/device/ipc/updateName | Change the device name |
4.3 Details of Interfaces
4.3.1 Acquire the List of Devices
Intro to the interface: users can acquire the list of devices in relevant stores by using this interface.
Request link: /device/ipc/getList
Interface parameter:
Parameter | Required | Type | Introduction | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10096 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/device/ipc/getList",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581333970,
"random": "5dsf6698",
"sign": "5EA14F9445D72DDE113AA95B04797D29"
}
Return value:
{
"data": {
"total_count": 1,
"ipc_list": [
{
"ipc_id": "549755805878",
"ipc_sn": "C101P98200023",
"ipc_name": "小松松大魔王",
"model_name": "FM010",
"software_version": "1.2.6",
"check_version_time": 1566365781,
"active_status": 0,
"screenshot_url": "https://xxxxxxxx/IMG/IPC/e36654e8a95a9ad27b5bb585a0f7df50a0de0dd6e0aeaee47b4e34c4f4636f9a"
}
]
},
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed"
}
Return field description: active_status
active_status value | Description |
---|---|
0 | The device is offline |
1 | The device is online |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
4.3.2 Acquire the Basic Information of the Device
Intro to the interface: users can obtain the basic information of a specified device by calling this interface.
Interface request: /device/ipc/getInfo
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10096 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805878 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/device/ipc/getInfo",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"ipc_id": "549755805878",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581333970,
"random": "5dsf6698",
"sign": "140E3195C0F00DB09457E015AA79D79B"
}
Return value:
{
"data": {
"ipc_id": "549755805878",
"ipc_sn": "C101P98200023",
"ipc_name": "小松松大魔王",
"model_name": "FM010",
"software_version": "1.2.6",
"check_version_time": 1566365781,
"active_status": 0,
"screenshot_url": "https://xxxxxxxx/IMG/IPC/e36654e8a95a9ad27b5bb585a0f7df50a0de0dd6e0aeaee47b4e34c4f4636f9a"
},
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed"
}
Return field description: active_status
active_status value | Description |
---|---|
0 | The device is offline |
1 | The device is online |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5501 | The IPC does not exist |
4.3.3 Change the Device Name
Intro to the device: users can change the device name by calling this interface.
Request link: /device/ipc/updateName
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10096 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805878 |
ipc_name | Yes | string | The updated name of an IPC | The sample equipment |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/device/ipc/updateName",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"ipc_id": "549755805878",
"ipc_name": "示例设备",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581333970,
"random": "5dsf6698",
"sign": "140E3195C0F00DB09457E015AA79D79B"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5011 | Error in communication with the device |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5501 | The IPC doesn’t exist |
5506 | No data of this IPC found in the database |
5510 | Unbound device |
5 The Interface to Manage Face Group
5.1 Interface Description
It is an interface used to manage the interfaces related to faces. SUNMI Store will save relevant authorized data and configuration on the cloud and synchronize data needed to the IPC in the store.
5.2 Interface List
Interface | Description |
---|---|
/face/group/getList | Acquire the list of face group |
/face/group/getInfo | Acquire the information of a specified face group |
/face/group/create | Add face group |
/face/group/update | Modify a specified face group |
/face/group/delete | Delete a specified face group |
/face/group/getFaceList | Acquire the face list of a specified face group |
/face/getInfo | Acquire the detailed information of a specified face |
/face/add | Add face information to a specified face group |
/face/update | Modify the attribute information of a specified face |
/face/updatePicture | Modify the attribute information of a specified face image |
/face/delete | Delete face information from a specified face group |
/face/group/move | Move a specified face among face groups |
/face/group/updateMoveStrategy | Modify the strategies on moving new customers among groups |
5.3 Details of Interfaces
5.3.1 Acquire the List of Face Group
Intro to the interface: users can acquire the list of face group by calling this interface.
Request link: /fact/group/getList
Interface parameter:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10096 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/getList",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"group_list": [
{
"group_id": "578968814328",
"type": 1,
"count": 0,
"capacity": 1000,
"last_modified_time": 0,
"group_name": "stranger",
"description": "",
"customer_key1": "",
"customer_key2": "",
"customer_key3": "",
"customer_key4": "",
"customer_key5": ""
},
{
"group_id": "578968814329",
"type": 2,
"count": 0,
"capacity": 1000,
"last_modified_time": 0,
"group_name": "regular",
"description": "",
"customer_key1": "",
"customer_key2": "",
"customer_key3": "",
"customer_key4": "",
"customer_key5": ""
},
{
"group_id": "578968814330",
"type": 3,
"count": 0,
"capacity": 1000,
"last_modified_time": 0,
"group_name": "employee",
"description": "",
"customer_key1": "",
"customer_key2": "",
"customer_key3": "",
"customer_key4": "",
"customer_key5": ""
},
{
"group_id": "578968817934",
"type": 5,
"count": 0,
"capacity": 1000,
"last_modified_time": 0,
"group_name": "YiliuTest",
"description": "",
"customer_key1": "",
"customer_key2": "",
"customer_key3": "",
"customer_key4": "",
"customer_key5": ""
}
]
},
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed"
}
Return field description: type
type value | Description |
---|---|
1 | New customer face library |
2 | Repeat customer face library |
3 | Shop assistant face library |
5 | Customized face library |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5.3.2 Acquire the Information of a Specified Face Group
Interface description: users can acquire the information of a specified face group by calling this interface.
Request link: /face/group/getInfo
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10096 |
group_id | 是 | string | The unique ID of a face group | 578968814328 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/getInfo",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"group_id": "578968814328",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"group_id": "578968814328",
"type": 1,
"count": 0,
"capacity": 1000,
"last_modified_time": 0,
"group_name": "stranger",
"description": "",
"customer_key1": "",
"customer_key2": "",
"customer_key3": "",
"customer_key4": "",
"customer_key5": ""
},
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed"
}
Return field description: type
type value | Description |
---|---|
1 | New customer face library |
2 | Repeat customer face library |
3 | Shop assistant face library |
5 | Customized face library |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5.3.3 Add a Face Group
Interface description: users can add a face group by calling this interface.
Request link: /face/group/create
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10096 |
name | Yes | string | The name of a face group | Mike |
type | Yes | int | The type of a face group (1: new customer, 2: repeat customer, 3: shop assistant, 5: customized) | 5 |
capacity | Yes | int | The capacity of a face group | 10000 |
description | No | string | The description of a face group | 此分组用于对于金卡会员管理 |
customer_key1 | No | string | Face group customized extended field 1 name | vip_level |
customer_key2 | No | string | Face group customized extended field 2 name | hobby |
customer_key3 | No | string | Face group customized extended field 3 name | foreigner |
customer_key4 | No | string | Face group customized extended field 4 name | figure |
customer_key5 | No | string | Face group customized extended field 5 name | hairstyle |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/create",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"name": "Mike",
"type": 5,
"capacity": 1000,
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5520 | The number of face groups or the face capacity reaches the upper limit |
5523 | This face group already exists |
5.3.4 Modify a Specified Face Group
Interface description: users can modify a specified face group by calling this interface.
Request link: /face/group/update
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 15220 |
group_id | Yes | string | The unique ID of a face group | 578968817476 |
name | No | string | The name of a face group | Mike |
capacity | No | int | The capacity of a face group | 10000 |
description | No | string | The description of a face group | 此分组用于对于金卡会员管理 |
customer_key1 | No | string | Face group customized extended field 1 name | vip_level |
customer_key2 | No | string | Face group customized extended field 2 name | hobby |
customer_key3 | No | string | Face group customized extended field 3 name | foreigner |
customer_key4 | No | string | Face group customized extended field 4 name | figure |
customer_key5 | No | string | Face group customized extended field 5 name | hairstyle |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/update",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"name": "Mike",
"type": 5,
"capacity": 1000,
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5506 | The data has not been found |
5520 | The number of face groups or the face capacity reaches the upper limit |
5525 | The default face library is not allowed to be modified |
5.3.5 Delete a Specified Face Group
Interface description: users can delete a specified face group by calling this interface.
Request link: /face/group/delete
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 15220 |
group_id | Yes | string | The unique ID of a face group | 578968817476 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/delete",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10096",
"group_id": "578968814328",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5506 | The data has not been found |
5524 | The default face library is not allowed to be modified |
5509 | Non-empty face library |
5.3.6 Acquire the Face List of a Specified Face Group
Interface description: users can acquire the face list of a specified face group by calling this interface.
Interface request: /fact/group/getFaceList
Interface parameters:
Parameters | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
group_id | Yes | string | The unique ID of a face group | 578968813726 |
page_num | No (1 by default) | int | The current page number | 1 |
page_size | No (10 by default) | int | The number of entries on the current page | 10 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/getFaceList",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"group_id": "578968813726",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"face_list": [
{
"face_id": "578968751459",
"group_id": "578968813726",
"group_name": "",
"gender": 1,
"age_range": 6,
"arrival_count": 0,
"create_time": 1579591542,
"last_arrival_time": 0,
"name": "lll",
"customer_key1": "",
"customer_key2": "",
"customer_key3": "",
"customer_key4": "",
"customer_key5": ""
}
],
"total_num": 1
},
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed"
}
Return field description: gender
gender value | Description |
---|---|
0 | Unknown |
1 | Male |
2 | Female |
Return field description: age_range
age_range value | Description |
---|---|
1 | Age 0~6 |
2 | Age 7~12 |
3 | Age 13~18 |
4 | Age 19~28 |
5 | Age 29~35 |
6 | Age 36~45 |
7 | Age 46~55 |
8 | Age 56 and the above |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5506 | The data has not been found |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5.3.7 Acquire the Detailed Information of a Specified Face
Interface description: users can acquire the detailed information of a specified face by calling this interface.
Request link: /face/getInfo
Interface parameters:
Parameter | required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
face_id | Yes | string | The unique ID of a face group | 578968740430 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/getInfo",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"face_id": "578968751459",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"age_range": 6,
"arrival_count": 0,
"create_time": 1579591542,
"face_id": "578968751459",
"gender": 1,
"group_id": "578968813726",
"group_name": "stranger",
"last_arrival_time": 0,
"name": "lll"
},
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed"
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5506 | No data found |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5.3.8 Add Face Information to a Specified Face Group
Interface description: users can add face information to a specified face group by calling this interface.
Request link: /face/add
Interface parameters:
Content-Type:application/form-data
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
group_id | Yes | string | The unique ID of a face group | 578968813726 |
name | Yes | string | The name of the face owner | Mike |
pic | Yes | file | The corresponding image (≤1M) of a face | face.png |
gender | No | int | The gender of a face owner (1: male, 2: female) | 1 |
age_range | No | int | The age range a face corresponds to | 4 |
customer_value1 | No | string | Face group customized extended field 1 content | 1 |
customer_value2 | No | string | Face group customized extended field 2 content | sing |
customer_value3 | No | string | Face group customized extended field 3 content | americans |
customer_value4 | No | string | Face group customized extended field 4 content | fat |
customer_value5 | No | string | Face group customized extended field 5 content | short hair |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/add",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"group_id": "578968813726",
"name": "Mike",
"pic": {
"value": fs.createReadStream("/D:/image/face.png"),
"options": {
"filename": "/D:/image/face.png",
"contentType": null
}
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {
"face_id": "578968740430"
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5520 | The number of face groups or the face capacity reaches the upper limit |
Note: SUNMI Store will process the images added to the face library and generate the corresponding face_id. The process result will be noticed asynchronously for it takes some time to process images.
For details, please refer to Notification Push Center.
The synchronous process and return method are being developed.
5.3.9 Modify the Attribute Information of a Specified Face
Interface description: users can modify the attribute information of a specified face by calling this interface.
Request link: /face/update
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
group_id | Yes | string | The unique ID of a face group | 578968813726 |
face_id | Yes | string | The unique ID of a face | 578968751459 |
name | No | string | The name of the face owner | Mike |
gender | No | int | The gender of a face owner (1: male, 2: female) | 1 |
age_range | No | int | The age range a face corresponds | 4 |
customer_value1 | No | string | Face group customized extended field 1 content | 1 |
customer_value2 | No | string | Face group customized extended field 2 content | sing |
customer_value3 | No | string | Face group customized extended field 3 content | americans |
customer_value4 | No | string | Face group customized extended field 4 content | fat |
customer_value5 | No | string | Face group customized extended field 5 content | short hair |
Field description: age_range
age_range value | Description |
---|---|
1 | Age 0~6 |
2 | Age 7~12 |
3 | Age 13~18 |
4 | Age 19~28 |
5 | Age 29~35 |
6 | Age 36~45 |
7 | Age 46~55 |
8 | Age 56 and the above |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/update",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"group_id": "578968813726",
"face_id": "578968751459",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /*
Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5520 | The number of face groups or the face capacity reaches the upper limit |
5521 | The face information is not in the specified face group |
5.3.10 Delete Face Information from the Specified Face Group
Interface description: users can delete face information from the specified face group by calling this interface.
Request link: /face/delete
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
group_id | Yes | string | The unique ID of a face group | 578968813726 |
face_id_list | Yes | array[string] | The unique ID of a face | [578968751459] |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/delete",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"group_id": "578968813726",
"face_id_list": ["578968751459"],
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5.3.11 Move a Specified Face Among Face Groups
Interface description: users can move a specified face among face groups by calling this interface.
Request link: /face/group/move
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The store ID which should be provided by the SaaS supplier | 7948 |
source_group_id | Yes | string | The unique ID of an original face group | 578968813726 |
target_group_id | Yes | string | The unique ID of a target face group | 578968813727 |
face_id_list | Yes | array[string] | The face ID arrays to be moved | [578968751459] |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/move",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"source_group_id": "578968813726",
"target_group_id": "578968813727",
"face_id_list": ["578968751459"],
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5520 | The number of face groups or the face capacity reaches the upper limit |
5521 | The face information is not in the specified face group |
5522 | The face library does not exist |
5.3.12 Change the Strategy of Moving a New Customer to Other Groups
Interface description: users can change the strategy of moving new customer groups by calling this interface.
Request link: /face/group/updateMoveStrategy
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
target_group_id | Yes | string | The unique ID of a target face group | 578968813727 |
threshold | Yes | int | The threshold (the times a customer visits the store in a certain period time) of moving a new customer to other groups | 4 |
period | Yes | int | The certain period of time (in seconds) that reaches the condition of moving a new customer to other groups | 604800 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/face/group/updateMoveStrategy",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"target_group_id": "578968813727",
"threshold": 4,
"period": 604800,
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors */
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5506 | The data has not been found |
5520 | The number of face groups or the face capacity reaches the upper limit |
5525 | The information of the default face group cannot be changed |
6 The Interface for Customer Flow Statistics
6.1 Interface Description
This interface is used to inquire the customer flow and history monitored and saved by the IPC. Three statistical dimensions are included – historical customer flow data (T+1), the customer flow data of the current day (T+0), real-time customer flow data.
The historical customer flow data (T+1) and the customer flow data of the current day (T+0) are provided by HTTP interface. SaaS suppliers can obtain the data by initiating request and the frequency of updating statistical data of the current day is smaller 15s/update, and the real-time customer flow data will be obtained by receiving notifications. For details, please refer to Notification Push Center.
6.2 Interface List
Interface | Description |
---|---|
/passengerFlow/stat/today/getLatest | Acquire the real-time customer flow of the current day (real-time total customer flow) |
/passengerFlow/stat/today/groupByTag | Acquire the customer flow data of the current day (according to the age and new/repeat face groups) |
/passengerFlow/stat/today/groupByGender | Acquire the customer flow data of the current day (according to the age and gender group) |
/passengerFlow/stat/today/getTrendByHour | Acquire the customer flow trend of the current day (total customer flow, the time granularity is hour) |
/passengerFlow/stat/history/groupByTag | Acquire historical customer flow data (total customer flow/new and repeat customer/member) |
/passengerFlow/stat/history/groupByGender | Acquire the details on historical customer group (age and gender) |
/passengerFlow/stat/history/getTrendByHour | Acquire the historical customer flow trend (total customer flow/new and repeat customers, the time granularity is hour) |
/passengerFlow/stat/history/getTrendByDay | Acquire the historical customer flow trend (total customer flow/new and repeat customer, the time granularity is day) |
/passengerFlow/stat/history/getTrendByWeek | Acquire the historical customer flow trend (total customer flow/new and repeat customer, the time granularity is week) (developing) |
/passengerFlow/stat/history/getTrendByMonth | Acquire the historical customer flow trend (total customer flow/new or repeat customer, the time granularity is month) (developing) |
6.3 Interface Details
6.3.1 Acquire the Real-Time Customer Flow of the Current Day
Interface description: users can acquire the customer flow of the current day by calling this interface.
Interface link: /passengerFlow/stat/today/getLatest
Interface parameter:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/getLatest",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data": {
"count": "123"
"unexposed_count": 0
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.2 Acquire the Customer Flow Data of the Current Day (According to the Group of New and Repeat Customer and Age Range)
Interface description: users can acquire the data of new/repeat customer flow data according to the age range of the current day by calling this interface.
Request link: /passengerFlow/stat/today/groupByTag
Interface parameter:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/groupByTag",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"count_list": [
{
"age_range": 1,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 2,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 3,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 4,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 5,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 6,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 7,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
},
{
"age_range": 8,
"stranger_count": 0,
"regular_count": 0,
"member_count": 0
}
]
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
}
Field description: age_range
age_range value | Description |
---|---|
1 | Age 0~6 |
2 | Age 7~12 |
3 | Age 13~18 |
4 | Age 19~28 |
5 | Age 29~35 |
6 | Age 36~45 |
7 | Age 46~55 |
8 | Age 56 and the above |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.3 Acquire the Customer Flow Data of the Current Day (According to the Gender and Age)
Request link: /passengerFlow/stat/today/groupByGender
Interface description: users can acquire the customer flow data of different age range and different gender by calling this interface.
Interface parameter:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier | 7948 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/groupByGender",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"count_list": [
{
"age_range": 1,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 2,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 3,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 4,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 5,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 6,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 7,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 8,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
}
]
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
}
Field description: age_range
age_range value | Description |
---|---|
1 | Age 0~6 |
2 | Age 7~12 |
3 | Age 13~18 |
4 | Age 19~28 |
5 | Age 29~35 |
6 | Age 36~45 |
7 | Age 46~55 |
8 | Age 56 and the above |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.4 Acquire the Customer Flow Data of the Current Day (Total Customer Flow, the Time Granularity is Hour)
Request link: /passengerFlow/stat/today/getTrendByHour
Interface description: users can acquire the customer flow data of different time period the current day by calling this interface.
Interface parameter:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/today/getTrendByHour",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"count_list": [
{
"time": "2020-02-11 00:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 01:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 02:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 03:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 04:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 05:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 06:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 07:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 08:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 09:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 10:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 11:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 12:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 13:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 14:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 15:00",
"total_count": 0,
"unexposed_count": 0
},
{
"time": "2020-02-11 16:00",
"total_count": 0,
"unexposed_count": 0
}
]
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
}
Field description: age_range
age_range value | Description |
---|---|
1 | Age 0~6 |
2 | Age 7~12 |
3 | Age 13~18 |
4 | Age 19~28 |
5 | Age 29~35 |
6 | Age 36~45 |
7 | Age 46~55 |
8 | Age 56 and the above |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.5 Acquire the Historical Customer Flow Data (Total/New and Repeat Customer/Member)
Interface description: users can acquire the customer flow data of the three main face group in historical data by calling this interface.
Request link: /passengerFlow/stat/history/groupByTag
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
start_time | Yes | string | The start (YYYY-MM-DD) of the time interval to be filtered (if you want to acquire the data of one day, the start time is the end time) | 2020-01-01 |
end_time | Yes | string | The end (YYYY-MM-DD) of the time interval to be filtered (if you want to acquire the data of one day, the start time is the end time) | 2020-01-16 |
Note:
For each time you call the interface, the interval between start time and end time is limited to 30 days.
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/groupByTag",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"start_time": "2020-01-01",
"end_time": "2020-01-16",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.6 Acquire the Historical Customer Group Data (According to Age and Gender)
Request link: /passengerFlow/stat/history/groupByGender
Interface description: users can acquire the customer data the current day of different age range and gender by calling the interface.
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
start_time | Yes | string | The start (YYYY-MM-DD) of the time interval to be filtered (if you want to acquire the data of one day, the start time is the end time) | 2020-01-01 |
end_time | Yes | string | The end (YYYY-MM-DD) of the time interval to be filtered (if you want to acquire the data of one day, the start time is the end time) | 2020-01-01 |
Note:
For each time you call the interface, the interval between start time and end time is limited to 30 days.
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/groupByGender",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"start_time": "2020-01-01",
"end_time": "2020-01-01",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"count_list": [
{
"age_range": 1,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 2,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 3,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 4,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 5,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 6,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 7,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
},
{
"age_range": 8,
"male_count": 0,
"male_regular_count": 0,
"male_member_count": 0,
"female_count": 0,
"female_regular_count": 0,
"female_member_count": 0
}
]
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
}
Field description: age_range
age_range value | Example |
---|---|
1 | Age 0~6 |
2 | Age 7~12 |
3 | Age 13~18 |
4 | Age 19~28 |
5 | Age 29~35 |
6 | Age 36~45 |
7 | Age 46~55 |
8 | Age 56 and the above |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.7 Acquire the Historical Customer Flow Trend (Total/New and Repeat Customer, and the time granularity Is Hour)
Request link: /passengerFlow/stat/history/getTrendByHour
Interface description: users can acquire the customer flow trend of a period of time by calling this interface.
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 7948 |
start_time | Yes | string | The start (YYYY-MM-DD) of the time interval to be filtered (if you want to acquire the data of one day, the start time is the end time) | 2020-01-01 |
end_time | Yes | string | The end (YYYY-MM-DD) of the time interval to be filtered (if you want to acquire the data of one day, the start time is the end time) | 2020-01-01 |
Notes:
For each time you call the interface, the interval between start time and end time is limited to 24 hours.
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/getTrendByHour",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"start_time": "2020-01-01",
"end_time": "2020-01-01",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"count_list": [
{
"time": "2019-12-01 0:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 1:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 2:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 3:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 4:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 5:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 6:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 7:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 8:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 9:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 10:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 11:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 12:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 13:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 14:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 15:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 16:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 17:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 18:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 19:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 20:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 21:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 22:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2019-12-01 23:00",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
}
]
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.8 Acquire the Historical Customer Flow Trend (Total/New and Repeat Customer, the Time Granularity Is Day)
Request link: /passengerFlow/stat/history/getTrendByDay
Interface description: users can acquire the customer flow trend of a period of time by calling this interface.
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 15220 |
start_time | Yes | string | The start (YYYY-MM-DD) of the time interval to be filtered | 2020-01-01 |
end_time | Yes | string | The end (YYYY-MM-DD) of the time interval to be filtered | 2020-01-03 |
Note:
For each time you call the interface, the interval between start time and end time is limited to 30 days.
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/passengerFlow/stat/history/getTrendByDay",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "7948",
"app_id": "LMWWQVTW4QGCC",
"start_time": "2020-01-01",
"end_time": "2020-01-03",
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"data": {
"count_list": [
{
"time": "2020-01-01",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2020-01-02",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
},
{
"time": "2020-01-03",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0,
"unexposed_count": 0
}
]
},
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.9 Acquire the Historical Customer Flow Trend (Total/New and Repeat Customer, the Time Granularity Is Week) (Developing)
Request link: /passengerFlow/stat/history/getTrendByWeek
Interface description: users can acquire the customer flow trend in a period of time by calling this interface.
Interface parameters:
Parameter | Required | Type | Description |
---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. |
start_time | Yes | string | The start (YYYY-MM-DD) of the time interval to be filtered |
end_time | Yes | string | The end (YYYY-MM-DD) of the time interval to be filtered |
Note:
For each time you call the interface, the interval between start time and end time is limited to 12 weeks.
Return value:
{
"code": 0, /* 其他错误参考错误列表 */
"msg": "succeed",
"data": {
"count_list": [
{
"time": "2019-09-11",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0
},
{
"time": "2019-09-17",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0
}
]
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
6.3.10 1.1.1 Acquire the Historical Customer Flow Trend (Total/New and Repeat Customer, the Time Granularity Is Month)
Request link: /passengerFlow/stat/history/getTrendByMonth
Interface description: users can acquire the customer flow trend in a period of time by calling this interface.
Interface parameters:
Parameter | Required | Type | Description |
---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. |
start_time | Yes | string | The start (YYYY-MM-DD) of the time interval to be filtered |
end_time | Yes | string | The end (YYYY-MM-DD) of the time interval to be filtered |
Note:
For each time you call the interface, the interval between start time and end time is limited to 12 months.
Return value:
{
"code": 0, /* refer to the blew table for more errcode description */
"msg": "succeed",
"data": {
"count_list": [
{
"time": "2019-01",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0
},
{
"time": "2019-12",
"total_count": 0,
"regular_count": 0,
"stranger_count": 0,
"member_count": 0
}
]
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
7 The Interface to Playback the Live Video
7.1 1.1 Interface Description
This interface is used to check the real-time and historical video data.
7.2 Interface List
Interface | Description |
---|---|
/media/live/start | Start remote live video |
/media/live/stop | End remote live video |
/media/playback/start | Start remote video playback (developing) |
/media/playback/stop | End remote video playback (developing) |
/media/video/getList | Acquire the list of video playback |
/media/motionDetection/getList | Acquire the list of motion detection videos |
/media/playback/getSnapshot | Acquire the snapshots of a specified period of time |
/media/live/getSnapshot | Acquire the snapshots of real-time monitor |
7.3 Interface Details
Interface | Description |
---|---|
/media/live/start | Start remote live video |
/media/live/stop | End remote live video |
/media/playback/start | Start remote video playback (developing) |
/media/playback/stop | End remote video playback (developing) |
/media/video/getList | Acquire the list of video playback |
/media/motionDetection/getList | Acquire the list of motion detection videos |
/media/playback/getSnapshot | Acquire the snapshots of a specified period of time |
/media/live/getSnapshot | Acquire the snapshots of real-time monitor |
7.3.1 Enable Remote Live-Broadcasting
Interface description: users can enable remote live-broadcasting by calling this interface.
Request link: /media/live/start
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10087 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805835 |
resolution | Yes | int | Resolution | 0 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/live/start",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"resolution": 0,
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed"
"data": {
"url": "https://xxxxxxxx/C101P98200023/1219130724381102080.flv?auth_key=1579501989-729716105000265001016467621435-0-",
"hls_url": "https://xxxxxxxx/C101P98200023/1219130724381102080.m3u8?auth_key=1579501989-729716105000265001016467621435-0-"
}
}
Field description: resolution
resolution value | Description |
---|---|
0 | Super high definition |
1 | High definition |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5011 | Error in communication with the device |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5501 | The IPC does not exist |
5510 | Unbound device |
7.3.2 End Live
Interface description: users can end the remote live by calling this interface.
Request link: /media/live/stop
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10087 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805835 |
resolution | Yes | int | Resolution | 0 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/live/stop",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"resolution": 0,
"timestamp": 1581383983,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* 其他错误参考错误列表 */
"msg": "succeed",
"data": {}
}
Field description: resolution
resolution value | Description |
---|---|
0 | Super high definition |
1 | High definition |
错误码:
Error Code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5011 | Error in communication with the device |
5041 | No shop_id parameter found in the request |
5501 | The IPC does not exist |
5510 | Unbound device |
7.3.4 Acquire the List of Video for Playback
Interface description: users can acquire the list of video playback by calling this interface.
Request link: /media/video/getList
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10087 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805835 |
start_time | Yes | int | The Unix timestamp (accurate to second) which indicates the start time of the inquiry | 1578969264 |
end_time | Yes | int | The Unix timestamp (accurate to second) which indicates the end time of the inquiry | 1578972864 |
Note:
The time interval between start_time and end_time shall be within 3600s
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/video/getList",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"start_time": 1578969264,
"end_time": 1578969264,
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data": {
"total_count": 1,
"video_list": [{
"ipc_id": "549755812970",
"url": "http: //xxxxxxxx/VIDEO/IPC/SS101D8BS00087/39C1045AF2EA34B0CEA528FB228C8EDA",
"start_time": 1551854897,
"end_time": 1551854958
}]
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5021 | Invalid parameter (the time interval overruns the limit) |
5041 | No shop_id parameter found in the request |
7.3.5 Acquire the List of Motion Detection Videos
Interface description: users can acquire the list of motion detection videos
Request link: /media/motionDetection/getList
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10087 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805835 |
start_time | Yes | int | The Unix timestamp (accurate to second) which indicates the start time of the inquiry | 1578969264 |
end_time | Yes | int | The Unix timestamp (accurate to second) which indicates the end time of the inquiry | 1579055640 |
page_num | No (1 by default) | int | The current page number | 1 |
page_size | No (10 by default) | int | The number of entries (100 maximum) on the current page | 10 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/motionDetection/getList",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"start_time": 1578969264,
"end_time": 1579055640,
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data": {
"total_num": 1,
"video_list": [{
"source": "1",
"detect_time": 1551854897,
"url": "http: //xxxxxxxx/VIDEO/IPC/SS101D8BS00087/39C1045AF2EA34B0CEA528FB228C8EDA"
}]
}
}
Field description: source
source value | Description |
---|---|
1 | Image |
2 | Sound |
3 | Image and sound |
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
7.3.6 Acquire the Monitoring Images in a Specified Time Range
Interface description: users can acquire the monitoring images in a specified time range by calling this interface.
Request link: /media/playback/getSnapshot
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 15220 |
ipc_id | Yes | string | The unique ID of an IPC | 549755812970 |
time | Yes | int | The Unix timestamp (accurate to second) which indicates the screenshot time | 1579055640 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/playback/getSnapshot",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"time": 1579055640,
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data": {
"snapshot_url":"http://xxxxxxxx/VIDEO/IPC/SS101D8BS00087/39C1045AF2EA34B0CEA528FB228C8EDA"
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5013 | No data found |
5041 | No shop_id parameter found in the request |
7.3.7 Acquire the Real-Time Monitoring Image
Interface description: users can acquire the real-time monitoring images by calling this interface, and the validity of the images is one day.
Request link: /media/live/getSnapshot
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10087 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805835 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/live/getSnapshot",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data":{
"snapshot_url":"http://xxxxxxxx/VIDEO/IPC/SS101D8BS00087/39C1045AF2EA34B0CEA528FB228C8EDA"
}
}
Error codes:
Error code | Description |
---|---|
5000 | Database error |
5011 | Error in communication with the device |
5013 | No data found |
5041 | No shop_id parameter found in the request |
5501 | IPC does not exist |
5510 | The device is unbound |
5515 | The screenshot time overrun the limit |
7.3.8 Start remote playback
Interface description: Through this interface call, the user can start remote playback.
Request link: /media/playback/start
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
shop_id | Yes | string | The ID of the store to be interfaced with on SaaS platform, which should be provided by the SaaS supplier. | 10087 |
ipc_id | Yes | string | The unique ID of an IPC | 549755805835 |
start_time | Yes | int | 开始查询时间,Unix时间戳,秒级别 | 1578969264 |
end_time | Yes | int | 结束查询时间,Unix时间戳,秒级别 | 1579055640 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/playback/start",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"app_id": "LMWWQVTW4QGCC",
"ipc_id": "549755805835",
"start_time": 1578969264,
"end_time": 1579055640,
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data": {
"url": "https://xxxxxxxx/SAAS-OpenAPI_1211497245552152576/1577092646.flv?auth_key=1577096246-57626095498907571693914212321441-0-",
"hls_url": "https://xxxxxxxx/SAAS-OpenAPI_1211497245552152576/1577092646.flv?auth_key=1577096246-57626095498907571693914212321441-0-",
"client_id": "SAAS-OpenAPI_1211497245552152576"
}
}
Error codes:
Error code | Description |
---|---|
5021 | Illegal parameter (time interval exceeding limit) |
5041 | No shop_id parameter found in the request |
5087 | Unmatched data |
5088 | Database error |
5506 | No data found |
7.3.9 End remote playback
Interface description: Through this interface call, the user can start remote playback.
Request link: /media/playback/stop
Interface parameters:
Parameter | Required | Type | Description | Example |
---|---|---|---|---|
client_id | Yes | string | user client id | SAAS-OpenAPI_1211497245552152576 |
Sample request :
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/media/playback/stop",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"client_id": "SAAS-OpenAPI_1211497245552152576",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
Return value:
{
"code": 0, /* Please refer to the error list for other errors*/
"msg": "succeed",
"data": {}
}
Error codes:
Error code | Description |
---|---|
5020 | Invalid parameter |
8 Notifications Center
8.1 Interface description
SUNMI Store platform can push notifications to the cooperative SaaS parties according to the notification type subscribed by the cooperative platforms
8.2 Interface List
Please refer to Notification Center.
9 docking demonstration
9.1 Shop lignment
Please refer to Sunmi Store Open Platform -> Shop APIs, it is introduce how to set up the mapping relationship between sunmi’s shop and saas’ shop. All subsequent operations are based on the devices and data in the stop
9.2 Configuration Network For Device
If your device is connected to the Internet through cable, please skip this step.
If your device is connected to the Internet through a wireless network, please follow the steps below to use the Android SDK for network configration (for other operating systems or devices, you can also directly call the device API for network configration).
If the blue light on the device is always on which inndicates that the device is connected to Internet successful
If the green light on the device is always on which inndicates that the device is connected to Internet abnormal
9.3 Bind Device
9.3.1 Bind Device by API(under development)
After the IPC device is connected to the network successful, call the device binding interface /device/ipc/bind to bind the device to the specified stop.
demo case:
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/device/ipc/bind",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "10087",
"ipc_sn": "C201D8BS00089",
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
9.3.2 bind device on sunmi store web
Open the Sunmi assistant APP which can be downloaded from
Android or IOS market, login with your own username and password which has been
set up relationship with saas’ shop.
In the shop, please click the Device to choose a type device added, at the same
time, turn on the camera power. After the power is turned on, wait for about 20
seconds. When the camera’s green light is flashing , then click next.
There are two mode for connecting Internet: Wired and wireless
- For cable network connection, need to plug in the cable for the camera, at the same time, keep the sunmi assistant app in the same network; after the camera ‘s blue light is always on, then click next, and find the corresponding IPC device to bind.
- For wireless network connection, need to connect your mobile phone which has been installed sunmi assistant app to the camera’s wireless network [Sunmi XXXX] (you can find the network name on the camera body or the box), then click next to find the corresponding IPC device to bind
After adding successfully, the newly added IPC devices can be seen on mobile phones and the web
9.4 Device configration
9.4.1 Adjust Camera Focus By API (under development)
After the device is bound, the API can be called to adjust camera focus
9.4.2 Setting Incoming Line On Store Web
The first thing for face sense camera is set incoming line for the shop.
Step1: open the sunmi assistant app, login the
corresponding shop with right username and password, click the Device, then
click the three small icons in the upper right of the screen to enter the
camera settings, then start to adjust the screen to get the best picture
Step2: the screen will prompt “please guide the customer to face to the
IPC and stand at the right place for face reorganization”, and then click
next in the upper right corner of the screen
Step3: the screen will prompt ” Please fit the face into the facial recognition box by adjusting the size of the image and moving the box “. At the same time, the camera will automatically adjust the screen, and prompt ” To ensure the recognition accuracy, you can move the store doorsill line you set or drag the ends of the doorsill line to change doorsill length “, which is that you can manually mark the line on the mobile screen to set the position of the entrance threshold, and then click finish
9.5 Watch Living Video
Interface List
Detailed info can be read in chapter 7: playbace living video
Interface | Description |
---|---|
/media/live/start | Start remote live video |
/media/live/stop | End remote live video |
/media/playback/start | Start remote video playback (developing) |
/media/playback/stop | End remote video playback (developing) |
/media/video/getList | Acquire the list of video playback |
/media/motionDetection/getList | Acquire the list of motion detection videos |
/media/playback/getSnapshot | Acquire the snapshots of a specified period of time |
/media/live/getSnapshot | Acquire the snapshots of real-time monitor |
9.6 Customer Flow Statistics
Interface list
Detailed info can be read in chapter 6: customer flow statistics
Interface | Description |
---|---|
/passengerFlow/stat/today/getLatest | Acquire the real-time customer flow of the current day (real-time total customer flow) |
/passengerFlow/stat/today/groupByTag | Acquire the customer flow data of the current day (according to the age and new/repeat face groups) |
/passengerFlow/stat/today/groupByGender | Acquire the customer flow data of the current day (according to the age and gender group) |
/passengerFlow/stat/today/getTrendByHour | Acquire the customer flow trend of the current day (total customer flow, the time granularity is hour) |
/passengerFlow/stat/history/groupByTag | Acquire historical customer flow data (total customer flow/new and repeat customer/member) |
/passengerFlow/stat/history/groupByGender | Acquire the details on historical customer group (age and gender) |
/passengerFlow/stat/history/getTrendByHour | Acquire the historical customer flow trend (total customer flow/new and repeat customers, the time granularity is hour) |
/passengerFlow/stat/history/getTrendByDay | Acquire the historical customer flow trend (total customer flow/new and repeat customer, the time granularity is day) |
/passengerFlow/stat/history/getTrendByWeek | Acquire the historical customer flow trend (total customer flow/new and repeat customer, the time granularity is week) (developing) |
/passengerFlow/stat/history/getTrendByMonth | Acquire the historical customer flow trend (total customer flow/new or repeat customer, the time granularity is month) (developing) |
9.7 Real-time To Get face_id
Please refer to Sunmi Store Open Platform ->Notification Center: hook/add. First, hook the monitored event with the callback HTTP address and function to sunmi store open platform
Second, when IPC get the related face will report to sunmi cloud backend system, sunmi will push the face info to saas’ hooked http address.
9.7.1 Add an event monitoring
Description:
By requesting this API, User could set up an http callback for a set of events of their choice on the SUNMI store open platform.
When the specified events happened, open platform will request the given HTTP API.
The authorization of this HTTP API must be the same as the SUNMI store open platform API method.
Following parameters must be included in the callback API:
parameter | required | type | description |
shop_id | yes | string | the identifier of the saas shop which applied by saas |
event | yes | int | the type of event to monitor |
payload | yes | string | the specific structure of message in JSON |
API address: /hook/add
Parameters:
parameters | reqired | type | decription | example |
shop_id | yes | string | the identifier of the saas shop which applied by saas | 15220 |
http_callback | yes | string | the http call back API | http://xxxxxxxx/api/testHook |
event_list | yes | array[int] | the list of event to be monitored | [2001] |
demo case:
"method": "POST",
"url": "https://store.uat.sunmi.com/openapi/hook/add",
"headers": {
"Content-Type": "application/x-www-form-urlencoded"
},
formData: {
"shop_id": "15220",
"http_callback": "http://xxxxxxxx/api/testHook",
"event_list": [2001],
"app_id": "LMWWQVTW4QGCC",
"timestamp": 1578972864,
"random": "5dsf6698",
"sign": "33C18A18282733A71F998BB5A5E4319D"
}
return value :
{
code:0,
msg: "succeed",
data: {}
}
parameter event
event value | description |
2001 | IPC real time face recognition message |
payload(event=2001):
{
ipc_id: "928",
face_id: "29195",
gender: 1,
age_range: 4,
group_id: "8927",
group_name: "stranger",
group_type": 2
}
parameter : gender
gender value | descrption |
0 | unkown |
1 | male |
2 | female |
parameter : age_range
age_range value | description |
1 | age 0~6 |
2 | age 7~12 |
3 | age 13~18 |
4 | age 19~28 |
5 | age 29~35 |
6 | age 36~45 |
7 | age 46~55 |
8 | age 56~ |
parameter: group_type
group_type value | description |
1 | stranger face library |
2 | familiar face library |
3 | shop assistant face library |
5 | custom face library |
Appendix
update date | update content |
---|---|
2019-07-07 | draft |
2019-07-17 | Simplified interface, keep the shop_id as the only indentifer for saas |
2019-08-08 | adjust some return value |
2019-08-23 | update notification center |