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
orderIdas 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
| Endpoint | Method | Request schema | orderId behavior |
|---|---|---|---|
/p/{project}/cart/contractSummary | POST | ContractSummaryRequest | orderId optional – reuses existing context (e.g., validated cart) |
/p/{project}/directOrder/validate | POST | OrderRequest | orderId optional – validates using stored context |
/p/{project}/directOrder/submit | POST | OrderRequest | orderId optional – submits order using stored context |
Rules & best practices
Precedence and conflicts
- If
orderIdis 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
orderIdcontexts are typically not meant to be long-lived IDs.- An
orderIdis kept for 2 days after its last change; every call todirectOrder/validatewith theorderIdrestarts the 2 days. - Store
orderIdonly 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.