Skip to content

Get Customer Invoice

Retrieve detailed information for a specific customer invoice by its ID. Customers can only access invoices from their own orders — requesting another customer's invoice returns a 404, preventing enumeration attacks.

Endpoint

GET /api/shop/customer-invoices/{id}

Request Headers

HeaderRequiredDescription
Content-TypeYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer token (customer login required)

Path Parameters

ParameterTypeRequiredDescription
idintegerYesCustomer invoice ID

Response Fields (200 OK)

One invoice, flat. The field set is identical to a row of Get Customer Invoices — there is no extra detail on this endpoint.

FieldTypeDescription
idintegerInvoice ID.
incrementIdstringInvoice number shown to the customer.
statestringpending, pending_payment, paid, or overdue.
emailSentbooleanWhether the invoice email has gone out.
totalQtyintegerUnits covered by this invoice.
orderCurrencyCodestringCurrency the order was placed in.
subTotal / baseSubTotal / subTotalInclTax / baseSubTotalInclTaxfloatLine total, before and including tax.
grandTotal / baseGrandTotalfloatInvoice total.
shippingAmount / baseShippingAmount / shippingAmountInclTax / baseShippingAmountInclTaxfloatShipping charged.
taxAmount / baseTaxAmount / shippingTaxAmount / baseShippingTaxAmountfloatTax charged.
discountAmount / baseDiscountAmountfloatDiscount applied.
remindersintegerPayment reminders sent so far.
downloadUrlstringAbsolute URL of the PDF. It still requires both auth headers, so it is a request URL rather than a shareable link.
items / addressesarrayReferences to the invoice lines and the order's addresses.
createdAt / updatedAtstringISO 8601 timestamps.

The invoiced line items are available from the parent order's items block on Get Customer Order, and on the invoice PDF. Over GraphQL the customerInvoice query returns them as selectable nested objects.

Error Responses

StatusBody detailCause
404Customer invoice with ID "999999" not foundNo such invoice, or it belongs to another customer's order. The two cases are deliberately indistinguishable.
403Unauthenticated. Please login to perform this actionNo customer Bearer token was sent.
401The storefront key header was missing or wrong.

Use Cases

  • Invoice detail screen — read one invoice by the id carried in the list, and offer the PDF from downloadUrl.
  • Payment-status check — re-read after an offline payment to see state move from pending_payment to paid.

Best Practices

  • Fetch the list instead when showing several invoices — this endpoint returns no more fields than a list row, so per-invoice calls add nothing.
  • Read the line items from the parent order — the order detail carries them in full.
  • Treat 404 as "not yours or not there" — the message quotes the requested ID and is not proof the invoice is missing store-wide.

Released under the MIT License.