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 |
The purpose of this document is to describe how we update 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 |
Product Account > Quantity |
Since we are not creating product via API and wont be having any additional calls which will get successfully created products the only trigger for stock update will be 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": 10
}
},
{
"sku": "PTGON_DEMO_2",
"data": {
"quantity_available": 12
}
}
]
Once we pick the product for stock update we want to set Product Account > Update Quantity - Sent We want to send at most 10 000 products in a single payload for update.
Sample Response:
{
"errors": [
{
"sku": "PTGON_DEMO_12",
"data": {
"quantity_available": 10
},
"message": "Invalid SKU or barcode",
"code": 1
}
],
"successful": [
{
"id": 12034910,
"quantity_available": 12,
"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 > Update Quantity Error and update Product Account > Update Quantity - Error.
(v1.1)If there are not errors and we receive success we want to update Product Account > Update Quantity - Not Needed Product Account > Product Status - Product Published Product Account > Listing Status - Active/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:
Protect Quantity (Stop all quantity updates) If Protect Quantity = Yes and Update Quantity = Pending - We skip the product
Closed -will stop all the updates to the MPs.