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 |
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"
}
}
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,
"price": 4.36,
"package_type": "Bottle",
"package_description": {
"gtin": "18032610319851",
"quantity": 0.75,
"unit_name": "l"
}
},
{
"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"
}
},
{
"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"
}
}
},
{
"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"
}
}
]
Here's a short description about the file articles:
- 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.