Zero Stock Update
Summary of Changes: (The purpose of this table is to keep traceability and Product team to highlight the things that were changed into the scope, based on comments or discussions)
Version | Date | Created / Updated | Notes |
---|---|---|---|
v1.0 | 04.04.23 | Bogomil Pavlov | First publish |
v1.1 | 14.06.23 | Bogomil Pavlov | Product Status Update and Limit |
v1.2 | 16.06.23 | Danail Deltchev | Item close to NOT be blocking End Item scope fix |
Handle of Protect Quantity flag |
The purpose of this document is to describe how we update zero stock on Very.
API Call: PUT https://api-sl-2-2.custom-gateway.net/stock/availability
API Docs: https://developers-v2.custom-gateway.net/?shell#stock-apiMapping:
Very Field | Hemi Field | Comment | |
---|---|---|---|
sku |
Product > SKU | ||
data |
|||
quantity_available |
“0“ | Hardcoded as 0 |
Since we are not creating product via API and wont be having any additional calls which will get successfully created products the trigger for zero stock update will be Product Account > End Item = Pending or we have Product Account > Quantity = 0 and Product Account > Update Quantity = Pending
Sample Request:API Call: PUT https://api-sl-2-2.custom-gateway.net/stock/availabilityHeaders: Authorization Body:
[
{
"sku": "PTGON_DEMO_12",
"data": {
"quantity_available": 0
}
},
{
"sku": "PTGON_DEMO_2",
"data": {
"quantity_available": 0
}
}
]
Once we pick the product for stock update we want to set Product Account > End Item - Sent
Sample Response:
{
"errors": [
{
"sku": "PTGON_DEMO_12",
"data": {
"quantity_available": 0
},
"message": "Invalid SKU or barcode",
"code": 1
}
],
"successful": [
{
"id": 12034910,
"quantity_available": 0,
"last_modified": "2023-04-04 11:33:49"
}
]
}
In the response we will have each sku we have pushed and will be split into two nodes “errors“ and “successful“.
We can read both and update the products internally or we can read only the “errors“ and everything which is not specified in the errors as "sku"
to be treated as successful.
Basically we need to map the "sku"
against our Product > SKU and store the "message"
as error in Product Account > End Item Error and update Product Account > End Item - Error.
(v1.1)If there are not errors and we receive success we want to update Product Account > Update Quantity - Not Needed Product Account > End Item - Not Needed. Product Account > Product Status - Product Published Product Account > Listing Status - Inactive Also we want to store the Product > SKU as Product Account > ChannelItemID
Any Triggers or Validations that are not specifically mentioned, changed or removed from the above mentioned scope should follow the standard flor as per the Link Here abstraction.
Additional Information:
For this integration we will need to make sure the protect flags are working as expected:
Closed -will stop all the updates to the MPs besides End Item (end item should ALWAYS pass through, without any blockers) (v1.2)
Protect Quantity - will stop the quantity updates triggered by Update Quantity = Pending (v1.2)