Skip to content

Get Customer Invoice

About

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

  • Display detailed invoice information
  • Show invoice summary with line items and totals
  • Track payment state and transaction details
  • View tax, shipping, and discount breakdowns
  • Display financial details for a specific invoice

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 invoice (e.g. /api/shop/customer-invoices/1).

Possible Returns

FieldTypeDescription
_idInt!Numeric invoice ID.
incrementIdString!Human-readable invoice number (e.g. INV-001).
stateString!Invoice state: pending, pending_payment, paid, overdue, refunded.
totalQtyInt!Total quantity of items in the invoice.
emailSentBooleanWhether the invoice email was sent.
grandTotalFloat!Grand total.
baseGrandTotalFloat!Base grand total.
subTotalFloat!Sub total.
baseSubTotalFloat!Base sub total.
shippingAmountFloatShipping amount.
baseShippingAmountFloatBase shipping amount.
taxAmountFloatTax amount.
baseTaxAmountFloatBase tax amount.
discountAmountFloatDiscount amount.
baseDiscountAmountFloatBase discount amount.
shippingTaxAmountFloatShipping tax amount.
baseShippingTaxAmountFloatBase shipping tax amount.
subTotalInclTaxFloatSub total including tax.
baseSubTotalInclTaxFloatBase sub total including tax.
shippingAmountInclTaxFloatShipping amount including tax.
baseShippingAmountInclTaxFloatBase shipping amount including tax.
baseCurrencyCodeString!Base currency code (e.g. USD).
channelCurrencyCodeStringChannel currency code.
orderCurrencyCodeString!Order currency code.
transactionIdStringPayment transaction ID.
remindersIntNumber of reminders sent.
nextReminderAtDateTimeNext reminder scheduled date.
createdAtDateTime!Invoice creation timestamp.
updatedAtDateTime!Invoice last update timestamp.
downloadUrlStringURL to download the invoice as PDF.

Error Handling

Invoice Not Found

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

Unauthenticated Request

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

Use Cases

  • Display detailed invoice page in customer account
  • Show full financial breakdown of an invoice
  • Track payment state and transaction ID
  • View tax and shipping details
  • Check if invoice email was sent

Notes

  • Customer isolation: Invoices are scoped through the order relationship. A customer can only access invoices from their own orders.
  • Read-only: Only query operations are available. Invoices cannot be modified through this API.

Released under the MIT License.