Skip to content

Get Customer Orders

Return the order history of the authenticated customer.

Endpoint

GET /api/shop/customer-orders

Request Headers

HeaderRequiredDescription
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token of the logged-in customer

Query Parameters

ParameterTypeDescription
statusstringReturn only orders in this status. Matched exactly against the stored value.

Orders come back newest first, ten per response, and that page size is fixed — page, per_page, limit, and sort are accepted by the URL but have no effect on the result. Walk a longer history over GraphQL, where the same data is a cursor connection driven by first and after.

Response

The response is a bare JSON array of orders. There is no wrapper object, no data key, and no pagination metadata block.

FieldTypeDescription
idintegerOrder ID. Use it on Get Order Details.
incrementIdstringHuman-facing order number shown to the customer.
statusstringCurrent order status — see the list below.
channelNamestringSales channel the order was placed on.
customerEmailstringEmail captured on the order.
customerFirstName / customerLastNamestringName captured on the order.
shippingMethodstringMethod code, e.g. flatrate_flatrate.
shippingTitlestringHuman-readable method label.
couponCodestringCoupon applied at checkout, null when none was used.
totalItemCountintegerNumber of distinct line items.
totalQtyOrderedintegerSum of the quantities across those lines.
grandTotal / baseGrandTotaldecimalOrder total in the order currency and in the store's base currency.
subTotal / baseSubTotaldecimalLine-item total before tax, shipping, and discount.
taxAmountdecimalTax charged.
shippingAmountdecimalShipping charged.
discountAmountdecimalDiscount applied.
orderCurrencyCode / baseCurrencyCodestringCurrency the order was placed in, and the store's base currency.
createdAt / updatedAtstringISO 8601 timestamps.

Amounts are raw numbers, not formatted strings — apply the currency symbol from orderCurrencyCode on the client.

Order Status Values

StatusMeaning
pendingPlaced, payment not yet confirmed.
pending_paymentAwaiting an offline payment such as a bank transfer.
processingPayment confirmed, order being prepared.
completedFully invoiced and shipped.
canceledCanceled before fulfilment.
closedFully refunded.
fraudFlagged by the store as fraudulent.

Use Cases

  • Account order history — call the endpoint with no parameters and render the array; the newest order is already first, so no client-side sort is needed.
  • "Open orders" tab — a status filter is one value only, so an open-orders view needs one call per status (?status=pending, ?status=processing) merged on the client.
  • Reorder shortcutid from a row addresses Get Order Details, which carries the line items needed to rebuild a cart.

Best Practices

  • Read incrementId, not id, in the UIid is the internal row identifier and does not match the number on the customer's confirmation email.
  • Expect exactly ten rows — the endpoint neither paginates nor reports a total, so an account page needing the full history should use the GraphQL customerOrders connection.
  • Compare grandTotal against baseGrandTotal before displaying — they diverge whenever the order was placed in a non-base currency, and only grandTotal matches what the customer paid.
  • Treat an empty array as "no orders", not an error — a customer with no purchases and an unmatched status filter both return 200 with [].

Released under the MIT License.