Marketplaces / Cdiscount / Cdiscount REST API Technical Scope [DRAFT] / Cdiscount Product Management / Create Products

Create Products

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

Submit Product Package

In order to create a product on Cdiscount we have to generate a JSON payload which contains the product information. After submitting we will receive a packageId which we use with the response reader.

API Call: https://api.octopia-io.net/seller/v2/products-integration API Doc: https://developer.octopia-io.net/api-details#api=api-rest-seller-v2&operation=post-products

Sample Request:

{
    "products": [{
        "attributes": [{
            "files": ["https://media.pdf"],
            "propertyReference": "24077",
            "values": ["Electrique", "Batterie"]
        }],
        "brand": "My brand",
        "categoryCode": "010201",
        "description": "My description",
        "gtin": "1234567890128",
        "gtinReference": "8210987654321",
        "sellerPictureUrls": [{
            "index": 1,
            "url": "https://static.education.francetv.fr/media/img/hd/img.gif"
        }],
        "sellerProductReference": "AGRA39401",
        "title": "My title"
    }]
}

Request Mapping:

Sample Response:

CDiscount Field Integration Required Hemi Field Comments
products
attributes No
files No
propertyReference No
values No
brand No
categoryCode No
description No
gtin No
gtinReference No
sellerPictureUrls No
index No
url No
sellerProductReference No
title No
{
    "packageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

Response Mapping:

After each successfully send feed for creation we will receive the feed id 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 “Create Products“
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 Product Package

API Call: GET https://api.octopia-io.net/seller/v2/products-integration-reports[?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 The package identifier
gtin false integer The gtin
pageIndex false integer The index of the page (Minimum: 1)
pageSize false number The pageSize parameter is a positive integer that allows you to limit the number of items per page.
fields false string The fields to display (By default all fields are displayed)
sort false string The sort parameter allows you to sort the response by the given field(s) which can be multiple and separated by commas.
desc false string The fields used to sort the items in descending order (By default not applied)

We will be using only the packageId, pageIndex and pageSize

Sample Request: GET https://api.octopia-io.net/seller/v2/products-integration-reports?packageId=878e0c18-97b2-4227-b5fb-fdcbbf748592&pageIndex=1&pageSize=50

Sample Response:

In order to pick a product for creation we must NOT HAVE Product Account > Channel Item ID populated, the relevant flags set and Product Account > Listing Status = Inactive Product Account > Product Status =Product not created Product Account > List / Update the Whole Item = Pending

Once the product is picked for creation and validated against the taxonomy we will have: Product Account > Listing Status = Inactive Product Account > Product Status =Product not created Product Account > List / Update the Whole Item = Sent

When we read the response if successful we will populate the Product Account > Channel Item ID and update the product: Product Account > Listing Status = Inactive Product Account > Product Status =Product created Product Account > List / Update the Whole Item = Pending

When we read the response if error we WONT populate the Product Account > Channel Item ID and update the product: Product Account > Listing Status = Inactive Product Account > Product Status =Product not created Product Account > List / Update the Whole Item = Error With the relevant error message in Product Account > Update Item 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