Create Assortment File

Creates an assortment file to be processed asynchronously.

Creates an assortment file identified by a customer_number (in this context the customer number here works more like an "assortment ID"). The file is processed asynchronously, i.e. the file is not processed right after posted.

The file argument must be the file binary content encoded in UTF-8. The file content must be an array of objects, where each object contains a product/article. The object fields are the following:

Field name

Type

Constraints

Required

third_party_id

String

Alphanumeric, 50 chars

Yes

shared_id

String

Alphanumeric, 50 chars

No

name

String

Alphanumeric, 300 chars

Yes

brand

String

Alphanumeric, 150 chars

No

description

String

Alphanumeric

No

package_type

String

Alphanumeric, 50 chars

No

price

Decimal

Up to 3 decimal places

No

price_type_code

Integer

Either 0 (per package) or 1 (per unit).
Default:0.

No, unless price_unit is set (then price_type_code=1).

price_unit

String

Must be one of our supported units.

No, unless price_type_code=1

orderable

Boolean

Default: true.

No

package_description

Object

Please check below.

Yes

lead_time

String

Duration in the format: [DD] [HH:[MM:]]ss[.uuuuuu]

No

weighted

Boolean

Default: false.

No

nutrition_info

Object

Please check below.

No

The package_description is a nested object representing the product content. The innermost object contains the following fields:

Field nameTypeConstraintsRequired
quantityIntegerN/AYes
unit_nameStringMust be one of our supported units .Yes
gtinStringAccepted formats: EAN-13, EAN-8, UPC (12-digit) and GTIN (EAN-14).No

The other object levels contains the fields below:

Field nameTypeConstraintsRequired
quantityDecimalUp to 6 decimal places.Yes
packageObjectAn object which the data is either the innermost object (table above) or another level (this table).Yes
gtinStringAccepted formats: EAN-13, EAN-8, UPC (12-digit) and GTIN (EAN-14).No

For example, a Coca-Cola pack of 12 units of 1.5 liters each would be a 2-levels object:

{
  "gtin": "6415600501828",
  "quantity": 12,
  "package": {
    "gtin": "6415600501811",
    "quantity": 1.5,
    "unit_name": "L"
  }
}

The nutrition_info is a nested object representing the product nutritional information. The object contains the following fields:

Field nameTypeConstraints
for_weight_qtyDecimalUp to 4 decimal places. Defaults to 100.0
for_weight_unitStringMust be one of our supported units . Defaults to "g"
energy_kjDecimalUp to 4 decimal places.
energy_kcalDecimalUp to 4 decimal places.
fatDecimalUp to 4 decimal places.
trans_fatty_acidsDecimalUp to 4 decimal places.
saturatesDecimalUp to 4 decimal places.
mono_unsaturatesDecimalUp to 4 decimal places.
polyunsaturatesDecimalUp to 4 decimal places.
carbohydrateDecimalUp to 4 decimal places.
sugarsDecimalUp to 4 decimal places.
polyolsDecimalUp to 4 decimal places.
starchDecimalUp to 4 decimal places.
fibreDecimalUp to 4 decimal places.
proteinDecimalUp to 4 decimal places.
animal_proteinDecimalUp to 4 decimal places.
plants_proteinDecimalUp to 4 decimal places.
saltDecimalUp to 4 decimal places.
sodiumDecimalUp to 4 decimal places.
vitamin_aDecimalUp to 4 decimal places.
vitamin_dDecimalUp to 4 decimal places.
vitamin_eDecimalUp to 4 decimal places.
vitamin_kDecimalUp to 4 decimal places.
vitamin_cDecimalUp to 4 decimal places.
thiaminDecimalUp to 4 decimal places.
riboflavinDecimalUp to 4 decimal places.
niacinDecimalUp to 4 decimal places.
vitamin_b6DecimalUp to 4 decimal places.
folic_acidDecimalUp to 4 decimal places.
vitamin_b12DecimalUp to 4 decimal places.
biotinDecimalUp to 4 decimal places.
pantothenic_acidDecimalUp to 4 decimal places.
potassiumDecimalUp to 4 decimal places.
chlorideDecimalUp to 4 decimal places.
calciumDecimalUp to 4 decimal places.
phosphorusDecimalUp to 4 decimal places.
magnesiumDecimalUp to 4 decimal places.
ironDecimalUp to 4 decimal places.
zincDecimalUp to 4 decimal places.
copperDecimalUp to 4 decimal places.
manganeseDecimalUp to 4 decimal places.
fluorideDecimalUp to 4 decimal places.
seleniumDecimalUp to 4 decimal places.
chromiumDecimalUp to 4 decimal places.
molybdenumDecimalUp to 4 decimal places.
iodineDecimalUp to 4 decimal places.
waterDecimalUp to 4 decimal places.
added_sugarDecimalUp to 4 decimal places.
cholesterolDecimalUp to 4 decimal places.
cholineDecimalUp to 4 decimal places.

