Create Assortment File

Creates an assortment file to be processed asynchronously.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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 nameTypeConstraintsRequired
third_party_idStringAlphanumeric, 50 charsYes
shared_idStringAlphanumeric, 50 charsNo
nameStringAlphanumeric, 300 charsYes
brandStringAlphanumeric, 150 charsNo
descriptionStringAlphanumericNo
package_typeStringAlphanumeric, 50 charsNo
priceDecimalUp to 3 decimal placesNo
price_type_codeIntegerEither 0 (per package) or 1 (per unit).
Default:0.
No, unlessprice_unit is set (then price_type_code=1).
price_unitStringMust be one of our supported units.No, unlessprice_type_code=1
orderableBooleanDefault: true.No
package_descriptionObjectPlease check below.Yes
lead_timeStringDuration in the format: [DD] [HH:[MM:]]ss[.uuuuuu]No
order_multiplierIntegerDefines the ordering increment for an article (e.g. 6 → only 6, 12, 18 units can be ordered); if 1, null or omitted, the article can be ordered in any quantityNo
order_packaging_optionsArray of objectsEach object must have key (string, max 100 chars) and label (string, max 100 chars), and may include order_multiplier (integer, min 2) — ordering quantities must be a multiple of this value (e.g. 6 → 6, 12, 18…). Example: [{"key": "VAC", "label": "Vacuum", "order_multiplier": 6}]. If null or omitted, the article has no packaging variants.No
weightedBooleanDefault: false.No
portion_infoObjectMarks the article as a portion article. Please check below.No
nutrition_infoObjectPlease check below.No
allergensObjectPlease 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 portion_info field turns a regular article into a portion article — an article that is not shipped as a single fixed package but as a set of portion sizes the customer can pick from later. If the field is omitted or set to null, the article is treated as a regular package. See Portion Articles in the guide for the concept and the supplier-side implications.

Implications for the assortment file:

  • The article must be priced per unit, not per package (price_type_code=1 with a price_unit). A portion has no fixed size, so a per-package price is meaningless.
  • portion_info.unit must be compatible with price_unit by type — both mass/volume (g, kg, ml, l, …) or both pieces (piece). Mixing pieces with mass/volume is rejected.
  • portion_info supports two forms: a fixed list of sizes (portions) or a range (min_portion / max_portion, optionally with increment).

The object contains the following fields:

Field nameTypeConstraintsRequired
unitStringUnit of a single portion. Must be one of our supported units.Yes, when any of the other fields below is set
portionsArray of decimalFixed list of allowed portion sizes. Each value up to 4 decimal places. Must be non-empty.No
min_portionDecimalMinimum portion size in a range. Up to 4 decimal places.No
max_portionDecimalMaximum portion size in a range. Up to 4 decimal places.No
incrementDecimalStep inside the range. Up to 4 decimal places.No

Configuration forms

A portion article is described in one of the following ways.

1. Fixed list of portion sizes — the article is sold only in a handful of predefined sizes, declared with portions:

{
  "portion_info": {
    "unit": "g",
    "portions": [150, 200, 250]
  }
}

The article is available in 150 g, 200 g and 250 g portions.

2. Range with an increment — the customer picks any size from an interval, declared with min_portion and max_portion, optionally with increment:

{
  "portion_info": {
    "unit": "g",
    "min_portion": 100,
    "max_portion": 500,
    "increment": 50
  }
}

The article is available in portions from 100 g to 500 g in steps of 50 g (100, 150, 200, …, 500). If increment is omitted, any size within the range is accepted.

3. No size constraint — an empty object marks the article as a portion article without declaring any size limits. The customer can order any portion size:

{
  "portion_info": {}
}

Use this form only when the supplier truly has no minimum, maximum or discrete set of sizes to declare. The list and range forms give the customer clearer options.

📘

Forms 1 and 2 may technically coexist in a single portion_info, but when they do portions takes precedence and the range is ignored. Exactly one form per article is recommended.

Validation rules

A request is rejected with 400 Bad Request when any of the following rules is violated.

Rules inside portion_info:

