Marketplaces / Showroom Prive Technical Scope / Showroom Prive Product & Offer management / Showroom Prive Create Products

Showroom Prive 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
1.0 First Publish

The purpose of this document is to detailed describe the flow of creating product.

In order to create a product we will need to make couple of API Calls, which are POST P41 ( Import products to the operator information system), GET P42 (Get the import status for a product import) , GET P44 (Get the error report file for a product import), GET P47 (Get the transformation error report file for a product import)

How to handle variations in MIRAKL

The way we treat a product as a Variation is when we have Product Account > Variation Group populated. Each Product Account in Hemi can have Item Specifics and Variation Specifics which we validate the same way against the MIRAKL taxonomy but we use them only in certain cases.

If we DO NOT HAVE Product Account > Variation Group:

We use only the Item Specifics from the product if any Variation Specifics are also populated we ignore them

If we HAVE Product Account > Variation Group:

We use all of the Variation Specifics and all of the Item Specifics. If there are no Variation Specifics we should return an error. If we have the same attribute added as a Variation Specific and as a Item Specific we pick it only from the Variation Specifics.

Please note we do not need to select all variants if only one them is set for revision or creation because they goes as separate products on MIRAKL and the only thing which associate them is the {{TBA}} So we can add variants to a variation group only by specifying the correct {{TBA}} If we want to remove a product from a variation we need to push the product for update again without the {{TBA}}

  • POST P41 - Import products to the operator information system {{TBA}}

API Call: /api/products/imports

API Docs: {{TBA}}

Complete flow:

In order to push products for creation we should have:

Product status = Awaiting Creation ; Listing Status **= Inactive; List/Update the whole item= Pending**

If we successfully pick a product for creation, we will have following statuses:

Product status -Awaiting Creation ; Listing Status - Inactive; List/Update the whole Item = Sent

If the internal product validation is not successful and we receive an error, we will set following statuses and store the relevant error message in Item Account > Update Item Error:

Product status = Awaiting Creation ; Listing Status=Inactive; List/Update the whole item= Error

If we receive success after performing P42 (when we send product to MIRAKL & When both "has_error_report" and "has_transformation_error_report" are equal to “false“ ) we can proceed to following:

Product status -Product Created ; Listing Status - Inactive; List/Update the whole Item = Pending

There will be two cases how to handle channel item ids in MIRAKL depends on the type. The first case is after successful product creation we need to fill the Channel Item ID, which will be the SKU. The second option is to use P31 Get products for a list of product references which will map the SKUs between Hemi and MIRAKL and store the MIRAKL id as Channel Item ID. For {{TBA}} integration we will go for {{TBA}}

If we receive an error (any of "has_error_report" and "has_transformation_error_report" are equal to “true“):

Product status -Awaiting Creation ; Listing Status - Inactive; List/Update the whole Item = Error

And we need to store the relevant error message into the Product Account >Update Item Error.

Parameter Notes Required
File Import file (CSV or XML or XLSX) to upload. Use multipart/form-data with name file Yes
operator_format Force the use of the operator product format
No

Note: Every time we send products for creation we have to do internal check if all required attributes are part of the the product as Item Specifics or Variation Specifics according to their taxonomy which we download and store on the instance.

The file which we will import must be an xml file with the following structure:

Example File:

PIM_14538-example.xml

{{TBA}}

Mapping: Please note N/A means we exclude it from the payload.

Mirakl Field Mirakl Notes Integration Required Hemi Field Comment

Example Response:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<product_import_tracking>
    <import_id>2035</import_id>
</product_import_tracking>

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.

Mirakl Field Hemi Field Comment
import_id Marketplace Feed > External ID
Marketplace Feed > Account For which account is the feed generated.
Marketplace Feed > Type Hardcoded as “Listing Create“
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 P42 -Get the import status for a product import

API Call: /api/products/imports/{import}

API Docs: https://marketplace.kingfisher.com/help/api-doc/seller/mmp.html#P42