Example:

{
  "for_weight_qty": 100.0,
  "for_weight_unit": "g",
  "energy_kj": 180.0,
  "salt": 0.0,
  "carbohydrate": 10.6,
  "saturates": 0.0,
  "fibre": 0.0,
  "sugars": 10.6,
  "energy_kcal": 42.0,
  "protein": 0.0,
  "fat": 0.0
}
🚧

Important request notes

  1. Please use the header content-type: multipart/form-data.
  2. The file content must be sent as binary (and not as a string).

If you are having trouble to make this request work, please try to reproduce our Postman guide video below:

The assortment file content used in the Postman guide is described below:

[
  {
    "third_party_id": "434211",
    "brand": "Il Padrino",
    "name": "Il Padrino Nero d'Avola Terre Siciliane 0,75L",
    "description": "Bottle  0,75L",
    "price_type_code": 0,
    "orderable": true,
    "price": 4.36,
    "package_type": "Bottle",
    "package_description": {
      "gtin": "18032610319851",
      "quantity": 0.75,
      "unit_name": "l"
    },
    "nutrition_info": {
      "for_weight_qty": 100.0,
      "for_weight_unit": "ml",
      "energy_kj": 305.0,
      "carbohydrate": 0.389,
      "sugars": 0.389,
      "energy_kcal": 73.0
    }
  },
  {
    "third_party_id": "EA434212",
    "shared_id": "434212",
    "brand": "Coca-Cola",
    "name": "Coca-Cola Can",
    "description": "Can 33 cl",
    "price_type_code": 0,
    "orderable": true,
    "price": 1.25,
    "package_type": "Can",
    "package_description": {
      "gtin": "5449000136381",
      "quantity": 33,
      "unit_name": "cl"
    },
    "nutrition_info": {
      "for_weight_qty": 100.0,
      "for_weight_unit": "g",
      "energy_kj": 0.9,
      "salt": 0.02,
      "energy_kcal": 0.2
    }
  },
  {
    "third_party_id": "CS434212",
    "shared_id": "434212",
    "brand": "Coca-Cola",
    "name": "Coca-Cola pack",
    "description": "Pack 6 units",
    "price_type_code": 0,
    "orderable": true,
    "price": 6.50,
    "package_type": "Pack",
    "package_description": {
      "gtin": "5449000171610",
      "quantity": 6,
      "package": {
        "gtin": "5449000136381",
        "quantity": 33,
        "unit_name": "cl"
      },
    },
    "nutrition_info": {
      "for_weight_qty": 100.0,
      "for_weight_unit": "ml",
      "salt": 0.02,
      "carbohydrate": 10.9,
      "sugars": 10.6,
      "added_sugar": 10.6,
      "sodium": 8.5,
      "energy_kcal": 44,
      "energy_kj": 184.096
    }
  },
  {
    "third_party_id": "434213",
    "brand": "JBS",
    "name": "Beef",
    "description": "Prime cut beef",
    "price_type_code": 1,
    "price_unit": "kg",
    "orderable": true,
    "price": 15.00,
    "package_type": "piece",
    "package_description": {
      "quantity": 1.5,
      "unit_name": "kg"
    },
    "nutrition_info": {
      "for_weight_qty": 112.0,
      "for_weight_unit": "g",
      "fat": 22,
      "saturates": 8,
      "cholesterol": 0.080,
      "sodium": 0.075,
      "salt": 0.02,
      "sugars": 10.6,
      "added_sugar": 10.6,
      "energy_kcal": 280,
      "energy_kj": 1171.52,
      "protein": 19,
      "iron": 0.002,
      "potassium": 0.302
    }
  }
]

Here's a short description about the file articles, each of them with their nutrition facts:

  • Article 1: article number 434211, a bottle of wine of 0.75 liters priced as $4.36.
  • Article 2: a Coca-Cola can of 33 cl priced as $1.25.
  • Article 3: a Coca-Cola pack of 6 units, where each unit has 33cl. The units are the same article as article 2 because the shared_id of both articles 2 and 3 are the same.
  • Article 4: a piece of beef price of 1.5 kg priced as $15.00 per kilo.

Please consult our guide for more details about the assortment data.


❗️

Unfortunately the form below to test this endpoint doesn't work properly due to the multipart/form-data. Please follow our Postman guide instead.

Language
Credentials
OAuth2
Click Try It! to start a request and see the response here!