Inno Create Offer
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)
Version | Date | Name | Applied changes |
---|---|---|---|
1.0 | 08/12/2022 | Hristiyan Georgiev | First Published |
The purpose of this page is to describe in details the process of creating offer to already existing product on MIRAKL.
To create offer we should use following API calls - POST OF01 (Import a file to add offers), GET OF02 (Get information and statistics about an offer import), GET OF03 (Get the error report file for an offer import)
Please note that in order to pick the product for offer creation we will need to have Channel Item Id and all relevant internal flags (described in additional information)
Create offer cron should pick products only with statuses:
Product status = Product created and Listing Status = Inactive and List/Update the whole item =Pending
When the offer is successfully sent for creation we will set:
Product status = Product created and Listing Status = Inactive and List/Update the whole item =Sent
When the offer is created, we set statuses:
Product status - Product Published and Listing Status - Active and List/Update the whole item =Not Needed
If there is an error during offer creation, we will set following statuses:
Product status = Product created and Listing Status = Inactive and List/Update the whole item =Error
and we need to store the relevant error in Update Item Error field
- POST OF01 - Import a file to add offers
API Call: /api/offers/imports
API Docs: https://galeriainnobe2-dev.mirakl.net/help/api-doc/seller/mmp.html?#OF01
Example file:
<import>
<offers>
<offer>
<sku>OFFER_SKU_1</sku>
<product-id>PRODUCT_SKU_1</product-id>
<product-id-type>SHOP_SKU</product-id-type>
<description>This is the description of my amazing offer!</description>
<internal-description>This is the internal description of my offer.</internal-description>
<price>1000</price>
<price-additional-info>Price including taxes</price-additional-info>
<quantity>1</quantity>
<min-quantity-alert>20</min-quantity-alert>
<state>11</state>
<available-start-date>2012-12-25</available-start-date>
<available-end-date>2013-05-17</available-end-date>
<logistic-class></logistic-class>
<favorite-rank>1</favorite-rank>
<discount-price>1</discount-price>
<discount-start-date>2012-12-25</discount-start-date>
<discount-end-date>2013-12-25</discount-end-date>
<leadtime-to-ship>15</leadtime-to-ship>
<update-delete>UPDATE</update-delete>
</offer>
</offers>
</import>
Mapping:
Mirakl Field | Mirakl Notes | Required | Hemi Field | Hemi Note |
---|---|---|---|---|
sku |
The offer’s unique identifier in the shop - Required - Maximum 40 characters, no "/" character | Yes | Product > SKU | |
product-id |
Unique product identifier for a given product-id-type - Required at offer creation - Maximum 40 characters | Yes | Product Account > Marketplace EAN |
OR
Product >EAN | |
| product-id-type
| Type of product-id identifier - Required at offer creation - Element from the list | Yes | hardcoded as ‘ean’ | |
| description
| Offer description - Recommended - Maximum 2000 characters | No | Product Account > Description | |
| price
| The price of the offer in the currency of the Marketplace - Required ONLY when creating an offer - Positive number | Yes | Product Account > StartPrice | |
| price-additional-info
| Information about the offer's price - Optional - Maximum 100 characters
E.G : Price Includes Taxes | No | Product Account Inno > Price additional info | |
| quantity
| Quantity available in stock - Recommended - Positive integer | No | Product Account > Quantity | |
| state
| The state of the offer - Required at offer creation - Element from the list | Yes | Product > ConditionID | Mapping to our conditions:
11- New > 1000;
1-Excellent > 1500;
2-Very Good >4000;
3-Good >5000;
4-Sufficient >6000;
5-Refurbished_like_new > 2750
6-Refurnished_very_good >2500
7-Refurbished_good > 2000
8-Refurbished_acceptable > 8000 |
| logistic-class
| The logistic class of the offer (this logistic class will overwrite the default logistic class defined for the product category assigned to the offer) - Optional - Element from the list | No | Product Account Inno > Logistic Class
OR
Account Inno > Logistic Class | By Default we select the Account Inno > Logistic Class if nothings there we pick Product Account Inno > Logistic Class else we does not include it in the payload |
| favorite-rank
| Define offer as favorite and set its rank value. This affects its positioning in the seller's catalog (if blank, the offer is not a favorite) - Optional - Positive integer | No | Product Account Inno > Favorite Rank | New checkbox field by default we push it as “0“ |
| discount-price
| The discount price of the offer - Optional - Positive number | No | Product Account > Price | If RRP > Price
- If there are discount dates imported in Hemi we use them
- If there are no dates imported in Hemi we use the default dates (Now) and (Now + 2y)
If RRP < Price
3.We do not include the discount fields. (price,start-date,end-date) |
|
discount-start-date
| The first day the discount becomes available (if blank, the discount has no start date and is immediately active) - Optional - Valid date | No | Product Account Inno > Discount Start Date | If we do not specify any dates in the relevant fields we hardcoded current date (“NOW“) Date format -2012-12-25
| |discount-end-date
| The last day the discount is available (if blank, the discount has no end date) - Optional - Valid date | No | Product Account Inno > Discount End Date | If we do not specify any dates in the relevant fields we hardcoded current date (“NOW“ +2y) Date format -2012-12-25
| |update-delete
| Only use with the Normal import mode (if blank, the Update mode is used) - Optional - Element from the list | No | N/A | |
Example Response:
<offer_import_tracking>
<import_id>2035</import_id>
<product_import_id>2036</product_import_id>
</offer_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 “Offer 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 OF02 - Get information and statistics about an offer import
API Call: /api/offers/imports/{import}
API Docs: https://galeriainnobe2-dev.mirakl.net/help/api-doc/seller/mmp.html?#OF02
Parameter | Integration Notes / Value | Required |
---|---|---|
import |
Import identifier | Yes |
Using this call, we are able to check the status of the imported file.
Example Response:
{
"date_created": "2019-04-01T15:16:31Z",
"has_error_report": false,
"import_id": 2035,
"lines_in_error": 0,
"lines_in_pending": 0,
"lines_in_success": 1,
"lines_read": 1,
"mode": "NORMAL",
"offer_deleted": 0,
"offer_inserted": 1,
"offer_updated": 0,
"status": "COMPLETE"
}
OF02 call is returning the response for the actual offer import (all offers).
Based on the response, we will need to check if we have to continue with the error report (if "has_error_report": true
) we continue with OF03, otherwise we treat it as success.
Success case (once the offer is created successfully)
Product status = Product Published and Listing Status = Active/Inactive and List/Update the whole item =Not Needed
Error case:
If "has_error_report": true
this means there is an error and we need to reach each of the reports in order to check for which item and what is the error.
Product status = Product created and Listing Status = Inactive and List/Update the whole item =Error
and we need to store the relevant error in Update Item Error field
- GET OF03 - Get the error report file for an offer import
In order to check if there are any errors related to the products, into imported file we should use the GET OF03 API Call.
API Call: /api/offers/imports/{import}/error_report
API Docs: https://galeriainnobe2-dev.mirakl.net/help/api-doc/seller/mmp.html?#OF03
"sku";"product-id";"product-id-type";"description";"internal-description";"price-additional-info";"quantity";"min-quantity-alert";"state";"available-start-date";"available-end-date";"logistic-class";"update-delete";"discount-start-date";"discount-end-date";"price";"discount-price";"discount-ranges";"price-ranges";"discount-start-date[channel=FR]";"discount-end-date[channel=FR]";"price[channel=FR]";"discount-price[channel=FR]";"discount-ranges[channel=FR]";"prices-ranges[channel=FR]";"discount-start-date[channel=CA]";"discount-end-date[channel=CA]";"price[channel=CA]";"discount-price[channel=CA]";"discount-ranges[channel=CA]";"prices-ranges[channel=CA]";"leadtime-to-ship";"error-line";"error-message"
"OFFER_SKU_004";"MKP100000000195360";"SKU";"My Offer Description n°1";"My Internal description 1";"My price Additional innformations";"1000000";"20";"11";"2017-02-20T10:45:53+01";"2017-04-30T10:45:53+01";"S";"update";"2017-02-22T10:45:53+01";"2017-04-30T10:45:53+01";"110.52";"108,56";"";"5|109.20,10|108.736";"2017-02-22T10:45:53+01";"2017-03-31T10:45:53+01";"105.56";"102,36";"";"5|104.56,10|103.27";"2017-02-22T10:45:53+01";"2017-03-31T10:45:53+01";"190.23";"175,36";"";"5|182.58,10|181.27";"15";"2";"The product does not exist"
As described above, this response give us detailed report of the SKUs and the actual SKUs errors are in the “error-message“ which we store in the Product Account >Update Item Error