Use cases
End-to-end Order API scenarios, from creation to appeasements and finance ops.
End-to-end scenarios showing how the Checkout API could be used.
Quick Reference
Every call used across the scenarios below, with its purpose and whether it's safe for an agent to run autonomously (see agentic consumption for the human-in-the-loop reasoning behind each checkpoint).
POST
/Order
Create an order
Safe
GET
/Order/{ref}
Poll order status
Safe — read-only
POST
/Order/{ref}/Allocation
Assign line items to fulfilment centre(s)
Checkpoint — triggers label generation
POST
/Order/{ref}/LineItemActivity
Fulfil or cancel a specific line item
Safe (not separately addressed below — see note)
POST
/Order/{ref}/OrderActivity
Cancel the entire order
Checkpoint — reason code changes the refund path
POST
/Order/{ref}/Replacement
Batch replacement, ships new inventory
Checkpoint
POST
/Order/{ref}/LineItem
Single line item replacement
Checkpoint — same class as Replacement
POST
/Order/{ref}/Appeasement
Order-level refund
Checkpoint
POST
/Order/{ref}/LineItemAppeasement
Line-item refund
Checkpoint
PUT
/Order/{ref}/ContactDetails
Update delivery contact
Safe
PATCH
/Order/{ref}/LineItem
Product substitution
Safe
POST
/Order/{ref}/Comment
Internal note, no order-state effect
Safe
Before picking a reasonCode, activityStatus, actionedBy, appeasementsType, or contactDetailsType value
The Decision Tables page has a "use this when / do not use this when" row for every allowed value of these fields — it's the authoritative source for which value to pick, not the examples on this page. The examples below show one valid combination each; Decision Tables shows the full decision boundary.
01 - Order Lifecycle
Checkout Order — Standard Flow
Business Scenario
A shopper in Ireland completes checkout on your site. They purchase two items, pay with Apple Pay in EUR, and select standard delivery. Your OMS must create this order in ESW for cross-border fulfilment, duty calculation, and payment capture.
Sequence summary: POST /Order → store transactionReference (no API call) → GET /Order/{ref} (poll until Received)
Non-Checkout & Offline Orders
Business Scenario
Your warehouse management system creates orders directly from B2B purchase orders or phone orders. Use NonCheckoutEcommerce or Offline order types so ESW knows not to expect a pre-existing payment authorization.
Multi-Item Cart with Metadata
Business Scenario
A shopper orders 5 different products. Two are customized (monogrammed), one is return-prohibited (underwear), and the retailer needs to pass custom metadata (loyalty tier, gift wrap preference) that drives downstream processing logic.
Ship-from-Store & PUDO
Business Scenario
The shopper selects in-store pickup (PUDO) or the order ships from a physical retail store instead of a central warehouse. You must provide originDetails with the store address and use IsStoreDelivery for the contact type.
02 - Fulfilment
Warehouse Allocation
Business Scenario
After order creation, your fulfilment engine determines which warehouse(s) will ship each item. You must allocate each line item to a fulfilment country and optionally a specific fulfilment centre ID. This triggers downstream shipping label generation.
Split Shipment Fulfilment
Business Scenario
DC-LONDON-01 ships the sweater and one t-shirt today. DC-AMSTERDAM-02 will ship the second t-shirt tomorrow. You fulfil each batch separately using LineItemActivity with Fulfil status, targeting specific quantities.
Partial Fulfilment with Remaining Cancel
Business Scenario
A customer ordered 3 units of a product. The warehouse can only ship 2. You fulfil 2 and cancel the remaining 1 as out of stock — two separate LineItemActivity calls, one with Fulfil and one with Cancel.
Step 1 — Fulfil available:
activityStatus: "Fulfil",quantity: 2,reasonCode: "ItemFulfilled"
Step 2 — Cancel remainder:
activityStatus: "Cancel",quantity: 1,reasonCode: "OutOfStock"
03 - Cancellation
Shopper Cancels Entire Order
Business Scenario
The shopper contacts support within the cancellation window requesting a full order cancellation. The CS agent triggers a full order cancel via OrderActivity. All line items and articles are cancelled, and any captured payment is refunded.
Fraud Team Cancels Order
Business Scenario
Fraud detection flags an order. The fraud team cancels it using reasonCode: "Fraud" and actionedBy: "Retailer". This triggers a different refund path than a shopper cancellation
Line Item Cancellation
Business Scenario
The shopper wants to keep the sweater but cancel both t-shirts. You use LineItemActivity targeting line item 2 with the full quantity. Line item 1 remains unaffected.
Out-of-Stock Cancellation
Business Scenario
Cancel just 1 unit using reasonCode: "OutOfStock" with quantity: 1. The remaining article continues through fulfilment normally.
04 - Replacements
Lost Package — Full Reship
Business Scenario
Carrier tracking shows the package was lost in transit. The CS team creates a replacement order for all items. Since the package is lost, exchange: false — no return is expected from the shopper.
Damaged Goods — Exchange
Business Scenario
The sweater arrived with a defect. The shopper wants an exchange — same item, sent again. Since the shopper will return the damaged one, set exchange: true. This creates a return expectation in the system.
Wrong Item Sent — Different Product
Business Scenario
The warehouse shipped a size L instead of size M. The replacement order sends the correct size. Use replacementProduct to specify the new product details when the replacement differs from the original.
Single Line Item Replacement
Business Scenario
Replacing a single line item rather than a batch — use the dedicated POST /LineItem endpoint. Useful when your OMS processes replacements one item at a time.
05 - Appeasements
Late Delivery — Shipping Refund
Business Scenario
The order arrived 5 days late. Company policy grants a full shipping refund as appeasement. Use order-level appeasement with type: "Shipping" and the shipping charge amount.
Missed Promotion — Merchandise Credit
Business Scenario
A shopper complains they didn't receive a promotional discount that should have applied. CS issues a merchandise appeasement for the difference — €15 off.
Full Order Appeasement
Business Scenario
A VIP customer had a terrible experience — wrong items, late delivery, and poor communication. As a goodwill gesture, issue a full order appeasement for the maximum refundable amount in ESW.
Item-Level Appeasement
Business Scenario
One of the two t-shirts has a small stain. Rather than a full return, offer the shopper a 50% refund on that item. Use LineItemAppeasement to target a specific product and quantity with a partial amount.
06 - Updates & Ops
Delivery Address Correction
Business Scenario
The shopper realizes they entered the wrong apartment number. Before the order ships, the CS agent updates the delivery address. Only IsDelivery contact type is supported for updates.
Product Substitution (Line Item Update)
Business Scenario
The ordered charcoal sweater is discontinued. The warehouse offers a navy alternative at the same price. Use PATCH LineItem to swap the product code and record the reason.
Customer Service Agent Notes
Business Scenario
During a support call, the CS agent records internal notes on the order — the shopper mentioned the item is a gift, prefers email contact only, etc. These comments are persisted on the order for other agents to see.
07 - Agentic Consumption: Where to Checkpoint
Business Scenario
An AI agent is orchestrating Order API calls on behalf of an OMS or a support workflow — creating orders, allocating stock, handling cancellations, replacements, and appeasements without a human driving each call. Most of this API is safe to run autonomously. A small number of calls should require human confirmation before an agent executes them unsupervised.
Last updated
Was this helpful?