Skip to content

Get Invoice

GraphQL counterpart of GET /api/admin/invoices/{id}. Returns a single invoice with the full totals breakdown, the order/customer context, the billing & shipping addresses, and the invoiced line items — everything the listing leaves out.

Operation

OperationType
adminInvoice(id: ID!)Query

Pass the invoice IRI (/api/admin/invoices/{id}) as id. Requires the sales.invoices.view permission. All admin endpoints require an admin Bearer token — see Authentication.

Identifier vs IRI

id is the resource IRI (/api/admin/invoices/1); _id is the plain numeric id (1). Use the IRI for the id argument.

Objects & lists are returned whole

billingAddress, shippingAddress, and items are returned as JSON — query them bare, without a sub-selection (items, not items { … }). The whole object/array comes back with all the keys documented below. (items is not a cursor connection — there is no edges { node { … } } wrapper.)

Invoice fields

FieldTypeDescription
idIDResource identifier (IRI form).
_idIntNumeric invoice id.
incrementIdStringHuman-facing invoice number.
orderIdIntId of the parent order.
orderIncrementIdStringHuman-facing number of the parent order.
stateStringInvoice state — pending, pending_payment, paid, overdue.
emailSentBooleanWhether the invoice email was sent to the customer.
totalQtyIntTotal quantity invoiced.

Currency codes

FieldTypeDescription
orderCurrencyCodeStringCurrency the order/invoice was placed in (e.g. USD).
baseCurrencyCodeStringThe store's base currency.
channelCurrencyCodeStringThe sales channel's currency.

Totals

Every money total is provided in the order currency and the store's base currency, each with a formatted* string carrying the currency symbol. Sub-total and shipping additionally expose an incl-tax variant.

FieldTypeDescription
subTotal / formattedSubTotalFloat / StringLine-items subtotal (order currency).
baseSubTotal / formattedBaseSubTotalFloat / StringSubtotal (base currency).
subTotalInclTax / formattedSubTotalInclTaxFloat / StringSubtotal including tax (order currency).
baseSubTotalInclTax / formattedBaseSubTotalInclTaxFloat / StringSubtotal including tax (base currency).
grandTotal / formattedGrandTotalFloat / StringInvoice total (order currency).
baseGrandTotal / formattedBaseGrandTotalFloat / StringInvoice total (base currency).
taxAmount / formattedTaxAmountFloat / StringTax total (order currency).
baseTaxAmount / formattedBaseTaxAmountFloat / StringTax total (base currency).
discountAmount / formattedDiscountAmountFloat / StringDiscount total (order currency).
baseDiscountAmount / formattedBaseDiscountAmountFloat / StringDiscount total (base currency).
shippingAmount / formattedShippingAmountFloat / StringShipping total (order currency).
baseShippingAmount / formattedBaseShippingAmountFloat / StringShipping total (base currency).
shippingAmountInclTax / formattedShippingAmountInclTaxFloat / StringShipping incl. tax (order currency).
baseShippingAmountInclTax / formattedBaseShippingAmountInclTaxFloat / StringShipping incl. tax (base currency).
shippingTaxAmount / formattedShippingTaxAmountFloat / StringTax on shipping (order currency).
baseShippingTaxAmount / formattedBaseShippingTaxAmountFloat / StringTax on shipping (base currency).

Status & timestamps

FieldTypeDescription
transactionIdStringPayment transaction reference (null until captured).
remindersIntNumber of payment reminders sent (for pending invoices).
nextReminderAtStringWhen the next payment reminder is scheduled (null if none).
createdAtStringWhen the invoice was created.
updatedAtStringWhen the invoice was last updated.

Order & customer context

Resolved from the parent order so the invoice can be rendered without a second call.

FieldTypeDescription
orderStatusStringParent order status code (e.g. processing).
orderStatusLabelStringHuman-readable order status.
orderDateStringWhen the parent order was placed.
channelNameStringSales channel the order belongs to.
customerNameStringCustomer's full name.
customerEmailStringCustomer's email.

Addresses (billingAddress, shippingAddress)

JSON objects (query bare). Each contains:

KeyTypeDescription
idIntAddress id.
addressTypeStringorder_billing or order_shipping.
firstName / lastNameStringRecipient name.
companyNameStringCompany (nullable).
addressStringStreet address.
city / state / country / postcodeStringLocation.
email / phoneStringContact details.

Line items (items)

JSON array (query bare). Each element contains:

KeyTypeDescription
idIntInvoice-item id.
orderItemIdIntId of the order item this line was invoiced from.
skuStringProduct SKU.
nameStringProduct name as ordered.
qtyIntQuantity invoiced for this line.
price / formattedPriceFloat / StringUnit price (order currency).
basePriceFloatUnit price (base currency).
basePriceInclTaxFloatUnit price incl. tax (base currency).
total / formattedTotalFloat / StringLine total (order currency).
baseTotalFloatLine total (base currency).
baseTotalInclTaxFloatLine total incl. tax (base currency).
taxAmount / formattedTaxAmountFloat / StringTax for this line.
discountAmount / formattedDiscountAmountFloat / StringDiscount for this line.
productIdIntId of the product.
productTypeStringProduct type — simple, configurable, bundle, etc.
baseImageUrlStringURL of the product's base image (null if none).
additionalJSONExtra item data (selected options, configurable attributes, etc.).

Released under the MIT License.