OF01 - Import a File to Add Products & Offers
OF01 - Import a File to Add Products & Offers
Used to upload your product & offer file. Returns the import identifier to track the status of the import.
Your product & offer file can also be uploaded manually from your store admin area and is the recommended method for sellers who do not frequently add new products to the marketplace. In that event, OF01, OF02 and OF03 do not need to be implemented.
POST
https://saksus2-dev.mirakl.net/api/offers/imports
Path Parameters
- importIntegerrequiredDescription
Query Parameters
- shop_idIntegerDescription
Header Parameters
- Authorizationstringrequired
Body Parameters
- fileObjectrequiredDescription
- import_modestringrequiredDescription
- operator_formatBooleanDescription
- with_productsBooleanDescription
curl
curl --location --request POST 'https://saksus2-dev.mirakl.net/api/offers/imports?shop_id=Integer' \
--header 'Accept: application/json' \
--header 'Authorization: string' \
--data-raw '{"file":"Object","import_mode":"string","operator_format":"Boolean","with_products":"Boolean"}'nodejs
var request = require('request');
var options = {
'method': 'POST',
'url': 'https://saksus2-dev.mirakl.net/api/offers/imports?shop_id=Integer',
'headers': {
'Accept': 'application/json',
'Authorization': 'string'
},
body: '{"file":"Object","import_mode":"string","operator_format":"Boolean","with_products":"Boolean"}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
javascript
var myHeaders = new Headers();
myHeaders.append("Accept", "application/json");
myHeaders.append("Authorization", "string");
var raw = "{\"file\":\"Object\",\"import_mode\":\"string\",\"operator_format\":\"Boolean\",\"with_products\":\"Boolean\"}";
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://saksus2-dev.mirakl.net/api/offers/imports?shop_id=Integer", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));python
import requests
url = "https://saksus2-dev.mirakl.net/api/offers/imports?shop_id=Integer"
payload = "{\"file\":\"Object\",\"import_mode\":\"string\",\"operator_format\":\"Boolean\",\"with_products\":\"Boolean\"}"
headers = {
'Accept': 'application/json',
'Authorization': 'string'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
ruby
require "uri"
require "net/http"
url = URI("https://saksus2-dev.mirakl.net/api/offers/imports?shop_id=Integer")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Accept"] = "application/json"
request["Authorization"] = "string"
request.body = "{\"file\":\"Object\",\"import_mode\":\"string\",\"operator_format\":\"Boolean\",\"with_products\":\"Boolean\"}"
response = https.request(request)
puts response.read_body
201
CALL FREQUENCIES
Recommended: Every 5 minutes Maximum: Once per minute
Input File Format Example
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;ecotax;gift-wrap;min-quantity-ordered;eco-contributions
OFFER_SKU_004;MKP100000000037254;SKU;My Offer Description 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;1;true;1;ProducerID1|2.49,ProducerID2|0.99