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
💡

Order Data Model

In 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.

📄

Template

You can use the following spreadsheet as a template to structure your import:

Orders - Template


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

FieldDefinitionRequired for creationRequired for updateEditableDefault Value
Order External IdUnique external reference of the Order☑️ (Unless Order Reference is provided)✅ (Only if the value is not yet set for Internal Orders)
Order ReferenceUnique DJUST reference of the Order☑️ (Unless Order External Id is provided)
Order StatusRepresents the current state of the Order Logistic in its lifecycle. This status determines whether the order can still be modifiedORDER_DRAFT_ON_HOLD
Order Line External IdUnique 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 IdUnique DJUST reference of the Order Line☑️ (Unless Order Line External Id is provided)
Account External IdUnique external reference of the Account provided in DJUST
Customer External IdUnique external reference of the Customer provided in DJUSTIf not provided, the order is linked with the first Customer User associated with the Account External Id
Supplier External IdUnique external reference of the Supplier provided in DJUST
Order Line QuantityThe number of units ordered for the given product (Order Line)
Net Unit PriceThe unit price of the product excluding taxes☑️ (Unless Offer Price External Id is provided)☑️ (Unless Offer Price External Id is provided)
Gross Unit PriceThe unit price of the product including taxes
Tax AmountThe tax amount per unit
Offer Price External IdExternal 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 IdExternal 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 NameThe 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 DJUSTThe one associated with the Variant External Id
Variant DescriptionA free-text description of the product variant, provided by the source system. Stored for informational purposes only, not validated against any product data in DJUSTThe one associated with the Variant External Id
Classification External IdUnique external reference of the Classification associated with the Variant External IdThe one associated with the Variant External Id
Shipping Address Full NameThe 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 CountryThe 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 NameThe 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 CityThe 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 CodeThe 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 StateThe 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 DeletionBoolean flag used to indicate that the order line should be removed from the orderFALSE
☑️

Conditionally required

¹ These fields become required if at least one of them is provided. This rule does not apply to Shipping Address State or Shipping Address (Additional).

⚠️

Required Custom Fields

Any custom fields configured as required in DJUST must also be included.


Order Identification

Each order must be identified using at least one of the following fields:

FieldDescription
Order External IdUnique external identifier of the order
Order ReferenceDJUST reference of the order

If both are provided, Order Reference takes precedence.

💡

Order External Id is mandatory when creating an order. Order Reference can 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:

FieldDescription
Order Line External IdExternal identifier of the order line
Order Line IdInternal DJUST identifier of the order line

To create a new line, Order Line External Id is 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 must follow the order lifecycle sequence.

Data format

  • Net Unit Price and Gross Unit Price must be numeric, using a dot (.) as decimal separator. Example: 12.50
  • Order Line Quantity must be a positive integer. Example: 3

Uniqueness

  • Order External Id and Order Line External Id must 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 Id and Variant External Id are provided, the variant must exist in DJUST and be linked to the provided offer.
  • If any shipping address field is provided (Full Name, Country, Street Name, City, or Zip Code), then all of them become required.

Update rules based on Order Logistic status

ActionAllowed if Order Logistic status is…
Add an Order LineBefore or equal to PARTIALLY_SHIPPED
Update an existing Order LineBefore or equal to PARTIALLY_SHIPPED
Delete an Order LineBefore or equal to PARTIALLY_SHIPPED
Set Order External IdAlways allowed (applies to Internal Orders)
Set Order Line External IdAlways allowed (applies to Internal Orders)
Change Order StatusAlways allowed (must follow the lifecycle sequence)

General requirements

  • An Order must contain at least one Order Line.
  • 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 Id when 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.