Post Inventory Update

This REST API is used to post changes in live inventory happening in Uniware to the markeplace. This method posts changes for only those SKUs whose inventory value has changed since last update.

Tip

It is recommended to check out Notes for the reader. You might find this helpful as it contains Guidelines for using API references and Terminologies used here.

Flow

Inventory Flow

Tip

Complete integration flow is available on Basic Overview page.

Basic Information

NAME DETAILS
Usage: Mandatory
Frequency: 10 minutes to post any inventory changes done on Uniware
2 minutes to post any inventory going out-of-stock on Uniware
Endpoint: /updateInventory
Request Type: POST
Scheme: HTTPS
Header (Content-Type): application/json
Header (apiKey): accessToken (got from Get Authentication)

Request Payload

{
  "inventoryList": [
    {
      "productId": "string",
      "variantId": "string",
      "inventory": "10",
      "hsnCode": "string",
      "facilityCode": "string"
    }
  ]
}

Request Payload Details

LEVEL PARAMETER TYPE DESCRIPTION MANDATORY NOTES
1 inventoryList - - - -
1.1 productId string Product ID of the product for which Inventory needs to be updated Yes -
1.2 variantId string Variant ID of the product for which Inventory needs to be updated Yes -
1.3 inventory string The stock count which needs to be updated on the Marketplace Yes -
1.4 hsnCode string 6 digit uniform code that classifies products worldwide No -
1.5 facilityCode string Channel wh code based on the Location Mapping at the channel connectors by the seller No -

Response Payload

Following is the schema defined for the product resource in Unicommerce system. Which means this includes superset of all the fields and types that define a product for the Unicommerce. The partner is expected to follow this schema for each product information, to complete the transaction successfully.

{
  "status": "SUCCESS",
  "failedProductList": [
    {
      "productId": "string",
      "variantId": "string",
      "message": "string"
    }
  ]
}

Response Payload Details

LEVEL PARAMETER TYPE DESCRIPTION MANDATORY NOTES
1 status string Status of the request Yes Allowable: SUCCESS, FAILED
2 failedProductList list Required for bulk update, when inventory update for some products got failed - -
2.1 productId string Product ID of the products whose inventory update fails Yes Eg: 54353
2.2 variantId string Variant ID of the products whose inventory update fails Yes Eg: 54353-2
2.3 message string Reason for failure Yes Eg: Mismatch

Error Codes

Refer Response Codes section to know about specific errors codes.

FAQs/Notes

Q1. In this API’s Response Payload, what does Partial Success status mean?
Ans. Since inventory list is a list type, we can update the inventory status of more than one SKU at a time so it may be that some of these SKUs have successfully updated inventory count but some may not have which are then provided as the failed product list. Use SUCCESS status to handle the partial success cases also.

Q2. When is this API called?
Ans. It will be called for inventory delta basis. It posts changes for only those SKUs whose inventory value has changed since last update.

Q3. From where does this API pick the inventory count? What is the time difference after which the inventory sync is running at UC?
Ans. Inventory Sync takes place every 10 minutes. For out of stock scenarios, it happens under 2 minutes. Inventory Count is picked from the seller account on the particular MP.

Q4. Why is there a partial success error message, when all inventory updates will be for each SKU ID?
Ans. Partial Success use case is when any of the combination of Product ID and the Variant ID in the Request Payload array Post Inventory Update fails to get updated at the MP’s end.

Q5. This API has a facility parameter. If any merchant is selling from multiple locations(warehouse/facility), and both have different quantities, then how can UC send this information to the MP?
Ans. UC will send the MP the updates for that particular SKU for all the locations that the seller has added them to in our system at channel connetore mapping. e.g. {“inventoryList”:[{“facilityCode”:“ChWhCode”,“productId”:“979”,“variantId”:“4726”,“inventory”:“514”}]},

Unicommerce Website

Copyright © 2022 Unicommerce eSolutions Pvt. Ltd.