Marketplaces / Cdiscount / Cdiscount REST API Technical Scope [DRAFT] / Cdiscount Product Management / Offer Stock Update

Offer 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
22/11/2022 1.0 Bogomil Pavlov Initial Version

Submits an offer package

After we have successfully created an offer we can start updating the Stock by Submits an offer package request.

API Call: POST https://api.octopia-io.net/seller/v2/offer-integration-packages API Docs:https://developer.octopia-io.net/api-details#api=api-rest-seller-v2&operation=post-offer-integration-packages

Body: We specify the zip file url.

The name given to the Zip package has no importance. There is no specific norm.

The structure of the package must contain this tree structure necessarily.

  • Folder _rels containing the file .rels
  • Folder Content containing the file Offers.xml
  • File [Content_Types].xml

Download examples of package Light

Feed Mapping:

Cdiscount Field Integration Required Hemi Field Comment
Offer
SellerProductId Yes Product > SKU
ProductEan Yes Product Account Cdiscount > EAN

OR Product Account > Marketplace EAN OR Product > EAN | First priority is Product Account Cdiscount > EAN then Product Account > Marketplace EAN then Product > EAN | | | Stock | | Yes | Product Account > Quantity | | | OfferPackage.OfferPublicationList | | | | | | | | OfferPublicationList | | | | | | | | Id | No | Account Cdiscount > Country | If nothing is selected by default we pick France |

Sample Request: POST https://api.octopia-io.net/seller/v2/offer-integration-packages

Body:
"http://arcade.myhemisphere.com/.temp/cdiscount/upload/products/Products_2022-11-17_19-00-36.zip"

Sample Response:

{
 424325363619
}

Response Mapping:

After each successfully send feed for creation we will receive the packageId from the response and need to store it in Marketplace Feeds table.

Cdiscount Field Hemi Field Comment
packageId Marketplace Feed > External ID
Marketplace Feed > Account For which account is the feed generated.
Marketplace Feed > Type Hardcoded as “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
Marketplace Feed >ZIP Path The url of the zip
Marketplace Feed >Completed Date When we process the feed
Marketplace Feed >External Status External Feed status

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

Read Offer Package

API Call: GET https://api.octopia-io.net/seller/v2/offer-integration-packages[?packageId][&gtin][&pageIndex][&pageSize][&fields][&sort][&desc] API Doc: https://developer.octopia-io.net/api-details#api=api-rest-seller-v2&operation=get-product-integration-reports

Request parameters

Name Required Type Description
packageId true string Format - int64. Package identifier.
limit false integer Format - int32. Must be written as follows $limit
page false integer Format - int32. Must be written as follows $page

Sample Request: GET https://api.octopia-io.net/seller/v2/products-integration-reports?packageId=309592003&page=1&limit=50

Sample Response:

{
    "package_id": 309592003,
    "integration_state": "Integrated",
    "number_of_errors": 1,
    "offer_log_paged_list": [
        {
            "log_date": "2022-11-22T00:31:04.75+00:00",
            "offer_integration_status": "Integrated",
            "product_ean": "5056553233698",
            "seller_product_id": "96581",
            "property_list": [
                {
                    "log_message": "96581|5056553233698|MP60297644-0004|OK|9000|Offer updated|Cdiscount",
                    "property_code": "0",
                    "property_error": "90"
                }
            ]
        }
        ,
        {
            "log_date": "2022-11-22T08:57:08.12+00:00",
            "offer_integration_status": "Rejected",
            "product_ean": "5054697499253",
            "seller_product_id": "11806603270",
            "property_list": [
                {
                    "log_message": "11806603270|5054697499253||KO|3893|Données manquantes|Cdiscount",
                    "property_code": "93",
                    "property_error": "38"
                }
            ]
        }
    ],
    "seller_id": 51102,
    "page": 0,
    "count_by_page": 50,
    "total_logs_count": 2
}

Request Mapping:

Cdiscount Field Hemi Field Comment
package_id N/A
integration_state Marketplace Feed >External Status
number_of_errors N/A
offer_log_paged_list
log_date N/A
offer_integration_status N/A Based on this status we will know if the update of the SKU is successful or not
product_ean N/A
seller_product_id N/A This is our SKU which we will be using to map the response
property_list
log_message Product Account > Update Item Error

OR Product Account >Update Quantity Error OR Product Account >Update Price Error OR Product Account >End Item Error | Depends on the feed type we have pushed we will have to store the relevant message in the relevant field. | | | | property_code | N/A | | | | | property_error | N/A | | | seller_id | | | N/A | | | page | | | N/A | | | count_by_page | | | N/A | | | total_logs_count | | | N/A | |

In order to pick a product for stock and price update we must HAVE Product Account > Channel Item ID populated, the relevant flags set and Product Account > Listing Status = Active/Inactive Product Account > Product Status =Product published Product Account > Update Quantity = Pending

Once the product is picked for offer creation we will have: Product Account > Listing Status = Active/Inactive Product Account > Product Status =Product published Product Account > Update Quantity = Sent

When we read the response if successful we will update the product: Product Account > Listing Status = Active/Inactive Product Account > Product Status =Product published Product Account > Update Quantity = Not Needed

When we read the response if error we will update the product: Product Account > Listing Status = Active/Inactive Product Account > Product Status =Product published Product Account > Update Quantity = Error

And store the relevant error message in Product Account > Update Quantity Error

Limits:

There is a a limit of 200 000 offers in a package but I think in order to have better performance we can set a limit of 50 000 or 100 000 offers per package.

Additional Information:

For this integration we will need to make sure the protect flags are working as expected:

Protect Quantity - We can exclude the quantity from the payload when we are doing updates so we do not add the quantity in the payload when have Protect Quantity raised

Protect Price - We can exclude the price from the payload when we are doing updates so we do not add the price in the payload when have Protect Price raised.

Protect the whole item - We update the quantity only.

Closed -will stop all the updates to the MPs apart from the end item (send 0 stock update);

Is this article helpful?
0 0 0