ORDER-108 - Create order

Create a new commercial order from an optional single source (OPERATION, QUOTE, ORDER, or CART).

⚠️ As of now, OPERATION and QUOTE are supported as sources.

Feature flag

  • Requires OPERATIONS to be enabled for OPERATION source path.

      **User scoping**<br>
      - Only `ACCOUNT` users are allowed.<br><br>
    
      **Store scoping**<br>
      - Effective store is `dj-store` header if provided; otherwise the tenant default store.<br>
      - Caller must be attached to the effective store; otherwise 403.<br><br>
    
      **Operation visibility (when `sourceType = OPERATION`)**<br>
      - Only `ACTIVE` Operations whose `now` is within `[startDate, endDate]` are eligible.<br>
      - `PUBLIC` are visible to all accounts on the store.<br>
      - `PRIVATE` requires an explicit association with the caller's account.<br><br>

Quote visibility (when sourceType = QUOTE)

  • The QUOTE must be valid (not expired/cancelled), belong to the caller's account, be in the effective store, and its status must be WAITING_FOR_CUSTOMER at call time.

Line selection

  • OPERATIONisFull = true (FULL): all eligible Operation lines are added during creation; if none eligible → 422.
  • OPERATIONisFull = false (PARTIAL): the order is created empty but linked to the Operation; lines are then added via ORDER-150 with Operation constraints enforced.
  • QUOTE — only isFull = true is supported: all quote lines are attempted; stock availability is the only product check; out-of-stock lines are ignored; if none remains → 422 / F-E-039.
    If isFull=false is provided for QUOTE → 422 / F-E-040 (Invalid field combination: order must be initialized from a full quote and not a partial one).

Post-creation state (when sourceType = QUOTE)

  • The order is created with status = DRAFT_ORDER_ON_HOLD and is not editable (lines are locked; calls like ORDER-150 must be rejected).
  • Payments: using PAY-101 is allowed; on successful payment the order transitions to CREATED (same as the standard payment workflow).
  • Manual validation (ORDER-212): must not be used if any payment is associated to the order; it is allowed only when no payment is associated, to validate the order without a payment (transition to CREATED).

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params

Flat request to create a commercial order from an optional single source.
When sourceId is provided, sourceType must be provided as well.
isFull defaults to true when a source is provided.
⚠️ As of now, OPERATION and QUOTE are supported as sources.

string

Identifier type for custom fields (e.g. EXTERNAL_ID, DJUST_ID).

customFields
array of objects

List of custom fields to attach to the order.

customFields
boolean

Line initialisation mode when a source is provided.

  • true (FULL): all eligible lines are added at creation time.
  • false (PARTIAL): creates an empty order linked to the source (supported for OPERATION; not supported for QUOTE).
  • For QUOTE, if explicitly set to false, the request is rejected as 422 / F-E-040 (Invalid field combination).
    If omitted when a source is provided, defaults to true.
string

External identifier of the source entity (e.g. Operation externalId).
Required when sourceType is provided.

string

Type of the source entity used to initialise the order.
Allowed values: OPERATION, QUOTE, ORDER, CART.
As of now, OPERATION and QUOTE are supported.

Headers
string
enum
required

Specifies the client type making the request.

  • OPERATOR: Platform operator user.

  • ACCOUNT: Customer account user.

  • SUPPLIER: Supplier managing orders.

Allowed:
string
required

API key required for authentication. Must be valid and linked to the requesting user.

string

(Optional) Store ID in multi-store environments.

string

(Optional) Store view ID in multi-store environments.

string

(Optional) Customer account ID in multi-account customer user.

Responses

401

Authentication failed.

403

Forbidden (client type not allowed, feature disabled, store or visibility constraints not met).

404

Source not found or not visible (e.g. Operation/Quote externalId is unknown or not accessible).

422

Unprocessable — no eligible lines, invalid quote status, or invalid field combination (e.g. sourceType=QUOTE with isFull=false), or other payload/validation issues.

500

Unexpected server error.

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json