/
Ajio Dropship Update Inventory Flow

Ajio Dropship Update Inventory Flow

 

Step 1. Listen to the WMS Inventory Event which will look like below and push it into TaskQueue:

{ "account_slug": "spykar", "account_id": 142.0, "externalWmsAccount": "eshopbox", "publishedAt": "2022-06-09 14:12:19", "message_id": "202206091410017674", "inventoryList": [ { "productId": "JEAFMSRHYSUHZGFH", "parentId": "ALI-02AI-004_DARK BLUE", "sellerSku": "8907966153394", "sku": "BBAPLSK154653_32", "variantId": "002211", "inventory": "7", "changeInStock": -1.0, "locationInventory": 3.0, "locationId": "POB1" }, { "productId": "JEAFMSRHYSUHZGFH", "parentId": "ALI-02AI-004_DARK BLUE", "sellerSku": "8907966153394", "sku": "BBAPLSK154653_32", "variantId": "2221122000000000", "inventory": "7", "changeInStock": -1.0, "locationInventory": 3.0, "locationId": "POB1" }, { "productId": "JEAFMSRHYSUHZGFH", "parentId": "ALI-02AI-004_DARK BLUE", "sellerSku": "8907966153394", "sku": "BBAPLSK154653_32", "variantId": "F12133123", "inventory": "7", "changeInStock": -1.0, "locationInventory": 3.0, "locationId": "POB1" } ], "message": "GOOD_INVENTORY_UPDATE", "externalWmsChannelName": "AJIO_SPYKAR_ZMUM_2022", "externalWarehouseID": "Eshopbox_Mumbai", "connectionId": 294.0, "locationId": "POB1", "externalChannelID": "CH1286" }

Step 2. Now Extract the connectionIdfrom the WMS Inventory Event and fetch the AccessToken that will be used to Push Inventory to Ajio

SQL Query:

SELECT ie_appinstall_connection.inputFields, ie_appinstall_connection.accessToken FROM ie_appinstall_connection WHERE id =:{{connectionId}}

Cache: We need to save the following in Cache memory so that we don’t have to make SQL Queries frequently.

  • Key: “AjioConnectionData_{{connectionID}}“

inputFields

accessToken

inputFields

accessToken

{"username":"abc123", "password":"123##"}

{{token String}}

Step 3. Now we need to prepare the Required Request Body that needs to be pushed to Ajio. Ajio Inventory Update API can take upto 50 SKUs at once, so we can prepare a batch of 10 SKUs or 20 SKUs at once and then we can push the inventory in bulk.

Ajio Inventory Update API Keys

Eshopbox Inventory Event Keys

inventoryList[].inventory

inventoryList[].locationInventory

inventoryList[].productId

inventoryList[].productId ? (Not confirm)

inventoryList[].variantId

inventoryList[].variantId

Step 4. Now, once the Request Body has been prepared, we need to make HTTP Post Request.

POST API:

https://api-seller.services.ajio.com/updateInventory

Request Body:

{ "inventoryList": [ { "inventory": "{{inventoryList[].locationInventory}}", "productId": "{{inventoryList[].productId}}", "variantId": "{{inventoryList[].variantId}}" } ] }

Response:

{     "status": "enum (SUCCESS, FAILED)",     "failedProductList": [         {             "productId": "string",             "variantId": "string",             "message": "string"         }     ] }

 

Related content