Shein Stock Update
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 29.05.2024 | Bogomil Pavlov | First publish |
All validations, triggers and standardizations which are not mentioned here are as per: Stock Update general requirements
Shein support multiple warehouses which are set in their back office however we will need to download then in Hemi because the stock updates are per warehouse.
Get Warehouses
Shein stock structure is based on warehouses and if the seller has more than one warehouse we will have to specify in which warehouse we are updating the stock. To make this flexible and scalable we want to introduce a new field in Account Shein > Shein Location This way we can map the Shein Location for the relevant account.
API Call: GET **/open-api/msc/warehouse/list**
API Docs: https://open.sheincorp.com/documents/apidoc/detail/3000233-1000003
Body: N/A
Sample Request:
GET https://openapi.sheincorp.com**/open-api/msc/warehouse/list**
Sample Response:
{
"code": "0",
"msg": "OK",
"info": {
"list": [
{
"warehouseCode": "PS0618098174",
"warehouseName": "法国",
"saleCountryList": [
"FR"
],
"createType": 1,
"warehouseType": null,
"authServiceCode": null,
"authServiceName": null
}
]
},
"bbl": null
}
Mapping:
Shein Field | Hemi Field | Comment | ||
---|---|---|---|---|
code | N/A | |||
msg | N/A | |||
info | ||||
list | ||||
warehouseCode | Account Shein > Shein Location | We want to display the code but show the name in the UI. | ||
warehouseName | Account Shein > Shein Location | We want to display the code but show the name in the UI | ||
saleCountryList | Account Shein > Shein Location | Add them as a prefix of the warehouseName | ||
createType | N/A | |||
warehouseType | N/A | |||
authServiceCode | N/A | |||
authServiceName | N/A | |||
bbl | N/A |
Update Stock
The stock updates are per warehouse and we can update up to 100 skus into a single payload.
API Call: POST /open-api/gsp/goods/change-inventory
API Docs: https://open.sheincorp.com/documents/apidoc/detail/3000256-1000003
Body:
{
"systemName": "openapi",
"updateSkuInventoryQuantityRequests": [
{
"changeInventoryQuantity": 1,
"skuCode": "sMM24020556975769",
"warehouseCode": "Code1"
}
]
}
Sample request:
POST https://openapi.sheincorp.com**/open-api/gsp/goods/change-inventory
**
Body:
{
"systemName": "openapi",
"updateSkuInventoryQuantityRequests": [
{
"changeInventoryQuantity": 1,
"skuCode": "sMM240205569575769",
"warehouseCode": "Code1"
},
{
"changeInventoryQuantity": 12,
"skuCode": "sMM240205569745769",
"warehouseCode": "Code1"
},
{
"changeInventoryQuantity": 13,
"skuCode": "sMM240205569757369",
"warehouseCode": "Code1"
},
{
"changeInventoryQuantity": 14,
"skuCode": "sMM240205569752769",
"warehouseCode": "Code1"
},
{
"changeInventoryQuantity": 15,
"skuCode": "sMM240205569751769",
"warehouseCode": "Code1"
}
]
}
Request Mapping:
Shein Field | Required | Hemi Field | Comment | |
---|---|---|---|---|
systemName | Yes | "openapi” | Hardcoded as “openapi” | |
updateSkuInventoryQuantityRequests | ||||
changeInventoryQuantity | Yes | Product Account > Quantity | ||
skuCode | Yes | Product Account > Channel Item Id | ||
warehouseCode | No | Account Shein > Shein location | If a location is not mapped we want to return internal error |
Sample Response 200OK:
{
"code": "0",
"msg": "OK",
"info": null,
"bbl": null
}
Sample Error Response 200OK:
{
"code": "msc0008",
"msg": "sql execution error",
"info": null,
"bbl": null
}
{
"code": "msc0001",
"msg": "bad reqeust:JSON parse error: Unrecognized token 'asd': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false'); nested exception is com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'asd': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 4]",
"info": null,
"bbl": null
}
{
"code": "msc0001",
"msg": "bad reqeust:JSON parse error: Unrecognized token 'asdasd': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false'); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Unrecognized token 'asdasd': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 5, column: 41] (through reference chain: cn.dotfashion.soa.msc.vo.request.openapi.OpenWarehouseStockUpdateRequest[\"updateSkuInventoryQuantityRequests\"]->java.util.ArrayList[0])",
"info": null,
"bbl": null
}