Skip to main content

Using orderId

Some endpoints in this API support an optional orderId.
It allows a request to reuse data that has already been collected and validated in earlier steps (e.g., address, availability checks, validated cart) and stored server-side. If an orderId is provided, you typically don’t need to send all data again, because it has already been determined in previous calls.

Important: Treat orderId as opaque (do not interpret it) and as a context reference for a single order/validation flow.


What is orderId?​

orderId is a server-generated identifier that references an intermediate state of the ordering flow.
It enables follow-up requests to be simplified because the API can reuse the results of earlier steps.

Typical context stored behind an orderId (depends on the flow step):

  • a prepared and/or validated cart
  • potentially derived data for contract summary or order validation

In fact orderId is a reference to an order that is not yet finalized.


How do I get an orderId?​

The API returns an orderId in responses where a context is created, especially:

  • Cart Validate: POST /p/{project}/cart/validate → data.orderId
  • Contract Summary: POST /p/{project}/cart/contractSummary → data.orderId

Core concept: “Full request” vs. “With orderId”​

Many requests can be used in two modes:

Without orderId (full request)​

You provide all required data in the request (e.g., address/businessProcess/cart/order data).
The API performs all necessary validations/enrichment for that call.

With orderId (reuse context)​

You provide an orderId from a previous step.
The API reuses already stored results and therefore requires less input.

Recommendation: Once you have an orderId, use it consistently for subsequent endpoints within the same flow.


Endpoints that support orderId​

EndpointMethodRequest schemaorderId behavior
/p/{project}/cart/contractSummaryPOSTContractSummaryRequestorderId optional – reuses existing context (e.g., validated cart)
/p/{project}/directOrder/validatePOSTOrderRequestorderId optional – validates using stored context
/p/{project}/directOrder/submitPOSTOrderRequestorderId optional – submits order using stored context

Rules & best practices​

Precedence and conflicts​

  • If orderId is provided, avoid sending redundant or potentially conflicting data.
  • If you still send fields that are already covered by the stored context, implementations may either:
    • prioritize the stored context (request data is ignored), or
    • reject the request due to inconsistencies.

Best practice: Use either the “full request” mode or the “with orderId” mode—avoid mixing. Hints will be provided in the API reference.

Lifetime / reusability​

  • orderId contexts are typically not meant to be long-lived IDs.
  • An orderId is kept for 2 days after its last change; every call to directOrder/validate with the orderId restarts the 2 days.
  • Store orderId only for the duration of the current flow.
  • If critical inputs change (address, provider, tariffs/cart), restart the flow and obtain a new orderId.
  • To submit orders later (e.g. in a batch), see Contract summary and deferred submission.

Error handling​

If the orderId is unknown or expired, expect 404; if it is inconsistent, expect another 4xx response (e.g., 400).
In that case: restart the flow and obtain a fresh orderId via Availability/Validate.