Create Product
Create Product
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 | Applied changes |
---|---|---|
28/09/2022 | 1.0 | Initial version |
The purpose of this document is to describe in details the process of creating products on MIRAKL.
The specifics on MIRAKL are we must create a product first, and then we must create/send an offer for the already created 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 parentProductId
.
So we can add variants to a variation group only by specifying the correct parentProductId
.
If we want to remove a product from a variation we need to push the product for update again without the parentProductId
.
In order to create a product we will need to:
- POST P41 - Import products to the operator information system
API Call: /api/products/imports
Docs: https://decathlonbelgium-preprod.mirakl.ne/help/api-doc/seller/mmp.html#P41
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 according to their taxonomy which we download and store on the instance. Please note that for the Decathlon we will have only 5 categories that we will use! Also, there are no required attributes and values
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 (in order to be picked by Offer creation)
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 P44 (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
Аfter successful product creation we need to fill the Channel Item ID, which for MIRAKL integration is the SKU!
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.
Mapping - Products:
Documents:
products-en_GB-20220405122002.xlsx
<?xml version='1.0' encoding='UTF-8'?>
<import>
<products>
<product>
<attribute>
<code>category</code>
<value>100002</value>
</attribute>
<attribute>
<code>ProductIdentifier</code>
<value/>
</attribute>
<attribute>
<code>mainTitle</code>
<value/>
</attribute>
<attribute>
<code>main_image</code>
<value/>
</attribute>
<attribute>
<code>image_2</code>
<value/>
</attribute>
<attribute>
<code>image_3</code>
<value/>
</attribute>
<attribute>
<code>image_4</code>
<value/>
</attribute>
<attribute>
<code>image_5</code>
<value/>
</attribute>
<attribute>
<code>ean_codes</code>
<value/>
</attribute>
<attribute>
<code>parentProductId</code>
<value/>
</attribute>
<attribute>
<code>brandName</code>
<value>Pool Flip-Flops</value>
</attribute>
<attribute>
<code>productTitle-en_GB</code>
<value/>
</attribute>
<attribute>
<code>webcatchline-en_GB</code>
<value/>
</attribute>
<attribute>
<code>video1-en_GB</code>
<value/>
</attribute>
<attribute>
<code>video2-en_GB</code>
<value/>
</attribute>
<attribute>
<code>useRestriction-en_GB</code>
<value/>
</attribute>
<attribute>
<code>storageAdvice-en_GB</code>
<value/>
</attribute>
<attribute>
<code>longDescription-en_GB</code>
<value/>
</attribute>
<attribute>
<code>composition-en_GB</code>
<value/>
</attribute>
<attribute>
<code>legal_mention-en_GB</code>
<value/>
</attribute>
<attribute>
<code>CHARACTERISTIC_748</code>
<value/>
</attribute>
<attribute>
<code>notice-en_GB</code>
<value/>
</attribute>
<attribute>
<code>guarantee-en_GB</code>
<value/>
</attribute>
<attribute>
<code>SPORT_205</code>
<value/>
</attribute>
<attribute>
<code>PRODUCT_TYPE</code>
<value>glue</value>
</attribute>
<attribute>
<code>SIZE</code>
<value/>
</attribute>
<attribute>
<code>PER_UNIT_UNIT</code>
<value/>
</attribute>
<attribute>
<code>PER_UNIT_VALUE</code>
<value>500 g = 0.5 oder 250 ml = 0.25</value>
</attribute>
</product>
</products>
</import>
Please note that the payload can be structured as:
<?xml version='1.0' encoding='UTF-8'?>
<import>
<products>
<product>
<category>100002</category>
<ProductIdentifier>12345</ProductIdentifier>
<mainTitle>mainTitle</mainTitle>
<main_image>main_image</main_image>
etc...
</product>
</products>
</import>
Mapping:
Mirakl Field | Mirakl Notes | Integration Required | Hemi Field | Comment |
---|---|---|---|---|
category |
Yes | Product Account > Primary Category ID | ||
ProductIdentifier |
Yes | Item > SKU | ||
mainTitle |
Product Account > Title | |||
main_image |
Yes | Item > Main Image or Product Account_decathlon > Main Image | ||
image_2 |
No | Item > More Picture URL Image or Product Account Decathlon > More Images | ||
image_3 |
No | item > More Picture URL Image or Product Account Decathlon > More Images | ||
image_4 |
No | item > More Picture URL Image or Product Account Decathlon > More Images | ||
image_5 |
No | item > More Picture URL Image or Product Account_decathlon > More Images | ||
ean_codes |
Yes | Item > EAN or Item Account > MP EAN | ||
parentProductId |
Recommended | Product Account > Variation Group | ||
brandName |
Yes | Product Account > Item specifics | ||
productTitle-en_GB |
No | see note | ||
Product Account > Title | drop down button with all sites - into account_decathlon) [based on the settings into account] | |||
webcatchline-en_GB |
No | Product Account> item specifics | If not populated we skip it | |
video1-en_GB |
No | item > Video URL | ||
video2-en_GB |
No | N/A | ||
useRestriction-en_GB |
No | Product Account> item specifics | If not populated we skip it | |
storageAdvice-en_GB |
No | Product Account> item specifics | If not populated we skip it | |
longDescription-en_GB |
No | Product Account > Description | ||
composition-en_GB |
No | Product Account> item specifics | If not populated we skip it | |
legal_mention-en_GB |
No | Product Account> item specifics | If not populated we skip it |
Example Response:
{
"import_id": 2035
}
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 |
---|
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 | |
N/A | N/A |
Please note we will add all successfully sent products as feed objects which after processing need to be removed from the object table.
- GET P42 -Get the import status for a product import
API Call: /api/products/imports/{import}
API Docs: https://decathlonbelgium-preprod.mirakl.net/help/api-doc/seller/mmp.html#P42
Example response:
{
"date_created": "2019-04-05T12:56:21Z",
"has_error_report": false,
"has_new_product_report": false,
"has_transformation_error_report": false,
"has_transformed_file": true,
"import_id": 2005,
"import_status": "SENT",
"shop_id": 2000,
"transform_lines_in_error": 0,
"transform_lines_in_success": 1,
"transform_lines_read": 1,
"transform_lines_with_warning": 0
}
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 all products inside the feed.
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 = Not Needed
Аfter successful product creation we need to fill the Channel Item ID, which for MIRAKL integration is the SKU!
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.
Note: See below detailed information for mentioned API calls ("has_error_report" and "has_transformation_error_report" )
- 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;
Basically, we rad the report and we extract the SKU column. After that we compare the Errors
or Warninngs
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 Decathlon integration (it is kind of standard on every MIRAKL)
API Call: /api/products/imports/{import}/error_report
API Docs: https://decathlonbelgium-preprod.mirakl.net/help/api-doc/seller/mmp.html#P44
Sample file -
product-import-errors-file-20220314160001 (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: https://decathlonbelgium-preprod.mirakl.net/help/api-doc/seller/mmp.html#P47
Sample file - To be added