Example response:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<product_import_tracking>
    <import_id>2005</import_id>
    <date_created>2019-04-05T12:56:21Z</date_created>
    <has_error_report>false</has_error_report>
    <has_new_product_report>false</has_new_product_report>
    <has_transformation_error_report>false</has_transformation_error_report>
    <has_transformed_file>true</has_transformed_file>
    <import_status>SENT</import_status>
    <shop_id>2000</shop_id>
    <transform_lines_in_error>0</transform_lines_in_error>
    <transform_lines_in_success>1</transform_lines_in_success>
    <transform_lines_read>1</transform_lines_read>
    <transform_lines_with_warning>0</transform_lines_with_warning>
</product_import_tracking>

Depends on the response of: "has_error_report" and "has_transformation_error_report" we will need to call each of the error reports if we receive "true". Also if we already have the item pushed into another feed from the same type we remove it from the objects (table 2511) and need to add it in the latest sent feed. Via this way we wont read any old or previous responses for the particular SKU.

When both "has_error_report" and "has_transformation_error_report" are equal to “false“ is the success case (Import status = Completed) and we could proceed to creating and offer to this product.

If we receive success (When both "has_error_report" and "has_transformation_error_report" are equal to “false“ ) we can proceed to following:

Product status -Product Created ; Listing Status - Inactive; List/Update the whole Item = Pending

If we receive an error (any of "has_error_report" and "has_transformation_error_report" are equal to “true“):

Product status -Awaiting Creation ; Listing Status - Inactive; List/Update the whole Item = Error

And we need to store the relevant error message into the Product Account >Update Item Error.

  • GET P44 - Get the error report file for a product import

We need to perform this call if we receive has_error_report = true, into the response from P42;

API Call: API Call: /api/products/imports/{import}/error_report

API Docs: {{TBA}}

Basically, we read the report and we extract the SKU column. After that we compare the Errors columns and we need to store them.

Also, the record for the SKUs that have matched need to be removed from Marketplace Feed Object table.

We will consider Warning=Success in the integration (it is kind of standard on every MIRAKL)

Sample file

product-import-errors-file-20220929110013 (1).csv

  • GET P47 - Get the transformation error report file for a product import

This call returns if the import is successful and how may warnings and errors we have in the file. We need to call this if we receive has_transformation_error_report = true

API Call: /api/products/imports/{import}/transformation_error_report

API Docs: {{TBA}}

Sample file - To be added

  • GET P31 - Get products for a list of product references

    API Call: /api/productsAPI Docs:{{TBA}}

    Sample Request: API call: GET {{TBA}} We will be using the EAN in order to obtain the product Ids. Please note we can specify many product_references in single request like:{{TBA}}

    Samples Response:

    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <body>
        <total_count>1</total_count>
        <products>
            <product>
                <category_code>5110114</category_code>
                <category_label>Coffee Machines</category_label>
                <product_id>9312432012041</product_id>
                <product_id_type>EAN</product_id_type>
                <product_sku>MKP100000000037254</product_sku>
                <product_title>Breville Cafe Roma Stainless Espresso/Cappuccino Machine-ESP8C</product_title>
            </product>
        </products>
    </body>
    

    From the response we get the product_id and store it as Product Account > Channel Item ID.

Additional Information:

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

Protect Quantity (Stop all quantity updates) - Applicable for already created offers. If the offer is not created this flag is ignored. If Protect Quantity = Yes and Update Quantity = Pending - We skip the product If Protect Quantity = Yes and Update Price= Pending - We pick the product only for price update and do NOT include the quantity in the payload If Protect Quantity = Yes and List/Update the Whole Item = Pending - We pick the product for full update but do NOT include the quantity in the payload

Protect Price (Stop all price updates) -Applicable for already created offers. If the offer is not created this flag is ignored. If Protect Price = Yes and Update Quantity = Pending -We pick the product only for stock update and do NOT include the prices in the payload If Protect Price = Yes and Update Price= Pending - We skip the product If Protect Price = Yes and List/Update the Whole Item = Pending - We pick the product for full update but do NOT include the prices in the payload

Protect the whole item - (Stop all product updates apart from Quantity) -Applicable for already created offers. If the offer is not created this flag is ignored. If Protect the whole item = Yes and Update Quantity = Pending -We send the quantity only If Protect the whole item = Yes and Update Price= Pending - We skip the product If Protect the whole item = Yes and List/Update the Whole Item = Pending - We skip the product

Closed -will stop all the updates to the MPs apart from the end item (send 0 stock update). This flag applies for all products the ones which are created and all new products.

Is this article helpful?
0 0 0