Creates an assortment file to be processed asynchronously.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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, unlessprice_unit is set (then price_type_code=1). |
price_unit | String | Must be one of our supported units. | No, unlessprice_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 |
order_multiplier | Integer | Defines 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 quantity | No |
order_packaging_options | Array of objects | Each 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 |
weighted | Boolean | Default: false. | No |
portion_info | Object | Marks the article as a portion article. Please check below. | No |
nutrition_info | Object | Please check below. | No |
allergens | Object | Please check below. | No |
The package_description is a nested object representing the product content. The innermost object contains the following fields:
| Field name | Type | Constraints | Required |
|---|---|---|---|
quantity | Integer | N/A | Yes |
unit_name | String | Must be one of our supported units . | Yes |
gtin | String | Accepted formats: EAN-13, EAN-8, UPC (12-digit) and GTIN (EAN-14). | No |
The other object levels contains the fields below:
| Field name | Type | Constraints | Required |
|---|---|---|---|
quantity | Decimal | Up to 6 decimal places. | Yes |
package | Object | An object which the data is either the innermost object (table above) or another level (this table). | Yes |
gtin | String | Accepted 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=1with aprice_unit). A portion has no fixed size, so a per-package price is meaningless. portion_info.unitmust be compatible withprice_unitby type — both mass/volume (g,kg,ml,l, …) or both pieces (piece). Mixing pieces with mass/volume is rejected.portion_infosupports two forms: a fixed list of sizes (portions) or a range (min_portion/max_portion, optionally withincrement).
The object contains the following fields:
| Field name | Type | Constraints | Required |
|---|---|---|---|
unit | String | Unit of a single portion. Must be one of our supported units. | Yes, when any of the other fields below is set |
portions | Array of decimal | Fixed list of allowed portion sizes. Each value up to 4 decimal places. Must be non-empty. | No |
min_portion | Decimal | Minimum portion size in a range. Up to 4 decimal places. | No |
max_portion | Decimal | Maximum portion size in a range. Up to 4 decimal places. | No |
increment | Decimal | Step 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 singleportion_info, but when they doportionstakes 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:
| Rule | Error message |
|---|---|
unit is required when portions, min_portion or max_portion is set | unit is required when portions or min_portion/max_portion are provided. |
min_portion must be strictly less than max_portion | min_portion must be less than max_portion. |
increment requires both min_portion and max_portion | increment requires both min_portion and max_portion. |
increment must evenly divide max_portion - min_portion, so the sequence reaches max_portion exactly | increment 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-empty | Standard per-field validation errors. |
Rules at article level:
| Rule | Error 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 name | Type | Constraints | Required |
|---|---|---|---|
for_weight_qty | Decimal | Up to 4 decimal places. Defaults to 100.0 | No |
for_weight_unit | String | Must be one of our supported units. Defaults to "g" | No |
energy_kj | Decimal | Up to 4 decimal places. | No |
energy_kcal | Decimal | Up to 4 decimal places. | No |
fat | Decimal | Up to 4 decimal places. | No |
trans_fatty_acids | Decimal | Up to 4 decimal places. | No |
saturates | Decimal | Up to 4 decimal places. | No |
mono_unsaturates | Decimal | Up to 4 decimal places. | No |
polyunsaturates | Decimal | Up to 4 decimal places. | No |
carbohydrate | Decimal | Up to 4 decimal places. | No |
sugars | Decimal | Up to 4 decimal places. | No |
polyols | Decimal | Up to 4 decimal places. | No |
starch | Decimal | Up to 4 decimal places. | No |
fibre | Decimal | Up to 4 decimal places. | No |
protein | Decimal | Up to 4 decimal places. | No |
animal_protein | Decimal | Up to 4 decimal places. | No |
plants_protein | Decimal | Up to 4 decimal places. | No |
salt | Decimal | Up to 4 decimal places. | No |
sodium | Decimal | Up to 4 decimal places. | No |
vitamin_a | Decimal | Up to 4 decimal places. | No |
vitamin_d | Decimal | Up to 4 decimal places. | No |
vitamin_e | Decimal | Up to 4 decimal places. | No |
vitamin_k | Decimal | Up to 4 decimal places. | No |
vitamin_c | Decimal | Up to 4 decimal places. | No |
thiamin | Decimal | Up to 4 decimal places. | No |
riboflavin | Decimal | Up to 4 decimal places. | No |
niacin | Decimal | Up to 4 decimal places. | No |
vitamin_b6 | Decimal | Up to 4 decimal places. | No |
folic_acid | Decimal | Up to 4 decimal places. | No |
vitamin_b12 | Decimal | Up to 4 decimal places. | No |
biotin | Decimal | Up to 4 decimal places. | No |
pantothenic_acid | Decimal | Up to 4 decimal places. | No |
potassium | Decimal | Up to 4 decimal places. | No |
chloride | Decimal | Up to 4 decimal places. | No |
calcium | Decimal | Up to 4 decimal places. | No |
phosphorus | Decimal | Up to 4 decimal places. | No |
magnesium | Decimal | Up to 4 decimal places. | No |
iron | Decimal | Up to 4 decimal places. | No |
zinc | Decimal | Up to 4 decimal places. | No |
copper | Decimal | Up to 4 decimal places. | No |
manganese | Decimal | Up to 4 decimal places. | No |
fluoride | Decimal | Up to 4 decimal places. | No |
selenium | Decimal | Up to 4 decimal places. | No |
chromium | Decimal | Up to 4 decimal places. | No |
molybdenum | Decimal | Up to 4 decimal places. | No |
iodine | Decimal | Up to 4 decimal places. | No |
water | Decimal | Up to 4 decimal places. | No |
added_sugar | Decimal | Up to 4 decimal places. | No |
cholesterol | Decimal | Up to 4 decimal places. | No |
choline | Decimal | Up 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 name | Type | Constraints | Required |
|---|---|---|---|
corn | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
wheat | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
rye | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
barley | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
oats | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
spelt | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
kamut | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
shellfish | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
egg | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
fish | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
peanut | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
gluten | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
soy | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
milk_dairy | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
lactose | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
nut | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
walnuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
pecan_nuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
brazil_nuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
pistachio_nuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
macadamia_nuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
pine_nuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
chestnuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
almonds | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
hazelnuts | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
cashews | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
celery | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
mustard | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
seeds | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
sesame | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
poppy_seeds | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
sunflower_seeds | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
sulfites | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
lupine | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
mollusc | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
legume_pulse | String | Accepted value: "DOES_NOT_CONTAIN", "CONTAINS", "MAY_CONTAIN_TRACES", or "UNKNOWN" | No |
sulfites_ppm | Decimal | Up to 4 decimal places. | No |
free_from_allergens | Boolean | Set 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
- Please use the header
content-type: multipart/form-data.- 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_idof 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.
