---
title: OF01 - Import a File to Add Products & Offers
slug: of01-import-a-file-to-add-products-and-offers
docTags: 
createdAt: 2022-11-30T20:01:30.000Z
---

:::ApiMethodV2
```json
{
  "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"
  },
  "autoGeneratedAnchorSlug": "of01-import-a-file-to-add-products-offers",
  "legacyHash": "x-QETjwfM4DDI0ryrvvyV"
}
```
:::

::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
**CALL FREQUENCIES**
:::

:::VerticalSplitItem
Recommended: Every 5 minutes

Maximum: Once per minute
:::
::::

### Input File Format Example

:::CodeblockTabs
text/csv payload

```none
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
<?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>
```
:::

