Integration Overview
...
Products & Offers
OF01 - Import a File to Add Products & Offers
{ "tab" "examples", "url" "https //saksus2 dev mirakl net/api/offers/imports", "name" "of01 import a file to add products & offers", "method" "post", "request" { "pathparameters" \[ { "kind" "required", "name" "import", "type" "integer", "children" \[], "description" "import identifier" } ], "queryparameters" \[ { "kind" "optional", "name" "shop id", "type" "integer", "children" \[], "description" "use this parameter when your user has access to several shops if not specified, the shop id from your default shop will be used " } ], "headerparameters" \[ { "kind" "required", "name" "authorization", "type" "string", "children" \[], "description" "" } ], "bodydataparameters" \[ { "kind" "required", "name" "file", "type" "object", "children" \[], "description" "import file (csv or xml or xlsx) to upload use multipart/form data with name file csv format \\"sku\\";\\"product id\\";\\"product id type\\";\\"description\\";\\"internal description\\";\\"price\\";\\"price additional info\\";\\"quantity\\";\\"min quantity alert\\";\\"state\\";\\"available start date\\";\\"available end date\\";\\"discount price\\";\\"discount start date\\";\\"discount end date\\";\\"discount ranges\\";\\"allow quote requests\\";\\"leadtime to ship\\";\\"min order quantity\\";\\"max order quantity\\";\\"package quantity\\";\\"update delete\\";\\"price ranges\\";\\"ecotax\\";\\"gift wrap\\";\\"min quantity ordered\\";\\"eco contributions\\" if you use specific sales channels, use \\"price\[channel=channel code]\\";\\"discount price\[channel=channel code]\\";\\"discount start date\[channel=channel code]\\";\\"discount end date\[channel=channel code]\\";\\"discount ranges\[channel=channel code]\\";\\"price ranges\[channel=channel code]\\" if you use u s tax manager, use product tax code " }, { "kind" "required", "name" "import mode", "type" "string", "children" \[], "description" "will always be normal " }, { "kind" "optional", "name" "operator format", "type" "boolean", "children" \[], "description" "force the use of the operator product format" }, { "kind" "optional", "name" "with products", "type" "boolean", "children" \[], "description" "this file also contains product information will always be true " } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "r7bmiqlxs5lajoqpp5vwq", "code" "", "language" "201", "customlabel" "" } ], "selectedlanguageid" "r7bmiqlxs5lajoqpp5vwq" }, "examples" { "languages" \[ { "id" "cga7bl9llm0pxnx3fjs9u", "code" "curl location request post 'https //saksus2 dev mirakl net/api/offers/imports?shop id=integer' \\\\\n header 'accept application/json' \\\\\n header 'authorization string' \\\\\n data raw '{\\"file\\" \\"object\\",\\"import mode\\" \\"string\\",\\"operator format\\" \\"boolean\\",\\"with products\\" \\"boolean\\"}'", "language" "curl", "customlabel" "" }, { "id" "tmgyt0scnb4nvl3dobc66", "code" "var request = require('request');\nvar options = {\n 'method' 'post',\n 'url' 'https //saksus2 dev mirakl net/api/offers/imports?shop id=integer',\n 'headers' {\n 'accept' 'application/json',\n 'authorization' 'string'\n },\n body '{\\"file\\" \\"object\\",\\"import mode\\" \\"string\\",\\"operator format\\" \\"boolean\\",\\"with products\\" \\"boolean\\"}'\n\n};\nrequest(options, function (error, response) {\n if (error) throw new error(error);\n console log(response body);\n});\n", "language" "nodejs", "customlabel" "" }, { "id" "pi4mvwbc x yrifiivrfo", "code" "var myheaders = new headers();\nmyheaders append(\\"accept\\", \\"application/json\\");\nmyheaders append(\\"authorization\\", \\"string\\");\n\nvar raw = \\"{\\\\\\"file\\\\\\" \\\\\\"object\\\\\\",\\\\\\"import mode\\\\\\" \\\\\\"string\\\\\\",\\\\\\"operator format\\\\\\" \\\\\\"boolean\\\\\\",\\\\\\"with products\\\\\\" \\\\\\"boolean\\\\\\"}\\";\n\nvar requestoptions = {\n method 'post',\n headers myheaders,\n body raw,\n redirect 'follow'\n};\n\nfetch(\\"https //saksus2 dev mirakl net/api/offers/imports?shop id=integer\\", requestoptions)\n then(response => response text())\n then(result => console log(result))\n catch(error => console log('error', error));", "language" "javascript", "customlabel" "" }, { "id" "8lpeqsslgp uwkviylbqs", "code" "import requests\n\nurl = \\"https //saksus2 dev mirakl net/api/offers/imports?shop id=integer\\"\n\npayload = \\"{\\\\\\"file\\\\\\" \\\\\\"object\\\\\\",\\\\\\"import mode\\\\\\" \\\\\\"string\\\\\\",\\\\\\"operator format\\\\\\" \\\\\\"boolean\\\\\\",\\\\\\"with products\\\\\\" \\\\\\"boolean\\\\\\"}\\"\nheaders = {\n 'accept' 'application/json',\n 'authorization' 'string'\n}\n\nresponse = requests request(\\"post\\", url, headers=headers, data=payload)\n\nprint(response text)\n", "language" "python", "customlabel" "" }, { "id" "i1hyh3vjhprvcdrbf9hga", "code" "require \\"uri\\"\nrequire \\"net/http\"\n\nurl = uri(\\"https //saksus2 dev mirakl net/api/offers/imports?shop id=integer\\")\n\nhttps = net http new(url host, url port)\nhttps use ssl = true\n\nrequest = net http post new(url)\nrequest\[\\"accept\\"] = \\"application/json\\"\nrequest\[\\"authorization\\"] = \\"string\\"\nrequest body = \\"{\\\\\\"file\\\\\\" \\\\\\"object\\\\\\",\\\\\\"import mode\\\\\\" \\\\\\"string\\\\\\",\\\\\\"operator format\\\\\\" \\\\\\"boolean\\\\\\",\\\\\\"with products\\\\\\" \\\\\\"boolean\\\\\\"}\\"\n\nresponse = https request(request)\nputs response read body\n", "language" "ruby", "customlabel" "" } ], "selectedlanguageid" "cga7bl9llm0pxnx3fjs9u" }, "description" "used to upload your product & offer file returns the import identifier to track the status of the import \n\nyour 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 ", "currentnewparameter" { "label" "header parameter", "value" "headerparameters" } } call frequencies recommended every 5 minutes maximum once per minute input file format example text/csv payload 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 application/xml payload \<?xml version = '1 0' encoding = 'utf 8' ?> \<import> \<offers> \<offer> \<sku>offer sku 2\</sku> \<product id>mkp100000000037254\</product id> \<product id type>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>10\</price> \<price additional info>price including taxes\</price additional info> \<quantity>0\</quantity> \<min quantity alert>20\</min quantity alert> \<eco contributions> \<eco contribution> \<producer id>producerid1\</producer id> \<eco contribution amount>2 49\</eco contribution amount> \</eco contribution> \<eco contribution> \<producer id>producerid2\</producer id> \<eco contribution amount>0 99\</eco contribution amount> \</eco contribution> \</eco contributions> \<state>11\</state> \<available start date>2017 02 20t10 45 53+01\</available start date> \<available end date>2017 05 31t10 45 53+01\</available end date> \<logistic class>\</logistic class> \<favorite rank>1\</favorite rank> \<discount price>1\</discount price> \<discount start date>2017 02 20t10 45 53+01\</discount start date> \<discount end date>2017 05 31t10 45 53+01\</discount end date> \<discount ranges> \<discount range> \<price>9 00\</price> \<quantity threshold>5\</quantity threshold> \</discount range> \<discount range> \<price>8 50\</price> \<quantity threshold>10\</quantity threshold> \</discount range> \</discount ranges> \<leadtime to ship>15\</leadtime to ship> \<allow quote requests>true\</allow quote requests> \<update delete>update\</update delete> \<price ranges> \<price range> \<price>9 33\</price> \<quantity threshold>5\</quantity threshold> \</price range> \<price range> \<price>9 10\</price> \<quantity threshold>10\</quantity threshold> \</price range> \</price ranges> \<all prices> \<pricing> \<channel code>ca\</channel code> \<price>10\</price> \<discount price>1\</discount price> \<discount start date>2017 02 20t10 45 53+01\</discount start date> \<discount end date>2017 05 31t10 45 53+01\</discount end date> \<discount ranges> \<discount range> \<price>9 00\</price> \<quantity threshold>5\</quantity threshold> \</discount range> \<discount range> \<price>8 50\</price> \<quantity threshold>10\</quantity threshold> \</discount range> \</discount ranges> \<price ranges> \<price range> \<price>9 33\</price> \<quantity threshold>5\</quantity threshold> \</price range> \<price range> \<price>9 20\</price> \<quantity threshold>10\</quantity threshold> \</price range> \</price ranges> \</pricing> \<pricing> \<channel code>fr\</channel code> \<price>10\</price> \<discount price>1\</discount price> \<discount start date>2017 02 20t10 45 53+01\</discount start date> \<discount end date>2017 05 31t10 45 53+01\</discount end date> \<discount ranges> \<discount range> \<price>9 00\</price> \<quantity threshold>5\</quantity threshold> \</discount range> \<discount range> \<price>8 50\</price> \<quantity threshold>10\</quantity threshold> \</discount range> \</discount ranges> \<price ranges> \<price range> \<price>9 33\</price> \<quantity threshold>5\</quantity threshold> \</price range> \<price range> \<price>9 20\</price> \<quantity threshold>10\</quantity threshold> \</price range> \</price ranges> \</pricing> \</all prices> \<offer additional fields> \<offer additional field> \<code>ecotax\</code> \<value>1\</value> \</offer additional field> \<offer additional field> \<code>gift wrap\</code> \<value>true\</value> \</offer additional field> \<offer additional field> \<code>min quantity ordered\</code> \<value>1\</value> \</offer additional field> \</offer additional fields> \</offer> \</offers> \</import>