Skip to content

Get Customer Order

About

The customerOrder query retrieves detailed information for a specific order by its IRI identifier. Customers can only access their own orders — requesting another customer's order returns a not found error, preventing enumeration attacks. Use this query to:

  • Display detailed order information
  • Show order summary with line items and totals
  • Track order status and shipping details
  • View applied coupons and discounts
  • Display invoiced and refunded amounts

Authentication

This query requires customer authentication:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>
X-STOREFRONT-KEY: <storefrontKey>

Arguments

ArgumentTypeRequiredDescription
idID!✅ YesThe IRI identifier of the customer order (e.g. /api/shop/customer-orders/1).

Possible Returns

FieldTypeDescription
incrementIdString!Human-readable order number.
statusString!Order status: pending, processing, completed, canceled, closed, fraud.
channelNameString!Channel the order was placed on.
isGuestIntWhether the order was placed as guest.
customerEmailString!Customer email address.
customerFirstNameString!Customer first name.
customerLastNameString!Customer last name.
shippingMethodStringShipping method code.
shippingTitleStringShipping method display name.
couponCodeStringApplied coupon code.
isGiftIntWhether the order is a gift.
totalItemCountInt!Number of distinct items.
totalQtyOrderedInt!Total quantity ordered.
grandTotalFloat!Grand total.
baseGrandTotalFloat!Base grand total.
grandTotalInvoicedFloatGrand total invoiced.
baseGrandTotalInvoicedFloatBase grand total invoiced.
grandTotalRefundedFloatGrand total refunded.
baseGrandTotalRefundedFloatBase grand total refunded.
subTotalFloat!Sub total.
baseSubTotalFloat!Base sub total.
taxAmountFloatTax amount.
baseTaxAmountFloatBase tax amount.
discountAmountFloatDiscount amount.
baseDiscountAmountFloatBase discount amount.
shippingAmountFloatShipping amount.
baseShippingAmountFloatBase shipping amount.
baseCurrencyCodeString!Base currency code.
channelCurrencyCodeStringChannel currency code.
orderCurrencyCodeString!Order currency code.
itemsOrderItemConnectionPaginated list of order line items.
items.edges.node.idID!IRI identifier of the order item.
items.edges.node.skuString!Product SKU.
items.edges.node.nameString!Product name at time of order.
items.edges.node.additionalString (JSON)JSON-encoded string containing additional details captured at order time — selected attributes (e.g. color, size), booking slots, event tickets, configurable options, etc. The structure varies by product type.
items.edges.node.qtyOrderedInt!Quantity ordered.
items.edges.node.qtyShippedInt!Quantity shipped.
items.edges.node.qtyInvoicedInt!Quantity invoiced.
items.edges.node.qtyCanceledInt!Quantity canceled.
items.edges.node.qtyRefundedInt!Quantity refunded.
addressesOrderAddressConnectionPaginated list of order addresses.
addresses.edges.node.idID!IRI identifier of the address.
addresses.edges.node._idID!Internal address identifier.
addresses.edges.node.addressTypeString!Address type: billing or shipping.
addresses.edges.node.parentAddressIdIDParent address ID if applicable.
addresses.edges.node.customerIdIDAssociated customer ID.
addresses.edges.node.cartIdIDAssociated cart ID if applicable.
addresses.edges.node.orderIdIDAssociated order ID.
addresses.edges.node.nameStringFull name for the address.
addresses.edges.node.firstNameString!First name.
addresses.edges.node.lastNameString!Last name.
addresses.edges.node.companyNameStringCompany name.
addresses.edges.node.addressString!Street address.
addresses.edges.node.cityString!City name.
addresses.edges.node.stateStringState/Province code.
addresses.edges.node.countryString!Country code.
addresses.edges.node.postcodeStringPostal code.
addresses.edges.node.useForShippingBooleanWhether address is used for shipping.
addresses.edges.node.emailStringEmail address.
addresses.edges.node.phoneStringPhone number.
addresses.edges.node.genderStringGender.
addresses.edges.node.vatIdStringVAT ID for the address.
addresses.edges.node.defaultAddressBooleanWhether this is the default address.
createdAtDateTime!Order creation timestamp.
updatedAtDateTime!Order last update timestamp.

Order Item additional Field

The additional field on each order item is a JSON-encoded string that contains all the product-specific details captured at the moment of purchase. This is essential for displaying exactly what the customer selected on order confirmation, invoice, and order history pages. The structure of this field varies depending on the product type.

Product Typeadditional Contains
ConfigurableSelected attributes (e.g. Color, Size) with option_id, option_label, and attribute_name
Booking - Appointment / DefaultBooking date, slot range (e.g. "28 April, 2026 11:00 AM"), and time slot timestamps
Booking - RentalRental period (date_from, date_to) or hourly slot details
Booking - EventSelected event ticket types and quantities
Booking - TableReservation date, slot, and booking note
DownloadableSelected downloadable link IDs and titles
BundleSelected bundle option products and quantities

Example — Configurable Product

json
{
  "locale": "en",
  "quantity": 2,
  "attributes": [
    { "option_id": "2", "option_label": "Blue", "attribute_name": "Color" },
    { "option_id": "7", "option_label": "M", "attribute_name": "Size" }
  ],
  "is_buy_now": "0",
  "product_id": "22"
}

Example — Booking Appointment

json
{
  "locale": "en",
  "booking": {
    "date": "2026-04-28",
    "slot": "1777354200-1777356900"
  },
  "cart_id": 5144,
  "quantity": 1,
  "attributes": [
    { "option_id": 0, "option_label": "28 April, 2026 11:00 AM", "attribute_name": "Booking From" },
    { "option_id": 0, "option_label": "28 April, 2026 11:45 AM", "attribute_name": "Booking Till" }
  ],
  "is_buy_now": "0",
  "product_id": "2509"
}

Example — Booking Event

json
{
  "locale": "en",
  "booking": {
    "qty": { "7": "1", "8": "1" },
    "slot": "1775457000-1777530600",
    "ticket_id": 7
  },
  "cart_id": 5141,
  "quantity": 1,
  "attributes": [
    { "option_id": 0, "option_label": "Standard Entry Ticket", "attribute_name": "Event Ticket" },
    { "option_id": 0, "option_label": "06 April, 2026", "attribute_name": "Event From" },
    { "option_id": 0, "option_label": "30 April, 2026", "attribute_name": "Event Till" }
  ],
  "is_buy_now": "0",
  "product_id": "2508"
}

Always parse this field as JSON in your application. Use the attributes array to render selected options on order detail pages, and the booking object for booking-specific products.

Error Handling

Order Not Found

json
{
  "errors": [
    {
      "message": "Customer order with ID \"999\" not found.",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["customerOrder"]
    }
  ]
}

Unauthenticated Request

json
{
  "errors": [
    {
      "message": "Customer is not logged in.",
      "locations": [{ "line": 2, "column": 3 }],
      "path": ["customerOrder"]
    }
  ]
}

Use Cases

  • Display detailed order page in customer account
  • Show order summary with all financial details
  • Track shipping method and status
  • View applied coupons and discounts
  • Display invoiced and refunded amounts for order history

Notes

  • Customer isolation: A customer can never see another customer's orders. Requesting another customer's order returns a 404, preventing enumeration attacks.
  • Read-only: Only GET operations are available. Orders cannot be modified through this API.
  • Channel scoping: Orders are filtered by the customer's channel for multi-tenant isolation.

Released under the MIT License.