Skip to content

Get Customer Invoices

Retrieve all invoices belonging to the authenticated customer's orders. This is a read-only API — customers can only view their own invoices. Invoices are automatically scoped to the authenticated customer via the order relationship.

Endpoint

GET /api/shop/customer-invoices

Request Headers

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

Response Fields (200 OK)

The response is a plain JSON array of invoice objects.

FieldTypeDescription
idintegerInvoice ID
incrementIdstringHuman-readable invoice number (e.g. INV-001)
statestringInvoice state
totalQtyintegerTotal quantity of items in the invoice
emailSentbooleanWhether the invoice email was sent
subTotalfloatSub total
baseSubTotalfloatBase sub total
grandTotalfloatGrand total
baseGrandTotalfloatBase grand 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
baseCurrencyCodestringBase currency code (e.g. USD)
channelCurrencyCodestringChannel currency code
orderCurrencyCodestringOrder currency code
transactionIdstringPayment transaction ID
remindersintegerNumber of reminders sent
nextReminderAtstringNext reminder scheduled date
orderstringAssociated order IRI (e.g. /api/shop/customer-orders/1)
itemsarrayInvoice line item IRIs
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp

Invoice State Values

StateDescription
pendingInvoice created, awaiting action
pending_paymentPayment initiated but not yet confirmed
paidPayment received and confirmed
overduePayment past due date
refundedInvoice has been refunded

Empty Collection

When the customer has no invoices, an empty array is returned:

json
[]

Error Responses

Unauthenticated (401):

json
{
  "message": "Customer is not logged in."
}

Use Cases

  • Display invoice history in customer account dashboard
  • Show invoice list with state, totals, and dates
  • Track payment status across orders
  • View financial records

Notes

  • Read-only API: Only GET operations are available. Invoices cannot be created, updated, or deleted through this API.
  • Customer isolation: Invoices are scoped through the order relationship. A customer can never see another customer's invoices.
  • Relationships: In REST responses, relationships (order, items) are represented as IRIs (e.g. /api/shop/customer-orders/1).
  • Response format: The collection endpoint returns all matching invoices as a flat JSON array.

Released under the MIT License.