Marketplaces / Debenhams Abstraction Technical Scope / Debenhams Product & Offer management / Debenhams Create Products

Debenhams 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
03/08/2023 1.0 Hristiyan Georgiev First Publish
13/09/2023 1.1 Hristiyan Added logic for Parent Product ID
13/09/2023 1.2 Hristiyan Added additional logic for returns swatch and details and care

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 parent_product_id So we can add variants to a variation group only by specifying the correct parent_product_id If we want to remove a product from a variation we need to push the product for update again without the parent_product_id

  • POST P41 - Import products to the operator information system

API Call: /api/products/imports

API Docs: https://help.mirakl.net/help/api-doc/seller/mmp.html#P41

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 "error_report" and "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 Debenhams integration we will go for **option1

If we receive an error (any of "error_report" and "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:

men-clothing-mens_hoodies_and_sweatshirts-example.xml

<?xml version='1.0' encoding='UTF-8'?>
<import>
  <products>
    <product>
      <attribute>
        <code>product_category</code>
        <value>men-clothing-mens_hoodies_and_sweatshirts</value>
      </attribute>
      <attribute>
        <code>parent_product_id</code>
        <value/>
      </attribute>
      <attribute>
        <code>product_id</code>
        <value/>
      </attribute>
      <attribute>
        <code>ean</code>
        <value/>
      </attribute>
      <attribute>
        <code>collection</code>
        <value/>
      </attribute>
      <attribute>
        <code>product_title</code>
        <value/>
      </attribute>
      <attribute>
        <code>long_description</code>
        <value/>
      </attribute>
      <attribute>
        <code>details_and_care</code>
        <value/>
      </attribute>
      <attribute>
        <code>colour</code>
        <value/>
      </attribute>
      <attribute>
        <code>colourfacet</code>
        <value/>
      </attribute>
      <attribute>
        <code>fabrication_type</code>
        <value/>
      </attribute>
      <attribute>
        <code>gender</code>
        <value/>
      </attribute>
      <attribute>
        <code>main_image</code>
        <value/>
      </attribute>
      <attribute>
        <code>image_(additional_1)</code>
        <value/>
      </attribute>
      <attribute>
        <code>image_(additional_2)</code>
        <value/>
      </attribute>
      <attribute>
        <code>image_(additional_3)</code>
        <value/>
      </attribute>
      <attribute>
        <code>image_(additional_4)</code>
        <value/>
      </attribute>
      <attribute>
        <code>image_(additional_5)</code>
        <value/>
      </attribute>
      <attribute>
        <code>swatch</code>
        <value/>
      </attribute>
      <attribute>
        <code>returns</code>
        <value/>
      </attribute>
      <attribute>
        <code>ethics</code>
        <value/>
      </attribute>
      <attribute>
        <code>sustainability_detail</code>
        <value/>
      </attribute>
      <attribute>
        <code>design_clothingacc</code>
        <value/>
      </attribute>
      <attribute>
        <code>detail_clothingacc</code>
        <value/>
      </attribute>
      <attribute>
        <code>fabrication_clothingacc</code>
        <value/>
      </attribute>
      <attribute>
        <code>multipack</code>
        <value/>
      </attribute>
      <attribute>
        <code>occasion_mensclothingacc</code>
        <value/>
      </attribute>
      <attribute>
        <code>range_mensclothingacc</code>
        <value/>
      </attribute>
      <attribute>
        <code>activity</code>
        <value/>
      </attribute>
      <attribute>
        <code>design_type</code>
        <value/>
      </attribute>
      <attribute>
        <code>category2_hoodiessweatshirts</code>
        <value>Hoodies &amp; Sweatshirts</value>
      </attribute>
      <attribute>
        <code>fit_tops</code>
        <value/>
      </attribute>
      <attribute>
        <code>length_tops</code>
        <value/>
      </attribute>
      <attribute>
        <code>neckline_hoodiessweatshirts</code>
        <value/>
      </attribute>
      <attribute>
        <code>shape_hoodiessweatshirts</code>
        <value/>
      </attribute>
      <attribute>
        <code>size_mens</code>
        <value/>
      </attribute>
      <attribute>
        <code>sleeve_length</code>
        <value/>
      </attribute>
      <attribute>
        <code>style_hoodiessweatshirts</code>
        <value/>
      </attribute>
      <attribute>
        <code>wash</code>
        <value/>
      </attribute>
    </product>
  </products>
  </import>

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

Mirakl Field Mirakl Notes Integration Required Hemi Field Comment
product_category Product Category Yes Product Account > Primary Category ID
parent_product_id Parent Product ID Yes <v1.1>Product Account > Variation Group

OR Product > SKU | As this field is mandatory we want to have a logic and if the Product Account > Variation Group is not populated and we are listing single product to get the Product > SKU</v1.1> | | product_id | Product ID | Yes | Product > SKU | | | ean | Product EAN | Yes | Product > EAN | | | collection | Brand - if your brand is not available contact Marketplace Team to set up | Yes | Product Account > Item Specifics OR Product > Brand | Product Account > Item Specifics is with priority. | | product_title | Product Title | Yes | Product Account > Title | | | long_description | Long Description | Yes | Product Account > Description | | | details_and_care | Details and Care | Yes | <v1.2>Product Account > Item Specifics OR Product Account Debenhams > Details and Care | Product Account > Item Specifics is with priority.</v1.2> | | colour | Colour | Yes | Product Account > Item Specifics | | | colourfacet | Colour Facet | Yes | Product Account > Item Specifics | | | fabrication_type | Fabrication Type | No | Product Account > Item Specifics | | | gender | Gender | Yes | Product Account > Item Specifics | | | main_image | Main Image - size is 1500 pixels high x 1000 pixels wide | Yes | Product > Main Image or Product Account Debenhams > Main Image | Product Account Debenhams > Main Image is with priority | | image_(additional_1) | Additional Image1 | No | Product > More Picture URLs or Product Account Debenhams > More Images | Product Account Debenhams > More Images is with priority | | image_(additional_2) | Additional Image2 | No | Product > More Picture URLs or Product Account Debenhams > More Images | Product Account Debenhams > More Images is with priority | | image_(additional_3) | Additional Image3 | No | Product > More Picture URLs or Product Account Debenhams > More Images | Product Account Debenhams > More Images is with priority | | image_(additional_4) | Additional Image4 | No | Product > More Picture URLs or Product Account Debenhams > More Images | Product Account Debenhams > More Images is with priority | | image_(additional_5) | Additional Image5 | No | Product > More Picture URLs or Product Account Debenhams > More Images | Product Account Debenhams > More Images is with priority | | swatch | Swatch - size 120 x 120 pixels (this is like a thumbnail photo) | Yes | <v1.2>Product Account > Item Specifics Product Account Debenhams > Swatch Image | Product Account > Item Specifics is with priority</v1.2> | | returns | Returns | Yes | <v1.2>Product Account > Item Specifics OR Product Account Debenhams > Returns | Product Account > Item Specifics is with priority </v1.2> |

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>
    <error_report>false</error_report>
    <has_new_product_report>false</has_new_product_report>
    <transformation_error_report>false</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: "error_report" and "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 "error_report" and "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 "error_report" and "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 "error_report" and "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 error_report = true, into the response from P42;

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

API Docs: https://help.mirakl.net/help/api-doc/seller/mmp.html#P44

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 transformation_error_report = true

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

API Docs: https://help.mirakl.net/help/api-doc/seller/mmp.html#P47

11998-err.xml

Additional Information:

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

Closed -will stop all the creation of the products to the MPs.

Is this article helpful?
0 0 0