Dry-run an edit and return the would-be order shape
Accepts the same payload as POST /api/v202604/orders//edits.
Runs the operations through the same editing engine as the commit
endpoint inside a database savepoint that is ALWAYS rolled back,
then returns the order with its recalculated current_* totals
reflecting the post-operation state.
Use this to render a “before / after” preview before committing the real edit — e.g. an admin Edit Order sheet showing the new totals before the user clicks Commit.
No persistence happens:
- order-edit audit records are not written
order_editedlifecycle event does NOT fire- subscribed webhooks do NOT receive the payload
order.updated_atdoes NOT advance
Authentication and authorization match the create endpoint
(orders.update, company-scoped). Validation and business errors
return the same shapes (400 / 422). Variant / item / discount
lookups still happen, so 422s match what a real commit would
produce — there is no “preview passed but commit failed” gap.
Authorizations
Bearer token authentication. Accepts company tokens, partner tokens,
public tokens, droplet installation tokens, and user_company tokens.
The authenticated credential determines editor_type and editor_id
on the resulting order-edit audit records — the payload never carries
either field.
Path Parameters
Primary-key id of the order to edit. Must belong to the authenticated company; an unknown id or an order owned by another company returns 404.
Body
One or more edit operations to apply atomically. The whole transaction commits or rolls back together.
1- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Optional optimistic-concurrency guard. When provided, the
server compares against the order's current updated_at
before applying any operations and returns HTTP 409 with
the current value on mismatch. Pass the ISO-8601 string
received in a prior order response verbatim. Callers that
don't load the order first can omit this and bypass the
check.
Response
Dry run succeeded. Returns the order with post-edit
current_* totals. The response carries dry_run: true at the
envelope level to make the no-persistence semantics explicit
on the wire.
Dry-run response for POST /api/v202604/orders/{order_id}/edits/preview.
Same shape as OrderResponse with an additional dry_run: true flag
on the envelope so consumers can statically confirm the no-persistence
semantics. The order object's current_* totals reflect the
hypothetical post-operation state.
The would-be order state, with current_* totals reflecting the hypothetical post-operation result. Not persisted.
Always true on preview responses. Distinguishes the preview payload from a committed edit response wire-side.
HTTP status code, repeated in the body (200 on a successful dry run).
Response metadata (request_id and timestamp).