ORDER
This page describes how to import and manage Orders in DJUST — create External Orders from your ERP, update Internal Orders and their lines, and synchronize order statuses via CSV or API Connector.
⚙️ Introduction
This job allows the creation and update of Orders via CSV import or API Connector.
You can:
- Create new External Orders
- Add Order Lines to existing Orders
- Update existing Order Lines
- Update the status of an Order
- Remove Order Lines
- Create or update Custom Fields on Order Logistics and Order Lines
Order Data ModelIn DJUST, an Order is composed of two key components:
- Order Logistic: A logical grouping of one or more Order Lines
- Order Line: Represents a single purchased product, including its offer and quantity
📂 Import model
CSV Structure
The CSV file must contain one row per Order Line. Multiple rows may belong to the same Order Logistic.
API Connector
The API Connector sends data as a JSON payload. The JSON must always be a list of objects, regardless of the use case (create, update, delete).
[
{
"orderExternalId": "string",
"orderReference": "string",
"orderStatus": "string",
"accountExternalId": "string",
"customerExternalId": "string",
"supplierExternalId": "string",
"shippingAddressFullName": "string",
"shippingAddressCountry": "string",
"shippingAddressStreetName": "string",
"shippingAddressCity": "string",
"shippingAddressZipCode": "string",
"shippingAddressState": "string",
"shippingAddressAdditional": "string",
"orderLines": [
{
"orderLineExternalId": "string",
"orderLineId": "string",
"offerPriceExternalId": "string",
"variantExternalId": "string",
"variantName": "string",
"variantDescription": "string",
"classificationExternalId": "string",
"orderLineQuantity": 0,
"netUnitPrice": 0,
"grossUnitPrice": 0,
"taxAmount": 0,
"markOrderLineForDeletion": false
}
]
}
]📋 Fields
| Field | Definition | Required for creation | Required for update | Editable | Default Value |
|---|---|---|---|---|---|
Order External Id | Unique external reference of the Order | ✅ | ☑️ (Unless Order Reference is provided) | ✅ (Only if the value is not yet set for Internal Orders) | |
Order Reference | Unique DJUST reference of the Order | ☑️ (Unless Order External Id is provided) | |||
Order Status | Represents the current state of the Order Logistic in its lifecycle. This status determines whether the order can still be modified | DRAFT_ORDER_ON_HOLD | |||
Order Line External Id | Unique external reference of the Order Line | ✅ | ☑️ (Unless Order Line Id is provided) | ✅ (Only if the value is not yet set for Internal Orders) | |
Order Line Id | Unique DJUST reference of the Order Line | ☑️ (Unless Order Line External Id is provided) | |||
Account External Id | Unique external reference of the Account provided in DJUST | ✅ | ☑️ (Only to create a new line) | ||
Customer External Id | Unique external reference of the Customer provided in DJUST | ✅ | If not provided, the order is linked with the first Customer User associated with the Account External Id | ||
Supplier External Id | Unique external reference of the Supplier provided in DJUST | ✅ | ☑️ (Only to create a new line) | ||
Order Line Quantity | The number of units ordered for the given product (Order Line) | ✅ | ☑️ (Only to create a new line) | ✅ | |
Net Unit Price | The unit price of the product excluding taxes | ☑️ (Unless Offer Price External Id is provided) | ☑️ (Unless Offer Price External Id is provided) | ✅ | |
Gross Unit Price | The unit price of the product including taxes | ✅ | |||
Tax Amount | The tax amount per unit | ✅ | |||
Offer Price External Id | External identifier of the offer price associated with the product. Used to retrieve product and pricing information configured in DJUST (such as variant, unit, tax rules, etc.) | ☑️ (Unless Variant External Id and/or Net Unit Price are provided) | ☑️ (Unless Variant External Id and/or Net Unit Price are provided) | ✅ | |
Variant External Id | External identifier of the product variant. If not found in DJUST, it will still be stored on the order line without triggering an error | ☑️ (Unless Offer Price External Id is provided) | ☑️ (Unless Offer Price External Id is provided) | ✅ (If both Offer Price External Id and Variant External Id are provided, the variant must exist in DJUST and be linked to the corresponding Offer Price External Id) | |
Variant Name | The display name of the product variant as provided by the source system. Stored on the order line for informational purposes, not matched against DJUST's product catalog. Especially useful when the referenced variant does not exist in DJUST | ✅ | The one associated with the Variant External Id | ||
Variant Description | A free-text description of the product variant, provided by the source system. Stored for informational purposes only, not validated against any product data in DJUST | ✅ | The one associated with the Variant External Id | ||
Classification External Id | Unique external reference of the Classification associated with the Variant External Id | The one associated with the Variant External Id | |||
Shipping Address Full Name | The full name of the recipient at the delivery address | ☑️ (Required if any shipping field is filled¹) | ☑️ (Required if any shipping field is filled¹) | ✅ | The first Shipping Address associated with the Account |
Shipping Address Country | The country where the order should be delivered | ☑️ (Required if any shipping field is filled¹) | ☑️ (Required if any shipping field is filled¹) | ✅ | The first Shipping Address associated with the Account |
Shipping Address Street Name | The street name and number of the delivery location | ☑️ (Required if any shipping field is filled¹) | ☑️ (Required if any shipping field is filled¹) | ✅ | The first Shipping Address associated with the Account |
Shipping Address City | The city or locality of the delivery address | ☑️ (Required if any shipping field is filled¹) | ☑️ (Required if any shipping field is filled¹) | ✅ | The first Shipping Address associated with the Account |
Shipping Address Zip Code | The postal or ZIP code of the delivery address | ☑️ (Required if any shipping field is filled¹) | ☑️ (Required if any shipping field is filled¹) | ✅ | The first Shipping Address associated with the Account |
Shipping Address State | The region, province, or state of the delivery address (if applicable) | ✅ | The first Shipping Address associated with the Account | ||
Shipping Address (Additional) | Optional free-text field for any extra delivery information (e.g. door code, apartment number, delivery notes) | ✅ | The first Shipping Address associated with the Account | ||
Mark Order Line For Deletion | Boolean flag used to indicate that the order line should be removed from the order | ✅ | FALSE |
Conditionally required¹ If any
Shipping Addressfield is provided (includingStateandAdditional),
thenFull Name,Country,Street Name,CityandZip Codeall become required.
StateandAdditionalare never required on their own.
Order Identification
Each order must be identified using at least one of the following fields:
| Field | Description |
|---|---|
Order External Id | Unique external identifier of the order |
Order Reference | DJUST reference of the order |
If both are provided,
Order Referencetakes precedence.
Order External Idis mandatory when creating an order.
Order Referencecan only be used when updating an existing order.
Order Line Identification
Each order line must be identified using at least one of the following fields:
| Field | Description |
|---|---|
Order Line External Id | External identifier of the order line |
Order Line Id | Internal DJUST identifier of the order line |
To create a new line,
Order Line External Idis required.
To update an existing line, provide at least one of these fields.
🧠 Key Business Rules
Use cases and required fields
Create an External Order
Required fields: Order External Id, Account External Id, Customer External Id, Supplier External Id, Order Line External Id, Offer Price External Id (or Variant External Id), Order Line Quantity, Net Unit Price.
Update an External Order or its Lines
Required fields: Order External Id (or Order Reference), Order Line External Id (or Order Line Id).
Update an Internal Order
An Internal Order is an order created natively in DJUST (not imported from an external system). You can update it by providing Order Reference to identify it, along with the fields to update. Order External Id and Order Line External Id can be set on an Internal Order at any time.
Update an Order Status
Provide Order External Id (or Order Reference) and set Order Status to the desired target status.
Status updates are allowed regardless of the current status of the order, as long as the transition moves forward in the order lifecycle:
- ✅ Moving forward is accepted — e.g.
SHIPPED→COMPLETED. - ❌ Moving backward is rejected — e.g.
SHIPPED→DRAFT_ORDER.
This makes it possible to progress an order across several import files — for example, ship it in one file and complete it in a later one.
The order lifecycle sequence used as the reference for "forward" is described in Order lifecycle and statuses.
flowchart LR
%% Styles (Readme)
classDef create fill:#e8f1ff,stroke:#2f6feb,stroke-width:2px,color:#0b3d91;
classDef read fill:#ede9fe,stroke:#7c3aed,stroke-width:2px,color:#1e1b4b;
classDef update fill:#e0f7fa,stroke:#06b6d4,stroke-width:2px,color:#0c4a6e;
classDef decision fill:#fff4e5,stroke:#f59e0b,stroke-width:2px,color:#7a3e00;
classDef place fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#14532d;
classDef sys fill:#f2f4f7,stroke:#475569,stroke-width:2px,color:#111827;
classDef stop fill:#fee2e2,stroke:#ef4444,stroke-width:2px,color:#7f1d1d;
A[📦 Order Status<br>in the import file] --> B{Direction of the<br>transition}
B -->|Backward| S[⛔ Rejected<br>e.g. SHIPPED to DRAFT_ORDER]
B -->|Forward| C{Target is a<br>locking status}
C -->|Any other status| D[✅ Status updated]
C -->|SHIPPED or COMPLETED| E{Other operations<br>on the same order}
E -->|All succeeded| F[✅ Status updated<br>order lines locked]
E -->|At least one failed| G[⛔ Status not applied<br>error in the execution report]
class A sys
class B decision
class C decision
class E decision
class D place
class F place
class S stop
class G stop
style A rx:8,ry:8
style D rx:8,ry:8
style F rx:8,ry:8
style S rx:8,ry:8
style G rx:8,ry:8
Order lines are not required for status-only updates. A minimal payload containing only the order identifier and the new status is sufficient. When no order lines are provided, existing lines, addresses, and custom fields are preserved unchanged.
Locking statuses (SHIPPED,COMPLETED)Once an order reaches
SHIPPEDorCOMPLETED, its order lines can no longer be modified. To avoid locking an order with incomplete data, the transition to a locking status is applied only if all the other operations on the same order within the same import succeed — order field updates as well as order line operations (creation, update, deletion). If any of them fails, the status change is not applied and the execution report flags the error: fix the data and re-run the import.
If no order lines are provided and the referenced order does not exist, a validation error is returned.
Data format
Net Unit PriceandGross Unit Pricemust be numeric, using a dot (.) as decimal separator. Example:12.50Order Line Quantitymust be a positive integer. Example:3
Uniqueness
Order External IdandOrder Line External Idmust be unique across all orders.
Import execution order
The processing of imported data does not follow a strict FIFO order. If the same Order Line appears multiple times within a single import with different values, the final result may not reflect the last occurrence. Avoid sending duplicate Order Lines with conflicting updates within the same import execution.
Dependencies
- If both
Offer Price External IdandVariant External Idare provided, the variant must exist in DJUST and be linked to the provided offer. - If any shipping address field is provided (including
Shipping Address Stateor
Shipping Address (Additional)), thenFull Name,Country,Street Name,City
andZip Codeall become required. The imported address fully replaces the Account
address:StateorAdditionalalone cannot complement it.
Shipping and Billing Addresses
When an External Order is created via import, its addresses are resolved as follows:
- Shipping address: if at least one
Shipping Addressfield is provided, the address is built from the imported values (see the conditionally required fields above). Otherwise, the first shipping address associated with the Account is used. - Billing address: it is always the first billing address associated with the Account. The Orders import does not expose any billing address field, so the billing address cannot be set or overridden from the import file.
Billing address on updatesWhen updating an existing order, only the shipping address can be refreshed (by providing the
Shipping Addressfields). The billing address of an existing order is never modified by the import.
TipIf an Account has several billing addresses, make sure the one expected on orders is the first one linked to the Account, as the import does not allow selecting a specific billing address.
Store View Assignment
When an External Order is created via import, it is automatically assigned to the default store view of the default store.
However, in a multi-store context, you can target a specific store by configuring the storeExternalIds parameter on the import job (via POST /v2/mapper/jobs or PUT /v1/mapper/jobs/{jobId}). When a store is configured on an Order import job, all imported orders are automatically assigned to the default store view of the specified store.
If the configured store does not exist or is no longer valid, the job creation or update is rejected with an HTTP400error. If the store becomes invalid after the job is created, the execution report will flag the error.
Update rules based on Order Logistic status
| Action | Allowed if Order Logistic status is… |
|---|---|
| Add an Order Line | Before or equal to PARTIALLY_SHIPPED |
| Update an existing Order Line | Before or equal to PARTIALLY_SHIPPED |
| Delete an Order Line | Before or equal to PARTIALLY_SHIPPED |
Set Order External Id | Always allowed (applies to Internal Orders) |
Set Order Line External Id | Always allowed (applies to Internal Orders) |
Change Order Status | Any current status — the transition must move forward in the lifecycle (no regression). See Update an Order Status for the locking-status rule |
Custom Fields on Order Logistics and Order Lines
You can create or update Custom Field values on Order Logistics and Order Lines through this import job. Custom Fields allow you to enrich orders with business-specific metadata such as invoice numbers, tracking codes, or internal references.
Custom Field updates on orders are allowed regardless of the Order Logistic status — including SHIPPED, COMPLETED, or CANCELED. This means you can enrich or correct metadata at any point in the order lifecycle without being blocked by the logistic progression.
Tip: Use Custom Fields to attach business metadata (e.g. invoice number, tracking code) that needs to be updated after the order has been shipped or delivered.
General requirements
- An Order must contain at least one Order Line when creating a new order. For status-only updates on existing orders, order lines can be omitted.
- An Order Line from an External Order can reference a product not imported in DJUST.
- An External Order must reference at least one Supplier and one Account existing in DJUST.
Best Practices✔️ Always use
Order External Idwhen creating orders from an external system.✔️ Ensure the mapping matches DJUST's fields before running the import.
✔️ Validate data format (prices, quantities) before upload.
✔️ Avoid duplicate Order Lines with conflicting values in the same import file.
Updated 4 days ago

