2. Request Signing
Signature Generation
- Serialize the business request parameters in
datato JSON. - Sort
apiKey,data(the serialized JSON), andtimestampin ascending, case-insensitive lexicographic order, then concatenate them. - Generate
signatureby applying HmacSHA256 to the concatenated string usingapiSecretas the key.
Complete request example:
Request URL:
plain
POST /OpenApi/V1/Sku/Sku/create?signature=xxxExample API secret: example-api-secret
Request body:
json
{
"apiKey": "FK_xxxxxxxxxxxxxxx",
"timestamp": "1704067200",
"data": {
"sku": "SKU123456",
"skuName": "Product name"
}
}After sorting and concatenation:
plain
FK_xxxxxxxxxxxxxxx{"sku":"SKU123456","skuName":"Product name"}1704067200Generated signature:
plain
1b3071729c62744ecbb6b36f8c09f88e2dffea863aeec67333a0d50528c3e62cNote:
- The
timestampfield is the request time as a 10-digit UNIX timestamp. The server rejects requests that are more than 5 minutes old.- Pass
signatureas a URL query parameter. Send the remaining parameters in the POST body.- Place all endpoint-specific request parameters described in this documentation, such as sku and skuName, inside the data object.