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 |
email | Customer’s email address |
currency | Order currency (e.g., USD) |
total_quantity | Total number of items |
item_total / display_item_total | Sum of line item prices |
delivery_total / display_delivery_total | Delivery cost |
tax_total / display_tax_total | Total tax |
discount_total / display_discount_total | Total discount from promotions |
adjustment_total / display_adjustment_total | Sum of all adjustments (tax + delivery + promos) |
total / display_total | Final order total |
payment_status | Payment status (balance_due, paid, credit_owed, failed, void) |
fulfillment_status | Fulfillment 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:Managing Orders
Everything above is the Store API — the customer’s own cart and orders. Back-office order management (listing every order, creating phone/manual orders, capturing payments, cancelling) uses the Admin API.Listing and creating orders
List orders with Ransack filters and pagination (state_eq, limit, sorting). A draft order is created in one call; pass line items as items (each { variant_id, quantity }):
Order state actions
Orders move through their state machine via dedicated actions rather than rawstate writes:
Payments and refunds
Capture or void an authorized payment, and issue refunds, through the nested order resources: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 |
Fulfillment Statuses
The order’sfulfillment_status field summarizes the state of all fulfillments (the Store API/SDK exposes shipments as fulfillments).
| Status | Description |
|---|---|
pending | All fulfillments are pending |
ready | All fulfillments are ready to ship |
partial | At least one fulfillment is shipped, others are not |
shipped | All fulfillments have been shipped |
backorder | Some inventory is on backorder |
Related Documentation
- Cart, Checkout & Orders — Store SDK guide for carts, checkout, coupon codes, and order history
- 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)