RuleError message
unit is required when portions, min_portion or max_portion is setunit is required when portions or min_portion/max_portion are provided.
min_portion must be strictly less than max_portionmin_portion must be less than max_portion.
increment requires both min_portion and max_portionincrement requires both min_portion and max_portion.
increment must evenly divide max_portion - min_portion, so the sequence reaches max_portion exactlyincrement must evenly divide (max_portion - min_portion) so the sequence reaches max_portion exactly.
All sizes are positive (≥ 0.0001) and portions, if present, is non-emptyStandard per-field validation errors.

Rules at article level:

RuleError message
A portion article must be priced per unit (price_type_code=1). A per-package price (price_type_code=0) is incompatible with portions.Portion articles must be priced per unit (price_type_code=1).
portion_info.unit and price_unit must be compatible by type: both mass/volume units (g, kg, ml, l, …) or both piece units (piece). Mixing pieces with mass/volume is rejected.The portion unit must be compatible with the price unit. Both must be either mass/volume units or piece units.

Examples

Valid — beef steak available in three fixed sizes:

{
  "third_party_id": "BEEF-STEAK-CUT",
  "price": "4.50",
  "price_type_code": 1,
  "price_unit": "g",
  "portion_info": {
    "unit": "g",
    "portions": [150, 200, 300]
  }
}

Valid — Gouda cheese cut to any weight between 100 g and 1000 g in steps of 100 g:

{
  "third_party_id": "CHEESE-GOUDA-CUT",
  "price": "12.00",
  "price_type_code": 1,
  "price_unit": "kg",
  "portion_info": {
    "unit": "g",
    "min_portion": 100,
    "max_portion": 1000,
    "increment": 100
  }
}

Valid — pizza sold by the slice, from a quarter to a whole:

{
  "third_party_id": "PIZZA-MARGHERITA-SLICE",
  "price": "8.00",
  "price_type_code": 1,
  "price_unit": "piece",
  "portion_info": {
    "unit": "piece",
    "portions": [0.25, 0.5, 1]
  }
}

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

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

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
}

allergens is a nested object representing the product's allergen information. The object may contain the following fields:

Field nameTypeConstraintsRequired
cornStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
wheatStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
ryeStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
barleyStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
oatsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
speltStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
kamutStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
shellfishStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
eggStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
fishStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
peanutStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
glutenStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
soyStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
milk_dairyStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
lactoseStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
nutStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
walnutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
pecan_nutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
brazil_nutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
pistachio_nutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
macadamia_nutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
pine_nutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
chestnutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
almondsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
hazelnutsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
cashewsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
celeryStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
mustardStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
seedsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
sesameStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
poppy_seedsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
sunflower_seedsStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
sulfitesStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
lupineStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
molluscStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
legume_pulseStringAccepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN"No
sulfites_ppmDecimalUp to 4 decimal places.No
free_from_allergensBooleanSet to true to indicate the product is free from all allergens. When true, all other allergen string fields should be omitted or set to "DOES_NOT_CONTAIN", and sulfites_ppm must be set to 0.No
🚧

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,
    "order_multiplier": null,
    "order_packaging_options": [
      {"key": "VAC", "label": "Vacuum", "order_multiplier": 6},
      {"key": "NO_VAC", "label": "Not Vacuum"}
    ],
    "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
    },
    "allergens": {
      "milk_dairy": "DOES_NOT_CONTAIN",
      "soy": "DOES_NOT_CONTAIN",
      "egg": "DOES_NOT_CONTAIN",
      "fish": "DOES_NOT_CONTAIN",
      "shellfish": "DOES_NOT_CONTAIN",
      "peanut": "DOES_NOT_CONTAIN",
      "nut": "DOES_NOT_CONTAIN",
      "sesame": "DOES_NOT_CONTAIN",
      "wheat": "DOES_NOT_CONTAIN" 
    }
  },
  {
    "third_party_id": "CS434212",
    "shared_id": "434212",
    "brand": "Coca-Cola",
    "name": "Coca-Cola pack",
    "description": "Pack 6 units",
    "price_type_code": 0,
    "orderable": true,
    "order_multiplier": 6,
    "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. It has two packaging options: "Vacuum" (with an order multiplier of 6, meaning quantities must be in multiples of 6) and "Not Vacuum".
  • 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.

Body Params
file
required

The assortment file.

string
required

A customer number.

Response

Language
Credentials
OAuth2
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json