Appearance
Hanshow PriSmart 2.4.2 API Specification
Version: V1.0.0
Document No.: HS-PRISMART-V242012
For more information, visit our website:
https://www.hanshow.com
STATEMENT
This document and all its contents contained remain the proprietary material of Hanshow Technology Co., Ltd. (Hanshow) and are protected by Chinese laws and applicable international conventions on copyrights. Any reproduction, transmission, disclosure, revision, modification or use otherwise of this document or the whole or part of its contents, in whatever form and by whatever means, is not permitted without prior express written authorization from Hanshow. Offenders will be liable for any and all damages caused by their offence hereof and will be subject to all remedies that Hanshow is entitled to seek under applicable laws.
⚠ NOTICE
Your purchase of products, services, or features should be governed by the commercialcontract and terms of Hanshow Technology Co., Ltd., and all or part of the products,services, or features described in this document may not be within the scope of yourpurchase or use. Unless otherwise provided in the contract, Hanshow Technology Co., Ltd.makes no explicit or implied representations or warranties concerning the content of thisdocument.
Due to product upgrades or other reasons, the content of this document will be updatedperiodically. Unless otherwise agreed upon, this document serves only as a usage guide,and all statements, information, and recommendations contained herein do notconstitute any explicit or implied warranty.
ABOUT THE DOCUMENT
Thanks for using Hanshow PriSmart Smart Retail System.
This document is intended to introduce how to use the interface of PriSmart 2.4.2, its basic functions, performance characteristics, and points of caution for use.
Please read this document carefully before using the device in first, retain the manual for subsequent use or for the next owner. If the instructions contained in this manual are insufficient to resolve issues that occur during device operation or maintenance, please contact Hanshow Technical Customer Service Center(China: 400-0365-305; Netherlands:0800- 022-5037; Belgium: 0800-71-335; France: 0800-902-530; Thailand: 1800-011-185; Germany: 0800-182-7358; Australia: 0061-1800-953-008) directly, we will provide you with multi-channel technical services.
TARGET USERS
The system access API is for software developers and R&D managers who have certain software development capabilities and understand WEB software development, JAVA language, and JSON. This document is applicable to:
• Hand-held device developers • JAVA software engineers • Other language software engineers
SYMBOL DESCRIPTION
| Icon | Description |
|---|---|
| ⚠️ | Information indicated with this icon should be paid special attention to by the reader |
| ℹ️ | Information indicated with this icon is the explanation on the formal text for the readers to comprehend the text better |
| [X:X] | It means special noun definition is provided here |
EXPLANATION OF TERMS
| Term | Expanded form | Description |
|---|---|---|
| PriSmart | PriSmart Smart Retail System | Administrate commodity data of all stores and send price changing information to ESL. |
| AP | Wireless Access Point | Access point, also called ESL Controller, is used for the data transmission and interaction of controlling information between ESL-Working and ESL. |
| API | Application Programming Interface | A set of predefined functions for applications and developers to access a routine based on a software or hardware, without having to access source code or understand detailed working mechanism. |
| ESL | Electronic Shelf Label | ESL is used for displaying product information e.g. promotion information, price and specification, etc. |
| ESL-Working | ESL-Working System | Manages all the APs and ESLs in store. ESL-Working 3.0 and higher versions support multi store management. |
| PDA | Personal Digital Assistant | Intelligent handheld terminal, used to perform operations for store ESLs. |
1 Read before starting
When accessing the system for development purpose, please mind to meet the specifications and call frequency restrictions of each interface and to pay special attention to the use of sensitive information such as messages and data. Please call it in strict accordance with the specifications, and make sure you have fully test before use.
Please pay attention to the following information when it involves user data:
- After collecting or transferring available data, you must take necessary protective measures to prevent data from being stolen or leaked.
- Once you cease using this service, or we terminate your access to the service for any reason, please stop accessing the system and data.
2 Access instructions
2.1 Access mode
The following interface requires the use of PriSmart version 2.2.0-sp.8 and above.
The interfaces mentioned in this document use HTTP protocol for requests and responses, and the request content uses JSON as data body.
About access mode, you will send login data to PriSmart application server through HTTP protocol and POST request. When the request data is received and verified, the returned data will inform you whether the submission is successful.
2.2 Authentication
In this document, the openapi3/account/login/authentication interface can be called directly without authentication, while other interfaces can only be called after authentication.
Authentication needs to call the login interface to get jsessionid. Calls of authentication-required interfaces must contain jsessionid. For more information, see the detailed description of each interface below.
If you use the web terminal to call the login interface to get jsessionid, the browser will automatically store the jsessionid parameter into the cookie and send it in the request without special handling in subsequent calls. In the scenario where the cookie cannot be used, provide jsessionid in either of the following ways:
- Add the Cookie parameter in the HTTP request header and assign the value of jsessionid to the Cookie parameter in the format of jsessionid=XXX, for example:
Accept: application/json, text/plain, / Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Connection: keep-alive Content-Type: application/json;charset=utf-8 Cookie: JSESSIONID=B3593B7975474130432.ofzerlf1b0g3129jzwr79xkge4
- Splice the jsessionid parameter using "?" after the interface URL in front of request parameters, for example,
Note: In the following descriptions for the authentication-required interfaces, the Cookie parameter is added in the HTTP request header and assign the value of jsessionid to the Cookie parameter in the format of jsessionid=XXX.
2.3 Response parameter description
| Variable name | Description |
|---|---|
| code | Status code:
|
| result | Response result. The prompt message is for reference only, it can be processed or operated according to the status code. |
| errorContext | Key content. The prompt message is for reference only, generally the wrong key field, such as password. |
| message | Response information. Different response bodies have different message content values. Generally, it is a specific description, such as password is null. |
| data | Data content. Different response bodies with different data content values. For more information, see the response parameter description for each interface. |
3 API
3.1 Store user login using the POST method
3.1.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/account/login/authentication |
|---|---|
| Method | POST |
| Content type | application/json;charset=utf-8 |
| Description | Logs in to PriSmart with store user's account and password. |
| Authentication required | No. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/account/login/authentication |
3.1.2 Request parameters
Map type, specific parameters are as follows:
- username: String. Required. Login user name.
- authentication: String. Required. Encrypted login password. Encryption algorithm: MD5 (password + username).
3.1.3 Response parameters
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
- message: String. Response message.
- data: Map. Response data content.
- jsessionid: String. Identifier.
- stores: Map. Store list.
- Whose key is store ID (i.e. customer ID, store ID), whose value is store name.
3.1.4 Sample
3.1.4.1 Sample request
POST http://127.0.0.1:8080/prismart/openapi3/account/login/authentication
3.1.4.2 Sample response
Normal response example:
json
{ "code": 1001,
"result": "succeed",
"message": "success",
"data": {
"jsessionid": "71127490971154176_1w0GS854120wppnneung52k4ryy3", "stores": {
"customer01.9189": "9189",
"customer01.9199": "9199",
"customer01.8152": "8152"
}
}
}Error response example
json
{
"resultcode": 1101,
"result": "password_mismatch",
"message": "Incorrect password of user \"customer01.store01\""
}3.2 Logout system using the POST method
3.2.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/account/login/logout |
|---|---|
| Method | POST |
| Content type | application/json;charset=utf-8 |
| Description | Logs out. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/account/login/logout |
3.2.2 Request parameters
None.
3.2.3 Response parameters
- code: Integer. Whose value is the same as the store user login interface returned key value. See section 2.3 Response parameter description.
- result: String. Response result.
- message: String. Response message.
3.2.4 Sample
3.2.4.1 Sample request
POST http://127.0.0.1:8080/prismart/openapi3/account/login/logout
3.2.4.2 Sample response
json
{
"code": 1001,
"result": "succeed", "message": "success"
}3.3 Query product detail based on EAN or SKU using the GET method
3.3.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/articles/[articleCode]/detail |
|---|---|
| Method | GET |
| Content type | application/json;charset=utf-8 |
| Description | Product information query by EAN or SKU. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/articles/10001/detail?customer-code=HS&store-code=50001&page-size=10 |
3.3.2 Request parameters
URI parameters:
- articleCode: String. Required. Product SKU or EAN.
- customer-code: String. Required. Customer ID.
- store-code: String. Required. Store ID.
- page-size: Integer. Optional. Query number of each page.
Request body parameter: None.
3.3.3 Response parameters
code: Integer. Status code. See section 2.3 Response parameter description.
result: String. Response result.
errorContext: String. Response message.
message: String. Response message.
data: Map. Product data content.
- resultList: List<Map>. A collection of product object.
- sku: Product sku.
- customerStoreCode: String. Customer ID, Store ID.
- resultList: List<Map>. A collection of product object.
storeCode: String. Store ID.
freshItemCode: String. Fresh food barcode.
itemName: String. Product name.
price1: BigDecimal. Retail price.
itemShortName: String. Product short name.
ean: String. Product barcode.
itemStatus: String. Product status.
brand: String. Product brand.
unit: String. Product unit.
saleMode: String. Sales mode.
placeOfOrigin: String. Place of origin.
specification: String. Product specification.
qrCode: String. Product QR code.
packSize: Integer. Pack size.
grade: String. Product grade.
description: String. Product description/remark.
level1CategoryCode: String. Level 1 category code.
level1CategoryName: String. Level 1 category name.
level2CategoryCode: String. Level 2 category code.
level2CategoryName: String. Level 2 category name.
level3CategoryCode: String. Level 3 category code.
level3CategoryName: String. Level 3 category name.
level4CategoryCode: String. Level 4 category code.
level4CategoryName: String. Level 4 category name.
level5CategoryCode: String. Level 5 category code.
level5CategoryName: String. Level 5 category name.
supervisedBy: String. Supervisory organization.
supervisionHotline: String. Supervision hotline.
pricingStaff: String. Pricing staff.
price1Description: String. Retail price description.
price2: BigDecimal. Promotion price.
price2Description: String. Promotion price description.
price3: BigDecimal. Promotion price. Membership price.
price3Description: String. Membership price description.
price4: BigDecimal. Other price.
price4Description: String. Other price description.
price5: BigDecimal. Market retail price.
price5Description: String. Market retail price description.
price6: BigDecimal. Discount price.
price6Description: String. Discount price description.
promoDateFrom: Date. Promotion start date.
promoDateTo: Date. Promotion end date.
promoTimeFrom: Time. Promotion start time.
promoTimeTo: Time. Promotion end time.
vipDateFrom: Date. VIP promotion start date.
vipDateTo: Date. VIP promotion end date.
vipTimeFrom: Time. VIP promotion start time.
vipTimeTo: Time. VIP promotion end time.
promoReason: String. Promotion reason.
promoFlag: Integer. Promotion flag.
inventory: BigDecimal. Inventory.
safetyStock: BigDecimal. Safety stock.
dms: BigDecimal. Average daily sales volume.
todaySalesQty: BigDecimal. Sales volume on the day.
cumulatedSalesQty: BigDecimal. Cumulated sales volume.
shelfQty: BigDecimal. Shelf quantity.
shelfCode: String. Shelf ID/prodlocation ID.
shelfTier: String. Shelf layer.
shelfColumn: String. Shelf column.
displayLocation: String. Display location.
supplierCode: String. Supplier code.
supplierName: String. Supplier name.
onOrderQty: BigDecimal. On order quantity.
expiryDate: Date. Expiry date.
storageLife: String. Storage life.
shelfLife: Integer. Shelf life.
ingredientTable: String. Ingredient table.
manufacturer: String. Manufacturer name.
manufacturerAddress: String. Manufacturer address.
memberPoints: BigDecimal. Membership points.
rsrvTxt1: String. Reserved field 1_text.
rsrvTxt2: String. Reserved field 2_text.
rsrvTxt3: String. Reserved field 3_text.
rsrvTxt4: String. Reserved field 4_text.
rsrvTxt5: String. Reserved field 5_text.
rsrvTxt6: String. Reserved field 6_text.
rsrvTxt7: String. Reserved field 7_text.
rsrvTxt8: String. Reserved field 8_text.
rsrvTxt9: String. Reserved field 9_text.
rsrvTxt10: String. Reserved field 10_text.
rsrvTxt11: String. Reserved field 11_text.
rsrvTxt12: String. Reserved field 12_text.
rsrvTxt13: String. Reserved field 13_text.
rsrvTxt14: String. Reserved field 14_text.
rsrvTxt15: String. Reserved field 15_text.
rsrvTxt16: String. Reserved field 16_text.
rsrvTxt17: String. Reserved field 17_text.
rsrvTxt18: String. Reserved field 18_text.
rsrvTxt19: String. Reserved field 19_text.
rsrvTxt20: String. Reserved field 20_text.
rsrvTxt21: String. Reserved field 21_text.
rsrvTxt22: String. Reserved field 22_text.
rsrvTxt23: String. Reserved field 23_text.
rsrvTxt24: String. Reserved field 24_text.
rsrvTxt25: String. Reserved field 25_text.
rsrvDec1: BigDecimal. Reserved field 1_decimal.
rsrvDec2: BigDecimal. Reserved field 2_decimal.
rsrvDec3: BigDecimal. Reserved field 3_decimal.
rsrvDec4: BigDecimal. Reserved field 4_decimal.
rsrvDec5: BigDecimal. Reserved field 5_decimal.
rsrvDec6: BigDecimal. Reserved field 6_decimal.
rsrvDec7: BigDecimal. Reserved field 7_decimal.
rsrvDec8: BigDecimal. Reserved field 8_decimal.
rsrvDec9: BigDecimal. Reserved field 9_decimal.
rsrvDec10: BigDecimal. Reserved field 10_decimal.
rsrvDec11: BigDecimal. Reserved field 11_decimal.
rsrvDec12: BigDecimal. Reserved field 12_decimal.
rsrvDec13: BigDecimal. Reserved field 13_decimal.
rsrvDec14: BigDecimal. Reserved field 14_decimal.
rsrvDec15: BigDecimal. Reserved field 15_decimal.
rsrvDec16: BigDecimal. Reserved field 16_decimal.
rsrvDec17: BigDecimal. Reserved field 17_decimal.
rsrvDec18: BigDecimal. Reserved field 18_decimal.
rsrvDec19: BigDecimal. Reserved field 19_decimal.
rsrvDec20: BigDecimal. Reserved field 20_decimal.
rsrvDec21: BigDecimal. Reserved field 21_decimal.
rsrvDec22: BigDecimal. Reserved field 22_decimal.
rsrvDec23: BigDecimal. Reserved field 23_decimal.
rsrvDec24: BigDecimal. Reserved field 24_decimal.
rsrvDec25: BigDecimal. Reserved field 25_decimal.
rsrvInt1: Integer. Reserved field 1_integer.
rsrvInt2: Integer. Reserved field 2_integer.
rsrvInt3: Integer. Reserved field 3_integer.
rsrvInt4: Integer. Reserved field 4_integer.
rsrvInt5: Integer. Reserved field 5_integer.
rsrvInt6: Integer. Reserved field 6_integer.
rsrvInt7: Integer. Reserved field 7_integer.
rsrvInt8: Integer. Reserved field 8_integer.
rsrvInt9: Integer. Reserved field 9_integer.
rsrvInt10: Integer. Reserved field 10_integer.
rsrvInt11: Integer. Reserved field 11_integer.
rsrvInt12: Integer. Reserved field 12_integer.
rsrvInt13: Integer. Reserved field 13_integer.
rsrvInt14: Integer. Reserved field 14_integer.
rsrvInt15: Integer. Reserved field 15_integer.
rsrvInt16: Integer. Reserved field 16_integer.
rsrvInt17: Integer. Reserved field 17_integer.
rsrvInt18: Integer. Reserved field 18_integer.
rsrvInt19: Integer. Reserved field 19_integer.
rsrvInt20: Integer. Reserved field 20_integer.
rsrvInt21: Integer. Reserved field 21_integer.
rsrvInt22: Integer. Reserved field 22_integer.
rsrvInt23: Integer. Reserved field 23_integer.
rsrvInt24: Integer. Reserved field 24_integer.
rsrvInt25: Integer. Reserved field 25_integer.
rsrvBlob: String. Reserved field 1_long text.
others: String. Other information.
3.3.4 Sample
3.3.4.1 Sample request
GET
http://127.0.0.1:8080/prismart/openapi3/store/articles/10001/detail?customer
-code=hs&store-code=500013.3.4.2 Sample response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": {
"resultSet": [
{
"sku": "10001",
"ean": "1000101,1000102",
"itemName": "red apple",
"itemShortName": "apple",
"price2": 10,
"rsrvTxt6": "Kg",
"promoFlag": 0,
"delayPush": 0,
"lastBindTime": 1675909654047
}
]
}
}Error response exmaple
{
"code" : 1003,
"result" : "illegal_arguments",
"message" : "Both 'customer-code' and 'store-code' are required in query
param."
}3.4 Create an association based on ESL and product using the PUT method
3.4.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/links |
|---|---|
| Method | PUT |
| Content type | application/json;charset=utf-8 |
| Description | Create an association based on ESL and product. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/links?customer-code=HS&store-code=50001 |
3.4.2 Request parameters
URL parameters:
- customer-code: String. Required. Customer ID.
- store-code: String. Required. Store ID.
Request body parameters: List type, specific parameters are as follows:
labelId: String. Required. 11-digit ESL ID.
position: Integer. Optional. Split-screen position for the product to bind.
sku: String. Required. Product SKU.
extra: Map. Optional. Extended parameter.
controlParam: Map. Optional. Flashing and page switch parameter.
- flashLight: Map. Optional. Flashing parameter.
- colors: String array. Optional. Flashing LED colors. Multiple colors will be displayed in order. Currently supported colors include blue, red, violet, green, indigo, yellow and white.
- onTime: String. Optional. LED-on time. The value range is 0–225. The unit is 30ms.
- offTime: String. Optional. LED-off time. The value range is 0–225. The unit is 30ms.
- flashLight: Map. Optional. Flashing parameter.
sleepTime: String. Optional. Interval time between two adjacent LED flashes. The value range is 1–65535. The unit is 30ms.
flashTime: String. Optional. The length of a flash. The maximum value is 3600. The unit is second.
switchPage: Map. Optional. Page switching parameter.
- pageId: String. Optional. Destination page for page switching.
- stayTime: String. Optional. The retention time on the page_id specified page. The value range is 0–65535. The unit is second. It will switch to the default page when retention time is over. It will not execute page switch when set to 0.
3.4.3 Response parameters
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
- message: String. Response message.
- data: List<Map>. Response data content.
- labelId: String. 11-digit ESL ID.
- sku: String. Product SKU.
- errorContext: String. Error message.
- message: String. Response message.
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
3.4.4.1 Sample request
json
PUT http://127.0.0.1:8080/prismart/openapi3/store/links?customercode=hs&store-code=50001
[
{
"labelId": "10-01-19-00",
"position": 2,
"sku": "1000",
"extra": {},
"controlParam": {
"flashLight": {
"colors": [
"red"
],
"onTime": 10,
"offTime": 10,
"sleepTime": 10,
"flashTime": 1200
},
"switchPage": {
"pageId": "2",
"stayTime": 1200
}
}
}
]3.4.4.2 Sample response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": [
{
"labelId": "10-01-19-00",
"sku": "1000",
"message": "success",
"result": "succeed",
"code": 1001
}
]
}Error response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": [
{
"eslId": "50-1A-4C-EE",
"message": "Specified ESL ID \"50-1A-4C-EE\" is not existed",
"code": 1006,
"errorContext": "eslId"
}
]
}3.5 Delete an association based on ESL or product using the DELETE method
3.5.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/links |
|---|---|
| Method | DELETE |
| Content type | application/json;charset=utf-8 |
| Description | Delete an association based on ESL or product. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/links?customer-code=HS&store-code=50001 |
3.5.2 Request parameters
URI parameters:
- customer-code: String. Required. Customer ID.
- store-code: String. Required. Store ID.
List type, specific parameters are as follows:
- labelId: String. Required. 11-digit ESL ID.
- position: Integer. Optional. Split-screen position for the product to bind.
- sku: String. Optional. Product SKU.
3.5.3 Response parameters
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
- message: String. Response message.
- data: List<Map>. Response data content.
- labelId: String. 11-digit ESL ID.
- sku: String. Product SKU.
- message: String. Response message.
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
3.5.4 Sample
3.5.4.1 Sample request
json
DELETE http://127.0.0.1:8080/prismart/openapi3/store/links?customercode=hs&store-code=50001
[
{
"labelId": "10-01-19-00",
"position": 5,
"sku": "1000"
}
]3.5.4.2 Sample response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": [
{
"labelId": "10-01-19-00",
"sku": "1000",
"message": "success",
"result": "succeed",
"code": 1001
}
]
}Error response example:
json
{
"code": 1003,
"result": "illegal_arguments",
"message": "illegal arguments",
"data": [
{
"labelId": "00-19-00-00",
"sku": "10001",
"message": "Specified ESL is not existed",
"result": "nonexistent_esl",
"code": 1006
}
]
}3.6 Control ESL flashing or page switching based on ESL ID using the POST method
3.6.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/labels/control |
|---|---|
| Method | POST |
| Content type | application/json;charset=utf-8 |
| Description | Control ESL flashing or page switching based on ESL ID. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/labels/control?customer-code=HS&store-code=50001 |
3.6.2 Request parameters
URI parameters:
- customer-code: String. Required. Customer ID.
- store-code: String. Required. Store ID.
Request body parameters:
List type, specific parameters are as follows:
labelId: String. Required. 11-digit ESL ID.
controlParam: Map. Optional. Flashing and page switching parameter. flashLight and switchPage parameters cannot be null at the same time.
- flashLight: Map. Optional. ESL Flashing parameter.
- colors: String array. Optional. Flashing LED colors. Multiple colors will be displayed in order. Currently supported colors include blue, red, violet, green, indigo, yellow and white.
- onTime: String. Optional. LED-on time. The value range is 0–225. The unit is 30ms.
- offTime: String. Optional. LED-off time. The value range is 0–225. The unit is 30ms.
- sleepTime: String. Optional. Interval time between two adjacent LED flashes. The value range is 1–65535. The unit is 30ms.
- flashLight: Map. Optional. ESL Flashing parameter.
flashTime: String. Optional. The length of a flash. The maximum value is 3600. The unit is second.
switchPage: Map. Optional. Page switching parameter.
- pageId: String. Optional. Destination page for page switching.
- stayTime: String. Optional. The retention time on the page_id specified page. The value range is 0–65535. The unit is second.
3.6.3 Response parameters
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
- message: String. Response message.
- data: List<Map>. Response data content.
- labelId: String. 11-digit ESL ID.
- message: String. Response message.
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
3.6.4 Sample
3.6.4.1 Sample request
json
POST
http://127.0.0.1:8080/prismart/openapi3/store/labels/control?customercode=hs&store-code=50001
[{
"labelId": "10-00-16-71",
"controlParam": {
"flashLight": {
"colors": [
"red"
],
"onTime": 10,
"offTime": 10,
"sleepTime": 10,
"flashTime": 1200
},
"switchPage": {
"pageId": "1",
"stayTime": 1200
}
}
}]3.6.4.2 Sample response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": [
{
"labelId": "10-00-16-71",
"message": "success",
"result": "succeed",
"code": 1001
}
]
}Error response example:
json
{
"code": 1003,
"result": "illegal_arguments",
"message": "Both 'customer-code' and 'store-code' are required in query param."
}3.7 Query association based on ESL collection using the POST method
3.7.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/links/labels/list |
|---|---|
| Method | POST |
| Content type | application/json;charset=utf-8 |
| Description | Query association based on ESL collection. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/links/labels/list?customer-code=HS&store-code=50001 |
3.7.2 Request parameters
URI parameters:
- customer-code: String. Required. Customer ID.
- store-code: String. Required. Store ID.
Request body parameters:
- labelIds: List. Required. eslId collection.
- labelId: String. Required. 11-digit ESL ID.
3.7.3 Response parameters
- code: Integer. Status code. See section 2.3 Response parameter description.
- result: String. Response result.
- message: String. Response message.
- data: Map. Response data content. This field will not return when there is request exception.
- resultSet: List<Map>. A collection of ESL objects.
- labelId: String. 11-digit ESL ID.
- sku: String. Product ID.
- position: Integer. Split-screen position for the product to bind.
- source: Integer. Source.
- extra: Map. Extended parameter.
- createTime: String. Creation time.
- resultSet: List<Map>. A collection of ESL objects.
3.7.4 Sample
3.7.4.1 Sample request
json
POST
`http://10.11.162.15:8080/prismart/openapi3/store/links/labels/list?customer-code={{customerCode}}&store-code={{storeCode}}`
{
"labelIds": [
{
"labelId": "10-00-16-71"
}
]
}3.7.4.2 Sample response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": {
"total": 1,
"start": 0,
"count": 1,
"resultSet": [
{
"labelId": "10-00-16-71",
"sku": "1671",
"position": 0,
"source": 1,
"extra": "{}",
"createTime": 1667979510325
}
]
}
}Error response example:
{
"code": 1003,
"result": "illegal_arguments",
"message": "Both 'customer-code' and 'store-code' are required in query param."
}3.8 Query association based on product collection using the POST method
3.8.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/links/articles/list |
|---|---|
| Method | POST |
| Content type | application/json;charset=utf-8 |
| Description | Query association based on product collection. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/links/articles/list?customer-code=HS&store-code=50001 |
3.8.2 Request parameters
URI parameters:
- customerCode: String. Required. Customer ID.
- storeCode: String. Required. Store ID.
Request body parameters:
- skus: List. Required. A collection of product SKUs.
- sku: String. Product SKU.
3.8.3 Response parameters
code: Integer. Status code. See section 2.3 Response parameter description.
result: String. Response result.
message: String. Response message.
data: Map. Response data content. If there is an exception in the request, this parameter will not be returned.
- resultSet: List<Map>. A collection of associated objects.
- labelId: String. 11-digit ESL ID.
- sku: String. Product ID.
- resultSet: List<Map>. A collection of associated objects.
position: Integer. Split-screen position for the product to bind.
source: Integer. Source.
extra: Map. Extended parameter.
createTime: String. Creation time.
3.8.4 Sample
3.8.4.1 Sample request
json
POST http://127.0.0.1:8080/prismart/openapi3/store/links/articles/list?customer-code=HS&store-code=50001 [ { "sku": "1671" } ]3.8.4.2 Sample response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": {
"total": 1,
"start": 0,
"count": 1,
"resultSet": [
{
"labelId": "10-00-16-71",
"sku": "1671",
"position": 0,
"source": 1,
"extra": "{}",
"createTime": 1667979510325
}
]
}
}Error response example:
json
{
"code": 1003,
"result": "illegal_arguments",
"message": "Both 'customer-code' and 'store-code' are required in query param."
}3.9 Query ESL details based on ESL ID using the GET method
3.9.1 API description
| URL address | http://[PriSmart access URL]/prismart/openapi3/store/labels/detail/{labelId} |
|---|---|
| Method | GET |
| Content type | application/json;charset=utf-8 |
| Description | Query ESL information using ESL ID. |
| Authentication required | Yes. See section 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/store/labels/detail/753C22-2A1?customer-code=HS&store-code=50001 |
3.9.2 Request parameters
URI parameters:
- labelId: String. Required. 11-digit ESL ID.
- customerCode: String. Required. Customer ID.
- storeCode: String. Required. Store ID.
Request body parameters: None.
3.9.3 Response parameters
code: Integer. Status code. See section 2.3 Response parameter description.
result: String. Response result.
message: String. Response message.
data: Map. Response data content. If there is an exception in the request, this parameter will not be returned.
- customerCode: String. Customer ID.
- storeCode: String. Store ID.
- labelId: String. 11-digit ESL ID.
- screenType: String. ESL screen type.
- firmwareId: String. ESL firmware version number.
rone: String. ESL software version number.
battery: String. ESL battery volume.
template: Default ESL template name.
extEsld: String. 18-digit ESL extended ID.
initialApId: String. The AP who initially created this ESL.
lastApId: String. The AP that associated with the ESL when it sent the last heartbeat.
temperatureGathering: Integer. Whether or not can support temperature capturing.
status: Integer. ESL's activation status. 0: inactivated; 1: activated.
pushCount: Integer. Number of updates sent by ESL.
success: Integer. Number of successful updates.
failure: Integer. Number of failed updates.
lastRefreshStatus: Integer. The status of last update.
batteryStatus: Integer. Battery volume status. 1: normal; 2: low power; 3: out of power; 4: unknown; 5: low power warning.
lastHeartbeatTime: Long. Time of ESL's last heartbeat.
lastUnbindReason: Reason of last disassociation.
createTime: Long. ESL creation time.
lastUpdateTime: Long. Update time.
type: Integer. ESL type. 0: regular ESL.
3.9.4 Sample
3.9.4.1 Sample request
json
GET http://127.0.0.1:8080/prismart/openapi3/store/labels/detail/53-7C-22-2A?customer-code=HS&store-code=500013.9.4.2 Sample response
Normal response example:
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": {
"customerCode": "HS",
"storeCode": "50001",
"labelId": "53-7C-22-2A",
"screenType": "EPD",
"firmwareId": 346932,
"rom": 16,
"battery": 27,
"template": "25012213-black-white-red",
"initialApId": "1",
"lastApId": "1",
"temperatureGathering": 1,
"status": 1,
"pushCount": 86,
"success": 14,
"failure": 5,
"lastRefreshStatus": 900,
"templateDirection": 0,
"lastRefreshTime": 1681184530253,
"createTime": 1665988152723,
"lastHeartbeatTime": 16762211638,
"lastUnbindTime": 168639213392,
"lastUnbindReason": "webui",
"lastUpdateTime": 1686392113396,
"type": 0
}
}Error response example:
{
"code" : 1003,
"result" : "illegal_arguments",
"message" : "Both 'customer-code' and 'store-code' are required in query
param."
}3.10 Query store statistics data using the GET method
3.10.1 API Description
| URL address | http://[PriSmart access address]/prismart/openapi3/monitor/store/statistics |
|---|---|
| Method | GET |
| Content type | application/json;charset=utf-8 |
| Description | Query ESL information based on the ESL ID. |
| Authentication required | Yes. Refer to the 2.2 Authentication. |
| Sample | http://127.0.0.1:8080/prismart/openapi3/monitor/store/statistics?customer-code=HS&store-code=50001 |
⚠️ Notice: The number of ESLs returned by this interface may differ from that of displayed on the store-level dashboard page of PriSmart webpage. The data will become consistent within 30 minutes at most.
3.10.2 Request Parameters
URI parameters:
- customer-code: String. Required. Customer ID.
- store-code: String. Required. Store ID.
Request Body Parameters: None.
3.10.3 Response Parameters
code: Integer. Status code. Refer to 2.3 Response parameter description.
result: String. Response result.
message: String. Response message.
data: Map. Response data content. This field will not return when there is request exception.
- customerCode: String. Customer identifier.
- storeCode: String. Store identifier.
- orgName: String. Organization the store belongs to.
- timestamp: Long. Timestamp.
articleCount: Integer. Total number of products in the store.
labelCount: Integer. Total number of ESLs in the store.
labelLowBatteryCount: Integer. Total number of low battery ESLs in the store.
labelUpdatingCount: Integer. Total number of updating ESLs in the store.
labelUpdateSuccessCount: Integer. Total number of successfully updated ESLs in the store.
labelUpdateFailureCount: Integer. Total number of failed update ESLs in the store.
boundLabelCount: Integer. Total number of ESLs with association in the store.
boundArticleCount: Integer. Total number of products with association in the store.
accesspointsCount: Integer. Total number of access points in the store.
accesspointsOnlineCount: Integer. Number of online access points in the store.
accesspointsOfflineCount: Integer. Number of offline access points in the store.
3.10.4 Sample
3.10.4.1 Sample request
GET http://127.0.0.1:8080/prismart/openapi3/monitor/store/statistics?customer-code=HS&store-code=500013.10.4.2 Sample Response
Normal response example:
json
{
"code": 1001,
"result": "succeed",
"message": "success",
"data": {
"customerCode": "HS",
"storeCode": "50001",
"orgName": "STORE1",
"timestamp": 1671439313845,
"articleCount": 7000,
"labelCount": 7000,
"labelLowBatteryCount": 0,
"labelUpdatingCount": 500,
"labelUpdateSuccessCount": 6500,
"labelUpdateFailureCount": 0,
"boundLabelCount": 7000,
"boundArticleCount": 7000,
"accesspointsCount": 3,
"accesspointsOnlineCount": 3,
"accesspointsOfflineCount": 0
}
}Error response example:
{
"code": 1003,
"result": "illegal_arguments",
"message": "Both 'customer-code' and 'store-code' are required in query param."
}