/
Tata Cliq Update Inventory Flow

Tata Cliq Update Inventory Flow

 

 

  1. EshopboxInventoryService will listen to the Update Inventory Event From WMS and push it to TaskQueue which will be listened to by TataCliqInventoryListener, UpdateInventory event from WMS:

{ "inventoryList": [ { "productId": "12334", "parentId": null, "sku": "32CVB3GJA87", "variantId": 12334, "inventory": "24", "locationInventory": "12", "changeInStock": 0, } ], "account_id": 124, "account_slug": "Account Slug", "externalWmsChannelName": "External WMS ChannelName", "externalWmsAccount": "External WMS Account", "externalWarehouseID": "FSL4", "externalChannelID": "CH0566", "connectionId":"12", "channelSlug": null, "locationId": "3425567898876543456786", "publishedAt": "2020-07-21 19:49:47" }

2. Fetch accessToken from the cache and if not present then fetch it from Database using connectionId and store it in cache

Table used: ie_appinstall_connection

Query:

SELECT ie_appinstall_connection.accessToken FROM ie_appinstall_connection WHERE ie_appinstall_connection.id =:connectionId

Once the accessToken is generated store it into the Cache Memory in the format given below.

{ "connectionAccessToken_{{connectionId}}":"{{ACCESS TOKEN}}" }

 

POST API:-

https://intbatchqa5.tataunistore.com/PartnerConnect/PC_125050/AP_INVENTORY/AV_1.0/OG_1

Request Body:-

{ "InventoryUpdate": { "Item": [ { "SKU": "CSW6598", "SlaveID": "SHSR", "Inventory": "2000", "SafetyStock": "1000" }, { "SKU": "CSW659", "SlaveID": "SHSR", "Inventory": "2000", "SafetyStock": "1000" }, { "SKU": "CSW6598", "SlaveID": "SHSR", "Inventory": "2000", "SafetyStock": "0" } ] } }

3. Now transform the Data and Do the mapping as per the request body of Tata Cliq update inventory API

Tata Cliq Keys

Warehouse Keys

Tata Cliq Keys

Warehouse Keys

InventoryUpdate.Item[].SKU (Need to discuss)

inventoryList[].sku

InventoryUpdate.Item[].SlaveID

locationId

InventoryUpdate.Item[].Inventory

inventoryList[].locationInventory

InventoryUpdate.Item[].SafetyStock

need to be discussed

 

Now hit the Update Inventory API of Tata Cliq using below Request Body:-

{ "InventoryUpdate": { "Item": [ { "SKU": {{inventoryList[].sku}}, "SlaveID": {{externalWarehouseID}}, "Inventory": {{inventoryList[].locationInventory}}, "SafetyStock": {{?}} } ] } }

Response Body:-

{ "InventoryUpdate": { "Item": [ { "SELLERCODE": "Seller_ID", "PRODUCTSKU": "CSW6598", "STORECODE": "SHS", "PRODUCTSTOCK": "2000", "SAFTYSTOCKY": "1000", "STATUS": "FAIL TO UPLOAD", "REASON": "SLAVE INACTIVE OR DOESN'T EXIST." }, { "SELLERCODE": "Seller_ID", "PRODUCTSKU": "CSW6598", "STORECODE": "SHSR", "PRODUCTSTOCK": "2000", "SAFTYSTOCKY": "1000", "STATUS": "UPLOAD FAILED", "REASON": "PRODUCT DELISTED OR DOES NOT EXIST" }, { "SELLERCODE": "Seller_ID", "PRODUCTSKU": "CSW6598", "STORECODE": "SHSR", "PRODUCTSTOCK": "2000", "SAFTYSTOCKY": "0", "STATUS": "RECORD UPDATED", "REASON": "RECORD CORRECT" } ] } }

 

Related content