---
updatedAt: 2026-08-22T12:46:56.000Z
agentTools:
  projectIndex: https://developers.apicbase.com/llms.txt
---

# 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:

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th style={{ textAlign: "left" }}>
        Field name
      </th>

      <th style={{ textAlign: "left" }}>
        Type
      </th>

      <th style={{ textAlign: "left" }}>
        Constraints
      </th>

      <th style={{ textAlign: "left" }}>
        Required
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{ textAlign: "left" }}>
        `third_party_id`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric, 50 chars
      </td>

      <td style={{ textAlign: "left" }}>
        Yes
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `shared_id`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric, 50 chars
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `name`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric, 300 chars
      </td>

      <td style={{ textAlign: "left" }}>
        Yes
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `brand`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric, 150 chars
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `description`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `package_type`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric, 50 chars
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `price`
      </td>

      <td style={{ textAlign: "left" }}>
        Decimal
      </td>

      <td style={{ textAlign: "left" }}>
        Up to 3 decimal places
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `price_type_code`
      </td>

      <td style={{ textAlign: "left" }}>
        Integer
      </td>

      <td style={{ textAlign: "left" }}>
        Either `0` (per package) or `1` (per unit).\
        **Default:`0`.**
      </td>

      <td style={{ textAlign: "left" }}>
        No, **unless** `price_unit` is set (then `price_type_code=1`).
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `price_unit`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Must be one of our [supported units](https://developers.apicbase.com/docs/assortment-files-1#24-supported-units).
      </td>

      <td style={{ textAlign: "left" }}>
        No, **unless** `price_type_code=1`
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `orderable`
      </td>

      <td style={{ textAlign: "left" }}>
        Boolean
      </td>

      <td style={{ textAlign: "left" }}>
        Default: `true`.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `package_description`
      </td>

      <td style={{ textAlign: "left" }}>
        Object
      </td>

      <td style={{ textAlign: "left" }}>
        Please check below.
      </td>

      <td style={{ textAlign: "left" }}>
        Yes
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `lead_time`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        Duration in the format: [DD] \[HH:[MM:]]ss[.uuuuuu]
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `order_multiplier`
      </td>

      <td style={{ textAlign: "left" }}>
        Integer
      </td>

      <td style={{ textAlign: "left" }}>
        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
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `order_packaging_options`
      </td>

      <td style={{ textAlign: "left" }}>
        Array of objects
      </td>

      <td style={{ textAlign: "left" }}>
        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.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `image_url`
      </td>

      <td style={{ textAlign: "left" }}>
        String
      </td>

      <td style={{ textAlign: "left" }}>
        A publicly reachable source URL of the article's image (max 2048 chars). Apicbase stores the URL as sent and returns it unchanged in the `package.image_url` field of the Get Customer Packages / Get Customer Package responses (API version 2 only). May be `null` or empty — sending either clears a previously set image.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `weighted`
      </td>

      <td style={{ textAlign: "left" }}>
        Boolean
      </td>

      <td style={{ textAlign: "left" }}>
        Default: `false`.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `portion_info`
      </td>

      <td style={{ textAlign: "left" }}>
        Object
      </td>

      <td style={{ textAlign: "left" }}>
        Marks the article as a **portion article**. Please check below.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `nutrition_info`
      </td>

      <td style={{ textAlign: "left" }}>
        Object
      </td>

      <td style={{ textAlign: "left" }}>
        Please check below.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>
        `allergens`
      </td>

      <td style={{ textAlign: "left" }}>
        Object
      </td>

      <td style={{ textAlign: "left" }}>
        Please check below.
      </td>

      <td style={{ textAlign: "left" }}>
        No
      </td>
    </tr>
  </tbody>
</Table>

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](https://developers.apicbase.com/docs/assortment-files-1#24-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:

```json
{
  "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](https://developers.apicbase.com/docs/assortment-files-1#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 name    | Type             | Constraints                                                                                                                                 | Required                                       |
| :------------ | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------ | :--------------------------------------------- |
| `unit`        | String           | Unit of a single portion. Must be one of our [supported units](https://developers.apicbase.com/docs/assortment-files-1#24-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`:

```json
{
  "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`:

```json
{
  "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:

```json
{
  "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`:

| 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:**

```json
{
  "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:**

```json
{
  "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:**

```json
{
  "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](https://developers.apicbase.com/docs/assortment-files-1#24-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:

```json
{
  "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
>
> 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:

<HTMLBlock>{`
<div style="position: relative; padding-bottom: 56.25%; height: 0;"><iframe src="https://www.loom.com/embed/b646fcbde3fc4a6ca31af38e3098bc43?sid=d7afb0d1-dcf5-4fc4-813a-8f5eb087a36e" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>
`}</HTMLBlock>

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

```Text JSON
[
  {
    "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](https://apicbase.readme.io/docs/assortment-files-1) 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.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "apicbase-suppliers-api",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://api.apicbase.com/api/v2/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://api.apicbase.com/oauth/token/",
            "scopes": {
              "supplier": "Access to the Suppliers API endpoints."
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/integrations/suppliers/files/": {
      "post": {
        "summary": "Create Assortment File",
        "description": "Creates an assortment file to be processed asynchronously.",
        "operationId": "create-assortment-file",
        "parameters": [
          {
            "name": "content-type",
            "in": "header",
            "schema": {
              "type": "string",
              "default": "multipart/form-data"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "file",
                  "customer_number"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "The assortment file.",
                    "format": "binary"
                  },
                  "customer_number": {
                    "type": "string",
                    "description": "A customer number."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "201",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"apic_id\": \"466000210040001\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "apic_id": {
                      "type": "string",
                      "example": "466000210040001"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```