Marketplaces / VeePee Technical Scope / VeePee Product Management / VeePee Stock Update

VeePee 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)

Date Version Name Applied changes
13.02.23 1.0 Bogomil Pavlov First Publish
07.03.23 1.1 Bogomil Pavlov Remove the header parameter
28.03.23 1.2 Bogomil Pavlov Added better error response
28.03.23 1.3 Bogomil Pavlov Added a case when we have full update and quantity update at the same time
03.04.23 1.4 Bogomil Pavlov Response Reader Mapping added
06.04.2023 1.5 Bogomil Pavlov VeePee Status details added

The purpose of this document is to describe in details how we will send stock updates

Stock is shared for all different channels on the VeePee account.

API Call: {{BaseURL}}/stock

API Docs: https://pinkstaging.pink-connect.com/swagger#operation/uploadStock

We use the Incremetal Quantity set always as true as query parameter. (Default: true. When set to false, all products that don't come in the file will be set to 0 stock.)

You can generate a csv file (comma delimiter) and upload it via API. The file must have these headers:

  • gtin: The gtin of the product when it was created
  • stock: The amount of available stock for that product (Required)

Mapping:

Field Required Hemi Field Hemi Note
gtin Yes Product Account > Marketplace EAN

OR Product > EAN | Product Account > Marketplace EAN is with priority | | sku | Yes | Product > SKU | | | stock | Yes | Product Account> Quantity | |

We are able to send stock updates in two cases - once the product is active on the channel and once after we have already deactivated it and would want to send a positive stock.

We pick the offer for update as per abstraction - Stock Update general requirements

Example Response:

"INC_STOCK_20230215103536.csv"

After each successfully send feed for creation we need to store the filename which is returned from VeePee in the response and need to store it in Marketplace Feeds table. All products that are included in the feed need to be marked as Product Account > Update Quantity - Sent

VeePee Field Hemi Field Comment
FileName Marketplace Feed > External ID This field is used to get the response of the import.
Marketplace Feed > Account For which account is the feed generated.
Marketplace Feed > Type Hardcoded as “Listing Stock Update“
Marketplace Feed > Submitted Date When the feed is submitted
Marketplace Feed > Sent Objects Count How many products we have pushed in the feed

Please note we will also add the feed objects which after processing need to be removed.

Get the import status for a product import

API Call: {{BaseURL}}/status/{filename}

API Docs: https://pinkstaging.pink-connect.com/swagger#operation/getFileStatus

UPDATED: the change was successfully imported (we treat this as success)

SKIPPED: there was no change compared to the last feed (we treat this as success)

NOT FOUND: the reference does not exist in Pink Connect (we treat this as error)

ERROR: the data was not imported due to an error (we treat this as error)

Example pending response:

{
"status": "PENDING",
"result": "ok",
"errorList": [
"string"
]
}

Example success response:

{
    "status": "FINISHED",
    "result": "ok",
    "stats": "OFFER [ ERROR :0, UPDATED :2]",
    "errorList": []
}

Example error response #1:

{
    "status": "FINISHED",
    "result": "ok",
    "stats": "OFFER [ ERROR :2, UPDATED :0, SKIPPED :0, NOT_FOUND :0]",
    "errorList": [
        "line: 2 gtin: 123123123123213213213321 reason: Gtin: 123123123123213213213321 => Invalid stock value: \"a\" ",
        "line: 1 gtin: 1234567891013 reason: Gtin: 1234567891013 => Invalid stock value: \"b\" "
    ]
}

In order to store the errors on each item we need to map the GTIN on each line from the response against Product > EAN or Product Account > MP EAN (MP EAN is with priority) and store the error message which in this case is “Invalid stock value“ on the correct product account.

Example error response #2

{
    "status": "FINISHED",
    "result": "ok",
    "stats": "OFFER [ SKIPPED :0, UPDATED :0, NOT_FOUND :0, ERROR :0]",
    "errorList": []
}

We can receive an error without lines as well which we want to treat as full feed error and mark all products (feed objects) as error

Example error response #3

{
    "status": "FINISHED",
    "result": "ok",
    "stats": "OFFER [ SKIPPED :0, UPDATED :0, NOT_FOUND :0, ERROR :1]",
    "errorList": ["Format structure unknown"]
}

We can receive an error without lines as well which we want to treat as full feed error and mark all products (feed objects) as error with the relevant error message

Based on the response we need to map each product and we will have to update the products either with error or success as well as the Marketplace Feed > Status and Marketplace Feed > External Status. If the product stock update successfully and we do not receive and error in the errorList from the response we want to update: Product Account > Update Quantity - Not Needed

If we receive and error and the product stock is not update: Product Account > Update Quantity - Error Product Account > Update Quantity Error - store the relevant error message

Please note we do not want to Update the Product Account > Update Quantity field when we are doing full product update. We want to push the stock with the Full Product Update once and then with Product Account > Update Quantity if = 'pending'. This is required in order to be able to use the Protect Quantity in all flows.

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 Stock Update general requirements 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.

Is this article helpful?
0 0 0