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:
The
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.1
cart
Customer has items in their cart. This is the starting state.
2
address
Customer provides shipping and billing addresses.
3
delivery
Customer selects a shipping rate for each shipment.
4
payment
Customer provides payment. Skipped if the order is fully covered by store credit.
5
confirm
Customer reviews and confirms the order.
6
complete
Order is placed.
completed_at is set and fulfillment begins.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
Fulfillment Statuses
The order’sfulfillment_status field summarizes the state of all fulfillments (the Store API/SDK exposes shipments as fulfillments).
For more details, see Shipments and Payments.
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)

