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.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.

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.