Migration guide (Cart v2 → Order-based Checkout)

Purpose

Help teams move from Cart v2 (cart-centric) to Order-based Checkout (order-first, no technical cart). This page highlights key deltas, a before/after workflow, a capability and endpoint mapping, and a focused test checklist.


✨ What changes

  • No technical cart → everything is a Commercial Order (draft → placed).
  • Draft-only edits → after Place - ORDER-212, the Commercial Order is immutable; child Logistic Orders = CREATED and drive progression.
  • Dedicated address updates → shipping (ORDER-215) and billing (ORDER-213) are separate endpoints applied to the order and linked Logistic Orders.
  • Lines as services → edit via ORDER-150 (updateAction=ADD|REMOVE|REPLACE), delete via ORDER-350, read (ORDER-561). Header read is ORDER-500.
  • Start from a source → optional init from Operation or Quote via ORDER-108.
  • Legacy field: processing is not used in Order-based Checkout; ignore if you still see it.

🧭 Concept mapping

Cart v2 conceptOrder-based Checkout equivalentNotes
CartCommercial Order (DRAFT)Order-first; no separate cart object.
“Place order” on cartPlace - ORDER-212Locks Commercial Order; child Logistic Orders → CREATED.
Shipping/Billing inside cartUpdate shipping - ORDER-215 / Update billing - ORDER-213Dedicated calls; applied to order + all linked LOs.
Add/Remove items on cartAdd lines - ORDER-150 / Remove lines - ORDER-350Enforces min/max, pack, stock, visibility.
Read cart headerRead draft - ORDER-500Header only; lines via ORDER-561.
Read cart linesRead lines - ORDER-561Lines are read separately.
Initialize from promotion/listCreate draft - ORDER-108 with sourceTypeOPERATION or QUOTE (Quote = full only).
Cart flags (e.g., processing)IgnoredLegacy; don’t rely on it.

🗺️ Before/After workflow

flowchart LR
    subgraph V3 [Order-based checkout]
    direction LR
    O0[🆕 Create draft<br>ORDER-108]:::create --> O1[📘 Read draft<br>ORDER-500]:::read
    O1 --> O2{✏️ Edit lines?}:::decision
    O2 -->|Add| O3[➕ Add lines<br>ORDER-150]:::add
    O2 -->|Remove| O4[➖ Remove lines<br>ORDER-350]:::remove
    O3 --> O5[📄 Read lines<br>ORDER-561]:::read
    O2 -->|No| O5
    O4 --> O5
    O5 --> O7[📦 Update shipping<br>ORDER-215]:::update
    O5 --> O8[🧾 Update billing<br>ORDER-213]:::update 
    O7 --> O9[✅ Place order<br>ORDER-212<br>child LOs → CREATED]:::place
    O8 --> O9
	end

  subgraph V2 [Cart v2]
    direction LR
    C0[🛒 Create cart<br>CART-100]:::create --> C1[📘 Read cart<br>CART-500]:::read
    C1 --> C2{✏️ Edit lines?}:::decision
	C2 -->|Add| C3[➕ Add items from offers id<br>CART-150]:::add
    C2 -->|Add| C3b[➕ Add items from variants id<br>CART-151]:::add
    C2 -->|Remove| C4[➖ Remove lines<br>CART-350]:::remove
    C3 --> C5[🧾 Read cart<br>header+lines<br>CART-551]:::read
    C5 --> C6[🧾 Initialize order<br>CART-101]:::create
    C6 --> C10[🧾 Get commercial order<br>ORDER-500]:::read
    C3b --> C5
    C4 --> C5
    C2 -->|No| C5
    C10 --> C7[📦 Update shipping<br>ORDER-215]:::update
    C10 --> C8[🧾 Update billing<br>ORDER-213]:::update
    C7 --> C9[✅ Place order<br>ORDER-212<br>child LOs → CREATED]:::place
    C8 --> C9
  end



  %% Styles
  classDef create fill:#e8f1ff,stroke:#2f6feb,stroke-width:2px,color:#0b3d91;
  classDef read fill:#ede9fe,stroke:#7c3aed,stroke-width:2px,color:#1e1b4b;
  classDef update fill:#e0f7fa,stroke:#06b6d4,stroke-width:2px,color:#0c4a6e;
  classDef add fill:#ecfdf5,stroke:#10b981,stroke-width:2px,color:#064e3b;
  classDef remove fill:#fee2e2,stroke:#ef4444,stroke-width:2px,color:#7f1d1d;
  classDef decision fill:#fff4e5,stroke:#f59e0b,stroke-width:2px,color:#7a3e00;
  classDef place fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#14532d;

  style V2 rx:10,ry:10
  style V3 rx:10,ry:10

📚 Cart v2 → Order-based Checkout (endpoint mapping by capability)

Use this table to migrate code. Exact Order-based Checkout contracts and opIds live in API Reference.

Cart v2 (operationId & path)PurposeOrder-based Checkout equivalent
CART-100 - POST /v2/shop/cartsCreate a cartCreate draft - ORDER-108 (empty or from a source)
CART-550 - GET /v2/shop/cartsList carts in contextList Commercial Orders - ORDER-560
CART-500 - GET /v2/shop/carts/{cartId}Read one cart (header)Read draft - ORDER-500 (header only). Use Read lines - ORDER-561 for lines
CART-300 - DELETE /v2/shop/carts/{cartId}Delete one cartDelete Commercial Order - ORDER-300 (if exposed; otherwise uncommon)
CART-351 - DELETE /v2/shop/cartsDelete all carts in contextNo direct equivalent in Order-based Checkout. If needed, list drafts then delete individually
CART-101 - POST /v2/shop/carts/{cartId}/initialize-ordersInitialize orders from a cartNot needed in Order-based Checkout. Placement is ORDER-212; Logistic Orders are created by the flow
CART-150 - PUT /v2/shop/carts/{cartId}/linesAdd/update/delete lines on a cartAdd/Update lines - ORDER-150 and Remove lines - ORDER-350 (separate operations)
CART-151 - PUT /v2/shop/carts/{cartId}/lines-by-variantAdd/update/delete lines by product variantAdd/Update lines - ORDER-150
CART-350 - DELETE /v2/shop/carts/{cartId}/linesDelete cart linesRemove lines - ORDER-350
CART-551 - GET /v2/shop/carts/{cartId}/linesList cart lines (paginated)Read lines - ORDER-561

Test checklist (must pass)

AreaScenarioExpected
CreateORDER-108 empty / from Operation / from Quote201 with { id, reference } (Quote full only)
ReadORDER-500 header, ORDER-561 linesHeader excludes lines; lines endpoint returns items
AddressesORDER-215 shipping, ORDER-213 billing204; applied to order and linked Logistic Orders
LinesORDER-150 add/replace; ORDER-350 deleteMin/max, pack, stock, visibility enforced; proper 422 on invalid
PlaceORDER-212Order locked; child LOs become CREATED
ScopeWrong dj-client / store403 with appropriate codes

🔗 API quicklinks

See Working with Draft Orders for how to use each action. Contracts are in API Reference.