Skip to content

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 ​

IconDescription
image-20241009234535076Information indicated with this icon should be paid special attention to by the reader
image-20241009230539176Information 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 ​

TermExpanded formDescription
APWireless Access PointESL control
APIApplication Programming InterfaceA 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
ESLElectronic Shelf LabelESL
PriSmartPriSmart Smart Retail SystemManages 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:

  1. Succeed
json
http status: 200 
return content:
{
"access_token":eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxNzMxNTc5MzE1NzM0MzE1MDA4, 
"token_type": "Bearer"
}
  1. 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:

NameTypeLengthDecimalRequiredSample ValueDescription
skuvarchar1280YES1SKU
itemNamevarchar2560YESAppleProduct name
price1decimal114YES12.9Retail price
itemShortNamevarchar1280NOProduct short name
freshItemCodevarchar1280NOFresh food ID
eanvarchar20480YES6901028071468Product barcode
itemStatusvarchar1280NOProduct status
brandvarchar1280NOhead-shouldersBrand
unitvarchar1280NOUnit
saleModevarchar1280NOSale mode
placeOfOriginvarchar1280NOUSAPlace
specificationvarchar1280NO125g x 5Specification
qrCodevarchar2560NOwww.hanshows.com/id=QR code
packSizeint110NO24Pack size
gradevarchar1280NOQualifiedGrade
descriptiontext00NOProduct description/notes
level1CategoryCodeint110NO2Level1 category code
level1CategoryNamevarchar1280NOFoodLevel1 category name
level2CategoryCodeint110NO201Level2 category code
level2CategoryNamevarchar1280NOSnack foodLevel2 category name
level3CategoryCodeint110NO20103Level3 category code
level3CategoryNamevarchar1280NOSweetLevel3 category name
level4CategoryCodeint110NO2010301Level4 category code
level4CategoryNamevarchar1280NOHard candyLevel4 category name
level5CategoryCodeint110NO201030102Level5 category code
level5CategoryNamevarchar1280NOFruit-flavored hard candyLevel5 category name
supevisedByvarchar1280NOSupervised by
supervisionHotlinevarchar1280NOSupervision hotline
pricingStaffvarchar1280NOPricing staff 1Pricing staff
price1Descriptionvarchar1280NORetail priceRetail price description
price2decimal114NO11.9Promotion price
price2Descriptionvarchar1280NOPromotion pricePromotion price description
price3decimal114NO10.9Member price
price3Descriptionvarchar1280NOmember priceMember price description
price4decimal114NO9.9Other price
price4Descriptionvarchar1280NOPrice spikeOther price description
price5decimal114NO13.5Market retail price
price5Descriptionvarchar1280NOMarket priceMarket retail price Description
price6decimal114NODiscount price
price6Descriptionvarchar1280NODiscount price description
promoDateFromdatetime30NOPromotion date from
promoDateTodatetime30NOPromotion date to
promoTimeFromtime00NOPromotion time from
promoTimeTotime00NOPromotion time to
vipDateFromdatetime30NOVIP date from
vipDateTodatetime30NOVIP date to
vipTimeFromtime00NOVIP time from
vipTimeTotime00NOVIP time to
promoReasontext00NOPromotion reason
promoFlagint110NOPromotion flag
inventorydecimal114NOInventory quantityInventory
safetyStockdecimal114NOSafety stock
dmsdecimal114NO8.3Daily sales
todaySalesQtydecimal114NO2.1Today sales quantity
cumulatedSalesQtydecimal114NO502.5Cumulated sales quantity
shelfQtydecimal114NO25Shelf quantity
shelfCodevarchar1280NOShelf number/ product location number
shelfTiervarchar1280NOShelf layer
shelfColumnvarchar1280NOShelf column
displayLocationvarchar1280NOHH-CC-LLDisplay location
supplierCodevarchar1280NOSupplier code
supplierNamevarchar1280NOSupplier name
onOrderQtydecimal114NOOn order quantity
expiryDatedate00NOMay 2, 2017Expiry date
storageLifevarchar1280NO180 days 1 yearStorage life
shelfLifeint110NOShelf life
ingredientTabletext00NOIngredient table
manufacturervarchar1280NOManufacturer name
manufacturerAddressvarchar2560NOManufacturer address
memberPointsdecimal114NO15Member points
rsrvTxt1varchar2560NOReserved field 1_text
rsrvTxt2varchar2560NOReserved field 2_text
rsrvTxt3varchar2560NOReserved field 3_text
rsrvTxt4varchar2560NOReserved field 4_text
rsrvTxt5varchar2560NOReserved field 5_text
rsrvTxt6varchar2560NOReserved field 6_text
rsrvTxt7varchar2560NOReserved field 7_text
rsrvTxt8varchar2560NOReserved field 8_text
rsrvTxt9varchar2560NOReserved field 9_text
rsrvTxt10varchar2560NOReserved field 10_text
rsrvTxt11varchar2560NOReserved field 11_text
rsrvTxt12varchar2560NOReserved field 12_text
rsrvTxt13varchar2560NOReserved field 13_text
rsrvTxt14varchar2560NOReserved field 14_text
rsrvTxt15varchar2560NOReserved field 15_text
rsrvTxt16varchar2560NOReserved field 16_text
rsrvTxt17varchar2560NOReserved field 17_text
rsrvTxt18varchar2560NOReserved field 18_text
rsrvTxt19varchar2560NOReserved field 19_text
rsrvTxt20varchar2560NOReserved field 20_text
rsrvTxt21varchar2560NOReserved field 21_text
rsrvTxt22varchar2560NOReserved field 22_text
rsrvTxt23varchar2560NOReserved field 23_text
rsrvTxt24varchar2560NOReserved field 24_text
rsrvTxt25varchar2560NOReserved field 25_text
rsrvDec1decimal114NOReserved field 1_decimal
rsrvDec2decimal114NOReserved field 2_decimal
rsrvDec3decimal114NOReserved field 3_decimal
rsrvDec4decimal114NOReserved field 4_decimal
rsrvDec5decimal114NOReserved field 5_decimal
rsrvDec6decimal114NOReserved field 6_decimal
rsrvDec7decimal114NOReserved field 7_decimal
rsrvDec8decimal114NOReserved field 8_decimal
rsrvDec9decimal114NOReserved field 9_decimal
rsrvDec10decimal114NOReserved field 10_decimal
rsrvDec11decimal114NOReserved field 11_decimal
rsrvDec12decimal114NOReserved field 12_decimal
rsrvDec13decimal114NOReserved field 13_decimal
rsrvDec14decimal114NOReserved field 14_decimal
rsrvDec15decimal114NOReserved field 15_decimal
rsrvDec16decimal114NOReserved field 16_decimal
rsrvDec17decimal114NOReserved field 17_decimal
rsrvDec18decimal114NOReserved field 18_decimal
rsrvDec19decimal114NOReserved field 19_decimal
rsrvDec20decimal114NOReserved field 20_decimal
rsrvDec21decimal114NOReserved field 21_decimal
rsrvDec22decimal114NOReserved field 22_decimal
rsrvDec23decimal114NOReserved field 23_decimal
rsrvDec24decimal114NOReserved field 24_decimal
rsrvDec25decimal114NOReserved field 25_decimal
rsrvInt1int110NOReserved field 1_integer
rsrvInt2int110NOReserved field 2_integer
rsrvInt3int110NOReserved field 3_integer
rsrvInt4int110NOReserved field 4_integer
rsrvInt5int110NOReserved field 5_integer
rsrvInt6int110NOReserved field 6_integer
rsrvInt7int110NOReserved field 7_integer
rsrvInt8int110NOReserved field 8_integer
rsrvInt9int110NOReserved field 9_integer
rsrvInt10int110NOReserved field 10_integer
rsrvInt11int110NOReserved field 11_integer
rsrvInt12int110NOReserved field 12_integer
rsrvInt13int110NOReserved field 13_integer
rsrvInt14int110NOReserved field 14_integer
rsrvInt15int110NOReserved field 15_integer
rsrvInt16int110NOReserved field 16_integer
rsrvInt17int110NOReserved field 17_integer
rsrvInt18int110NOReserved field 18_integer
rsrvInt19int110NOReserved field 19_integer
rsrvInt20int110NOReserved field 20_integer
rsrvInt21int110NOReserved field 21_integer
rsrvInt22int110NOReserved field 22_integer
rsrvInt23int110NOReserved field 23_integer
rsrvInt24int110NOReserved field 24_integer
rsrvInt25int110NOReserved field 25_integer
rsrvBloblongtext0NOReserved field 1_longtext

Technical documentation by Smart Label Solutions Inc.