Overview
An order is the central model connecting a customer to their purchase. It collects line items, addresses, shipments, payments, and adjustments into a single transaction that flows through a checkout state machine from cart to completion. Key relationships:- Line Items link orders to Variants (what was purchased)
- Shipments handle fulfillment from stock locations
- Payments track payment attempts and their states
- Adjustments apply taxes, promotions, and shipping costs
- Addresses store billing and shipping information
Order Attributes
The API returns these key fields on every order:| Attribute | Description |
|---|---|
number | Unique order number (e.g., R123456789), shown to customers |
state | Current checkout state (cart, address, delivery, payment, confirm, complete) |
email | Customer’s email address |
currency | Order currency (e.g., USD) |
item_count | Total number of items |
item_total / display_item_total | Sum of line item prices |
ship_total / display_ship_total | Shipping cost |
tax_total / display_tax_total | Total tax |
promo_total / display_promo_total | Total discount from promotions |
adjustment_total / display_adjustment_total | Sum of all adjustments (tax + shipping + promos) |
total / display_total | Final order total |
payment_state | Payment status (balance_due, paid, credit_owed, failed, void) |
shipment_state | Shipment status (pending, ready, partial, shipped, backorder) |
completed_at | Timestamp when the order was placed |
display_* fields return formatted strings with currency symbols (e.g., "$15.99").
Cart
A cart is simply an order in thecart state. Guest carts are identified by a cart token; authenticated users’ carts are linked to their account.
Checkout Flow
The checkout is a state machine that advances the order through a series of steps. Each step collects required information before allowing the order to proceed.
If the order doesn’t meet the requirements for the next state (e.g., missing address), the API returns an error.
Coupon Codes
Apply or remove promotional coupon codes during checkout:Order History
Authenticated customers can view their past orders:Line Items
Line items represent individual products in an order. Each line item links to a Variant and tracks the quantity and price at the time of purchase. When a variant is added to an order, the price is locked on the line item. If the variant’s price changes later, existing orders are unaffected.Adjustments
Adjustments modify an order’s total — promotions decrease it, taxes and shipping increase it. Adjustments can be applied at the order level, the line item level, or the shipment level.Payment States
| State | Description |
|---|---|
balance_due | Payment total is less than the order total |
paid | Payment total equals the order total |
credit_owed | Payment total exceeds the order total (refund pending) |
failed | Most recent payment attempt failed |
void | Order was canceled and payments voided |
Shipment States
| State | Description |
|---|---|
pending | All shipments are pending |
ready | All shipments are ready to ship |
partial | At least one shipment is shipped, others are not |
shipped | All shipments have been shipped |
backorder | Some inventory is on backorder |
Related Documentation
- Payments — Payment processing and payment sessions
- Shipments — Fulfillment and shipping rates
- Addresses — Billing and shipping addresses
- Promotions — Discounts and coupon codes
- Checkout Customization — Customizing the checkout flow
- Events — Subscribe to order events (e.g.,
order.completed)

