Assortments Import - API Connector
This guide describes the process of importing Assortments via the API Connector.
⚙️ Introduction
This job is designed to create and update Assortments, and to link or unlink Products and/or Variants to those Assortments by connecting your system to DJUST via the API Connector. It processes data sent in JSON format through a RESTful API.
This import can be used to:
- Create empty assortments.
- Add or remove products in an assortment.
- Add or remove specific variants in an assortment.
- Combine product-level and variant-level logic within the same assortment.
📂 Accepted Payload Structure
The accepted payload format specifies the structure required for successful data transmission through the API Connector. Ensuring the payload adheres to this format guarantees efficient integration of Assortments within DJUST platform.
Payload structure example
{
"elements": [
{
"assortmentExternalId": "1234",
"assortmentName": "Soft",
"productExternalIds": ["7890", "5678"],
"unlink": false
},
{
"assortmentExternalId": "56643",
"assortmentName": "Alcohol",
"productExternalId": ["9876", "45676"],
"variantExternalIds": ["variant-1", "variant-2"],
"unlink": false
}
],
"paging": {
"pageNumber": 0,
"pageSize": 0,
"totalPages": 0,
"totalRecords": 0
}
}📋 Fields
| Field | Description | Required on creation | Required on update | Editable | Default value |
|---|---|---|---|---|---|
assortmentExternalId | Assortment unique external identifier | ✅ | ✅ | ❌ | — |
assortmentName | Assortment name | ❌ | ❌ | ✅ | — |
productListExternalIds | Product to link unique external identifier | ❌ | ❌ | ✅ | — |
variantListExternalIds | Variant to link unique external identifier | ❌ | ❌ | ✅ | — |
unlink | Unlink Product(s) from the Assortment | ❌ | ❌ | ✅ | false |
Assortment name behavior (API)
The field assortmentName is not mandatory for both creation and update operations.
However, its behavior is the following:
On creation
If assortmentName is not provided:
- The assortment is created with an empty name.
On update
If assortmentName is not provided:
- The existing name is cleared (deleted).
In other words, the assortmentName field is not partial:
When present → it is set.
When absent → it is reset.
ImportantEven if the field is technically optional, it is strongly recommended to always provide the assortment name on both creation and update to avoid unintended data loss.
Linking logic
Linking products
Linking products is done via:
"productExternalIds": ["test-1", "test-2"],
"unlink": false
This will:
- Add the products to the assortment. (Implicitly include all their variants)
Linking variants
Linking variants is done via:
"variantExternalIds": ["variant-test-2","variant-test-3" ],
"unlink": false
This will:
- Add only the specified variants to the assortment. (Not include the entire product variants)
Link a product and its associated variant
If both productExternalIds and variantExternalIds are provided in the same element:
{
"productExternalIds": ["test-1"],
"variantExternalIds": ["variant-test-1"]
}
Only the variant is linked. The product (and all its variants) is ignored.
Unlinking logic
Unlink variant only :
{
"variantExternalIds": ["variant-test-2"],
"unlink": true
}
The variant is removed from the assortment.
Unlink product (and all its variants)
{
"productExternalIds": ["test-1"],
"unlink": true
}
The product and all its variants are removed.
Unlink a product and its associated variant
{
"productExternalIds": ["test-1"],
"variantExternalIds": ["variant-test-1"],
"unlink": true
}
Only the variant is removed.
Product vs Variant — Resolution Rules
An assortment can contain:
- Only products.
- Only variants.
- Both products and variants at the same time.
When importing assortments, products and variants can be provided either in the same object or in different objects. The system applies deterministic resolution rules to avoid ambiguity.
Case 1 — Product and its Variant in the same object
Example:
{
"assortmentExternalId": "123",
"productExternalIds": ["test-1"],
"variantExternalIds": ["variant-test-1"],
"unlink": false
}
Behavior:
Only the variant is processed. The product is ignored.
The system links:
- "variant-test-1"
The system does not link:
- the full product "test-1"
- other variants of "test-1"
➡️ Rule: Variant always has priority over Product when both are provided in the same object.
Case 2 — Product and its Variant in different objects
Example:
[
{
"assortmentExternalId": "123",
"productExternalIds": ["test-1"],
"unlink": false
},
{
"assortmentExternalId": "123",
"variantExternalIds": ["variant-test-1"],
"unlink": false
}
]
Behavior:
First object:
- Links product "test-1" → All its variants are included.
Second object:
- Explicitly links "variant-test-1"
Final result:
- Product "test-1" is in the assortment.
- All its variants are included.
- "variant-test-1" is also included (even if already included via product).
➡️ Rule: Each object is processed independently and cumulatively.
Case 3 — Product added one of its Variants is removed
Example:
[
{
"assortmentExternalId": "123",
"productExternalIds": ["test-1"],
"unlink": false
},
{
"assortmentExternalId": "123",
"variantExternalIds": ["variant-test-1"],
"unlink": true
}
]
Behavior:
- Product "test-1" is added (all variants included).
- Variant "variant-test-1" is explicitly removed.
Final result:
- Product "test-1" is in the assortment.
- All its variants (if there are more than 1) are included except variant-test-1".
- If after removing "variant-test-1" the product has no more variants, it will not be visible in the assortment.
➡️ This allows fine-grained exclusion of specific variants from a product-level inclusion.
Case 4 — Product and its variant in same object with unlink = true
Example:
{
"assortmentExternalId": "123",
"productExternalIds": ["test-1"],
"variantExternalIds": ["variant-test-1"],
"unlink": true
}
Behavior:
- Only the variant is removed.
- The product is ignored.
Final result:
- "variant-test-1" is removed.
- The product "test-1" is not impacted.
➡️ Same priority rule: Variant overrides Product.
Case 5 — Product and and a variant that does not belong to the product (same object) with unlink = true
Example:
{
"assortmentExternalId": "123",
"productExternalIds": ["test-1"],
"variantExternalIds": ["variant-test-40"],
"unlink": true
}
Behavior:
- The specific variant is removed.
- The product and all its variants are removed.
Summary of Resolution Logic :
| Situation | Result |
|---|---|
| Product + Variant in same object | Variant only (product ignored) |
| Product and Variant in different objects | Both applied (cumulative) |
| Product added, Variant removed | Product included, variant excluded |
| Product removed, Variant added | Product removed, variant included |
Both provided with unlink=true | Variant removed only |
Key Business Rules & Notes
-
Linking one or more products to an Assortment is done via
productExternalIds. -
Linking one or more variants to an Assortment is done via
variantExternalIds. -
Unlinking a product or variant from an Assortment is done by setting
Unlink:true. -
A single product or variant can be linked to multiple Assortments with no limit.
🔗Useful Links:
Assortment management from Data Hub - Import SFTP : Assortment import SFTP
Assortment management from the Back Office : Assortments
Updated 12 days ago
