Appearance
Hanshow Data Integration API v2.0
Hanshow Data Integration API
V2.0
HS-INTEGRATION-General-B01
ABOUT THE DOCUMENT
The document mainly introduces key points of related interfaces such as interface description, address, request parameter and so on to help you to implement interface automation.
Please read this document carefully before using this system, retain the document 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 (400-0365-305) directly, we will provide you with multi-channel technical services.
TARGET USERS
This file is suitable for reading and using by the following engineers:
- Hand-held device developer
- Technical support engineer
- Java software engineer
- Other language engineer
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 |
|---|---|---|
| AP | Wireless Access Point | ESL control |
| 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 |
| PriSmart | PriSmart Smart Retail System | Manages all store product data and sends ESL updates, supports multi-store management. |
1 Read before starting
In the development of system access, the system needs 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 you collect the transferring available data, you must take necessary protective measures to prevent data from being stolen or leaked.
- Once you stop using this service, or we terminate your use of this service for some reason, please stop service and data access.
2 API
2.1 Integration interface (JSON data integration)
2.1.1 Interface meaning
Performs integration for the functions including updating and adding of product data (JSON data). Option: bind the product with ESL after updating and adding product data.
2.1.2 Request instruction
URL: https://{site}.hanshowcloud.net/integration/{customer_code}/{store_code}
Request Method: POST
2.1.3 Sample request
2.1.3.1 Token Obtain API
Header:
Key: Authorization
Value: Basic Z3Vlc3Q6WjNWbGMzUQ==
Z3Vlc3Q6WjNWbGMzUQ== is the Key provided by Hanshow for each client Request Method: POST
URL:https://xxx.hanshowcloud.net/proxy/token
Return result:
- Succeed
json
http status: 200
return content:
{
"access_token":eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxNzMxNTc5MzE1NzM0MzE1MDA4,
"token_type": "Bearer"
}- Failed
json
http status: 401
return content:
{
"resultCode": 1005,
"result": "UNAUTHORIZED",
"message": "Basic credentials failed"
}json
http status: 400
return content:
{
"resultCode": 1006,
"result": "Bad Request",
"message": "Missing or invalid basic header"
}json
http status: 500
return content:
{
"resultCode": 1010,
"result": "cdi_internal_error",
"message": "Internal error: JWT creation failed"
}2.1.3.2 Sample for updating and adding product
Only update or add product data:
Header:
Key: Authorization
Value: Bearer {access_token}
Request Method: POST
URL: https:// xxx.hanshowcloud.net/proxy/integration/{customerCode}/
Request Body(eg.):
json
{
"customerStoreCode": "Metro",
"storeCode": "5000",
"batchNo": "2023121112385228001",
"items": [
{
"IIS_COMMAND": "UPDATE", "sku": "2100000016"
"itemName": "King Apple", "ean": "000346",
"price1": "12.00",
"price1_description": "Selling Price", "unit": "kg",
"grade": "advanced", "supplier_name": "FarmBoy"
}
]
}Return Results:
1. Succeed
json
http status: 200
Return content:
{
"resultCode": 1001,
"result": "succeed",
"message": "succeed"
}2. Failed
json
http status: 400
Return content:
{
"resultCode": 1406,
"result": "cdi_store_not_exist",
"message": "The store not exist"
}json
http status: 400
Return content:
{
"resultCode": 1401,
"result": "cdi_illegal_integration_data",
"message": "The number of batches cannot exceed 0"
}json
http status: 200
Return content:
{
"resultCode": 1003,
"result": "cdi_illegal_field_value_format",
"message": "Illegal field value format",
"data": {
"1002": [
"$.items[0].itemName: integer found, string expected"
]
}
}json
http status:401
Return content:
{
"resultCode": 1005,
"result": "UNAUTHORIZED",
"message": " UNAUTHORIZED",
"data": null,
}json
http status: 400
Return content:
{
"resultCode": 1006,
"result": "Bad Request",
"message": "Missing or invalid Authorization header",
"data": null,
}json
http status: 400
Return content:
{
"resultCode": 1004,
"result": "cdi_json_data_parse_error",
"message": "Json data parse error",
"data": null,
}json
http status: 400
Return content:
{
"resultCode": 1010,
"result": "cdi_internal_error",
"message": "Internal error",
"data": null
}json
http status: 401
Return content:
{
"resultCode": 1005,
"result": "UNAUTHORIZED",
"message": "API-Key Failed"
}json
http status: 400
Return content:
{
"resultCode": 1006,
"result": "Bad Request",
"message": "Missing or invalid API KEY header"
}2.1.3.3 Additional Instructions for IIS_COMMAND:
IIS_COMMAND: String. Required. Operation type. Values include:
UPDATE:
Adding new product or incremental update of existing product data, that is, only updating product attributes in the update interface without changing other attributes. If the product is bound to an ESL, the update will be simultaneously sent to the ESL.
COMPLETE_UPDATE:
Overwrite update of all product data. Product attributes not provided in the interface will be set to the default values. If the product is bound to an ESL, the update will be simultaneously sent to the ESL. ® BIND: Binding products with ESLs according to product SKU and ESL ID.
BIND:
Binding product and ESL according to product SKU and ESL ID.
UNBIND_GOODS:
Unbinding product from ESL according to product SKU.
UNBIND_ESLID:
Unbinding product from ESL according to ESL ID.
UNBIND_DELETE_GOODS:
Unbinding product from ESL according to product ID and simultaneously deleting the product.
CUTPAGE_FLASHLIGHTS:
Controlling page switch and/or flashing according to ESL ID or product SKU. If both ESL ID or product SKU are provided, the system will execute the command on both the ESL bound to the product SKU and the ESL corresponding to the ESL ID.
If IIS_COMMAND is set to UPDATE or COMPLETE_UPDATE, the parameters include:
customerStoreCode: String. Required. Customer ID.
storeCode: String. Required. Store ID.
sku: String. Required. Product SKU.
ean: String. Optional. Product EAN.
itemName: String. Optional. Product name.
…: Other product parameter.
If IIS_COMMAND is set to BIND, the parameters include: customerStoreCode: String. Required. Customer ID.
storeCode: String. Required. Store ID.
eslId: String. Required. ESL ID.
sku: String. Required. Product SKU.
ean: String. Optional. Product EAN.
If IIS_COMMAND is set to UNBIND_GOODS, the parameters include:
customerStoreCode: String. Required. Customer ID.
storeCode: String. Required. Store ID.
sku: String. Required. Product SKU.
ean: String. Optional. Product EAN.
If IIS_COMMAND is set to UNBIND_ESLID, the parameters include:
customerStoreCode: String. Required. Customer ID.
storeCode: String. Required. Store ID.
eslId: String. Required. ESL ID.
If IIS_COMMAND is set to UNBIND_DELETE_GOODS, the parameters include:
customerStoreCode: String. Required. Customer ID.
storeCode: String. Required. Store ID.
sku: String. Required. Product SKU.
If IIS_COMMAND is set to CUTPAGE_FLASHLIGHTS, the parameters include:
customerStoreCode: String. Required. Customer ID.
storeCode: String. Required. Store ID.
sku: String. Required. Product SKU.
eslId: String. Required. ESL ID.
IIS_PARAM: Map. Optional. Flashing and page switch parameters:
led_color: String array. Optional. Flashing LED color. Multiple colors will be displayed in order. Currently supported colors include blue, red, violet, green, indigo, yellow, and white.
led_count: String. Optional. Number of flash repeat times. The value range is 0-65535. 0 indicates “LED off”.
led_on_time: String. Optional. LED-on time. The value range is 0-255. The unit is 30ms.
led_off_time: String. Optional. LED-off time. The value range is 0-255. The unit is 30ms.
led_sleep_time: String. Optional. Interval time between two adjacent flashes.
The value range is 0-65535. The unit is 30ms.
page_id: String. Optional. Destination page for page switch. The value range is 0-7.
page_time: String. Optional. Retention time on the destination page. The
value range is 0-65535. The unit is s. After the stay time, the page will switch back to the default page in the template. If it’s set to 0, no page switch operation will be executed.
Product Data Fields Description:
| Name | Type | Length | Decimal | Required | Sample Value | Description |
|---|---|---|---|---|---|---|
| sku | varchar | 128 | 0 | YES | 1 | SKU |
| itemName | varchar | 256 | 0 | YES | Apple | Product name |
| price1 | decimal | 11 | 4 | YES | 12.9 | Retail price |
| itemShortName | varchar | 128 | 0 | NO | Product short name | |
| freshItemCode | varchar | 128 | 0 | NO | Fresh food ID | |
| ean | varchar | 2048 | 0 | YES | 6901028071468 | Product barcode |
| itemStatus | varchar | 128 | 0 | NO | Product status | |
| brand | varchar | 128 | 0 | NO | head-shoulders | Brand |
| unit | varchar | 128 | 0 | NO | Unit | |
| saleMode | varchar | 128 | 0 | NO | Sale mode | |
| placeOfOrigin | varchar | 128 | 0 | NO | USA | Place |
| specification | varchar | 128 | 0 | NO | 125g x 5 | Specification |
| qrCode | varchar | 256 | 0 | NO | www.hanshows.com/id= | QR code |
| packSize | int | 11 | 0 | NO | 24 | Pack size |
| grade | varchar | 128 | 0 | NO | Qualified | Grade |
| description | text | 0 | 0 | NO | Product description/notes | |
| level1CategoryCode | int | 11 | 0 | NO | 2 | Level1 category code |
| level1CategoryName | varchar | 128 | 0 | NO | Food | Level1 category name |
| level2CategoryCode | int | 11 | 0 | NO | 201 | Level2 category code |
| level2CategoryName | varchar | 128 | 0 | NO | Snack food | Level2 category name |
| level3CategoryCode | int | 11 | 0 | NO | 20103 | Level3 category code |
| level3CategoryName | varchar | 128 | 0 | NO | Sweet | Level3 category name |
| level4CategoryCode | int | 11 | 0 | NO | 2010301 | Level4 category code |
| level4CategoryName | varchar | 128 | 0 | NO | Hard candy | Level4 category name |
| level5CategoryCode | int | 11 | 0 | NO | 201030102 | Level5 category code |
| level5CategoryName | varchar | 128 | 0 | NO | Fruit-flavored hard candy | Level5 category name |
| supevisedBy | varchar | 128 | 0 | NO | Supervised by | |
| supervisionHotline | varchar | 128 | 0 | NO | Supervision hotline | |
| pricingStaff | varchar | 128 | 0 | NO | Pricing staff 1 | Pricing staff |
| price1Description | varchar | 128 | 0 | NO | Retail price | Retail price description |
| price2 | decimal | 11 | 4 | NO | 11.9 | Promotion price |
| price2Description | varchar | 128 | 0 | NO | Promotion price | Promotion price description |
| price3 | decimal | 11 | 4 | NO | 10.9 | Member price |
| price3Description | varchar | 128 | 0 | NO | member price | Member price description |
| price4 | decimal | 11 | 4 | NO | 9.9 | Other price |
| price4Description | varchar | 128 | 0 | NO | Price spike | Other price description |
| price5 | decimal | 11 | 4 | NO | 13.5 | Market retail price |
| price5Description | varchar | 128 | 0 | NO | Market price | Market retail price Description |
| price6 | decimal | 11 | 4 | NO | Discount price | |
| price6Description | varchar | 128 | 0 | NO | Discount price description | |
| promoDateFrom | datetime | 3 | 0 | NO | Promotion date from | |
| promoDateTo | datetime | 3 | 0 | NO | Promotion date to | |
| promoTimeFrom | time | 0 | 0 | NO | Promotion time from | |
| promoTimeTo | time | 0 | 0 | NO | Promotion time to | |
| vipDateFrom | datetime | 3 | 0 | NO | VIP date from | |
| vipDateTo | datetime | 3 | 0 | NO | VIP date to | |
| vipTimeFrom | time | 0 | 0 | NO | VIP time from | |
| vipTimeTo | time | 0 | 0 | NO | VIP time to | |
| promoReason | text | 0 | 0 | NO | Promotion reason | |
| promoFlag | int | 11 | 0 | NO | Promotion flag | |
| inventory | decimal | 11 | 4 | NO | Inventory quantity | Inventory |
| safetyStock | decimal | 11 | 4 | NO | Safety stock | |
| dms | decimal | 11 | 4 | NO | 8.3 | Daily sales |
| todaySalesQty | decimal | 11 | 4 | NO | 2.1 | Today sales quantity |
| cumulatedSalesQty | decimal | 11 | 4 | NO | 502.5 | Cumulated sales quantity |
| shelfQty | decimal | 11 | 4 | NO | 25 | Shelf quantity |
| shelfCode | varchar | 128 | 0 | NO | Shelf number/ product location number | |
| shelfTier | varchar | 128 | 0 | NO | Shelf layer | |
| shelfColumn | varchar | 128 | 0 | NO | Shelf column | |
| displayLocation | varchar | 128 | 0 | NO | HH-CC-LL | Display location |
| supplierCode | varchar | 128 | 0 | NO | Supplier code | |
| supplierName | varchar | 128 | 0 | NO | Supplier name | |
| onOrderQty | decimal | 11 | 4 | NO | On order quantity | |
| expiryDate | date | 0 | 0 | NO | May 2, 2017 | Expiry date |
| storageLife | varchar | 128 | 0 | NO | 180 days 1 year | Storage life |
| shelfLife | int | 11 | 0 | NO | Shelf life | |
| ingredientTable | text | 0 | 0 | NO | Ingredient table | |
| manufacturer | varchar | 128 | 0 | NO | Manufacturer name | |
| manufacturerAddress | varchar | 256 | 0 | NO | Manufacturer address | |
| memberPoints | decimal | 11 | 4 | NO | 15 | Member points |
| rsrvTxt1 | varchar | 256 | 0 | NO | Reserved field 1_text | |
| rsrvTxt2 | varchar | 256 | 0 | NO | Reserved field 2_text | |
| rsrvTxt3 | varchar | 256 | 0 | NO | Reserved field 3_text | |
| rsrvTxt4 | varchar | 256 | 0 | NO | Reserved field 4_text | |
| rsrvTxt5 | varchar | 256 | 0 | NO | Reserved field 5_text | |
| rsrvTxt6 | varchar | 256 | 0 | NO | Reserved field 6_text | |
| rsrvTxt7 | varchar | 256 | 0 | NO | Reserved field 7_text | |
| rsrvTxt8 | varchar | 256 | 0 | NO | Reserved field 8_text | |
| rsrvTxt9 | varchar | 256 | 0 | NO | Reserved field 9_text | |
| rsrvTxt10 | varchar | 256 | 0 | NO | Reserved field 10_text | |
| rsrvTxt11 | varchar | 256 | 0 | NO | Reserved field 11_text | |
| rsrvTxt12 | varchar | 256 | 0 | NO | Reserved field 12_text | |
| rsrvTxt13 | varchar | 256 | 0 | NO | Reserved field 13_text | |
| rsrvTxt14 | varchar | 256 | 0 | NO | Reserved field 14_text | |
| rsrvTxt15 | varchar | 256 | 0 | NO | Reserved field 15_text | |
| rsrvTxt16 | varchar | 256 | 0 | NO | Reserved field 16_text | |
| rsrvTxt17 | varchar | 256 | 0 | NO | Reserved field 17_text | |
| rsrvTxt18 | varchar | 256 | 0 | NO | Reserved field 18_text | |
| rsrvTxt19 | varchar | 256 | 0 | NO | Reserved field 19_text | |
| rsrvTxt20 | varchar | 256 | 0 | NO | Reserved field 20_text | |
| rsrvTxt21 | varchar | 256 | 0 | NO | Reserved field 21_text | |
| rsrvTxt22 | varchar | 256 | 0 | NO | Reserved field 22_text | |
| rsrvTxt23 | varchar | 256 | 0 | NO | Reserved field 23_text | |
| rsrvTxt24 | varchar | 256 | 0 | NO | Reserved field 24_text | |
| rsrvTxt25 | varchar | 256 | 0 | NO | Reserved field 25_text | |
| rsrvDec1 | decimal | 11 | 4 | NO | Reserved field 1_decimal | |
| rsrvDec2 | decimal | 11 | 4 | NO | Reserved field 2_decimal | |
| rsrvDec3 | decimal | 11 | 4 | NO | Reserved field 3_decimal | |
| rsrvDec4 | decimal | 11 | 4 | NO | Reserved field 4_decimal | |
| rsrvDec5 | decimal | 11 | 4 | NO | Reserved field 5_decimal | |
| rsrvDec6 | decimal | 11 | 4 | NO | Reserved field 6_decimal | |
| rsrvDec7 | decimal | 11 | 4 | NO | Reserved field 7_decimal | |
| rsrvDec8 | decimal | 11 | 4 | NO | Reserved field 8_decimal | |
| rsrvDec9 | decimal | 11 | 4 | NO | Reserved field 9_decimal | |
| rsrvDec10 | decimal | 11 | 4 | NO | Reserved field 10_decimal | |
| rsrvDec11 | decimal | 11 | 4 | NO | Reserved field 11_decimal | |
| rsrvDec12 | decimal | 11 | 4 | NO | Reserved field 12_decimal | |
| rsrvDec13 | decimal | 11 | 4 | NO | Reserved field 13_decimal | |
| rsrvDec14 | decimal | 11 | 4 | NO | Reserved field 14_decimal | |
| rsrvDec15 | decimal | 11 | 4 | NO | Reserved field 15_decimal | |
| rsrvDec16 | decimal | 11 | 4 | NO | Reserved field 16_decimal | |
| rsrvDec17 | decimal | 11 | 4 | NO | Reserved field 17_decimal | |
| rsrvDec18 | decimal | 11 | 4 | NO | Reserved field 18_decimal | |
| rsrvDec19 | decimal | 11 | 4 | NO | Reserved field 19_decimal | |
| rsrvDec20 | decimal | 11 | 4 | NO | Reserved field 20_decimal | |
| rsrvDec21 | decimal | 11 | 4 | NO | Reserved field 21_decimal | |
| rsrvDec22 | decimal | 11 | 4 | NO | Reserved field 22_decimal | |
| rsrvDec23 | decimal | 11 | 4 | NO | Reserved field 23_decimal | |
| rsrvDec24 | decimal | 11 | 4 | NO | Reserved field 24_decimal | |
| rsrvDec25 | decimal | 11 | 4 | NO | Reserved field 25_decimal | |
| rsrvInt1 | int | 11 | 0 | NO | Reserved field 1_integer | |
| rsrvInt2 | int | 11 | 0 | NO | Reserved field 2_integer | |
| rsrvInt3 | int | 11 | 0 | NO | Reserved field 3_integer | |
| rsrvInt4 | int | 11 | 0 | NO | Reserved field 4_integer | |
| rsrvInt5 | int | 11 | 0 | NO | Reserved field 5_integer | |
| rsrvInt6 | int | 11 | 0 | NO | Reserved field 6_integer | |
| rsrvInt7 | int | 11 | 0 | NO | Reserved field 7_integer | |
| rsrvInt8 | int | 11 | 0 | NO | Reserved field 8_integer | |
| rsrvInt9 | int | 11 | 0 | NO | Reserved field 9_integer | |
| rsrvInt10 | int | 11 | 0 | NO | Reserved field 10_integer | |
| rsrvInt11 | int | 11 | 0 | NO | Reserved field 11_integer | |
| rsrvInt12 | int | 11 | 0 | NO | Reserved field 12_integer | |
| rsrvInt13 | int | 11 | 0 | NO | Reserved field 13_integer | |
| rsrvInt14 | int | 11 | 0 | NO | Reserved field 14_integer | |
| rsrvInt15 | int | 11 | 0 | NO | Reserved field 15_integer | |
| rsrvInt16 | int | 11 | 0 | NO | Reserved field 16_integer | |
| rsrvInt17 | int | 11 | 0 | NO | Reserved field 17_integer | |
| rsrvInt18 | int | 11 | 0 | NO | Reserved field 18_integer | |
| rsrvInt19 | int | 11 | 0 | NO | Reserved field 19_integer | |
| rsrvInt20 | int | 11 | 0 | NO | Reserved field 20_integer | |
| rsrvInt21 | int | 11 | 0 | NO | Reserved field 21_integer | |
| rsrvInt22 | int | 11 | 0 | NO | Reserved field 22_integer | |
| rsrvInt23 | int | 11 | 0 | NO | Reserved field 23_integer | |
| rsrvInt24 | int | 11 | 0 | NO | Reserved field 24_integer | |
| rsrvInt25 | int | 11 | 0 | NO | Reserved field 25_integer | |
| rsrvBlob | longtext | 0 | NO | Reserved field 1_longtext |

