Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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).

Method
Endpoint
Purpose
Agent Safety

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.

actionedBy has four values in Decision Tables, three in the Create Order schema

Error handling — general

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.

1

Submit the order with full details

Include the brand order reference, both currency ISOs, the delivery country, contact details (delivery + payment), all line items with pricing, delivery option, and payment info.

2

Store the transaction reference

The 202 Accepted response returns the transactionReference. Persist this in your OMS for tracking and idempotent retries.

3

Poll for confirmation

Use GET /Order/WEB-20241014-8821 after a short delay. The order should appear with status: "Received" and each article in "Created" status.

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 allocation: Line item 2 has two articles allocated to different warehouses. This is common when inventory is split across DCs. Each article becomes an independent fulfilment unit.

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

A third order-level reason exists per Decision Tables: RetailerCancel, for operational or commercial cancellations initiated by the retailer rather than the shopper or a fraud review. Not shown as its own example here, but it follows the same OrderActivity shape with reasonCode: "RetailerCancel".

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

Human-in-the-loop exceptions

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.

Everything else in this API — order creation and status polling, ContactDetails updates, LineItem substitution, and Comment — is safe for an agent to execute without a confirmation gate, since a wrong call can be corrected with another call rather than causing irreversible financial or logistical impact. LineItemActivity (Fulfil/Cancel) isn't explicitly covered by this list either way — worth a deliberate decision if agents will drive it, since marking a line item Fulfil isn't something a follow-up call can take back.

Last updated

Was this helpful?