Retrieve invoices, their line items, payment status, and accounting details.
GraphQL
query GetInvoice($id: ID!) {
Invoice(id: $id) {
id
label
status
total
dated_at
due_at
customer { id label }
paid_amount
remaining_balance
line_items {
id
variant { id label }
quantity
price
}
}
}
GraphQL
query Invoices(
$where: QueryInvoicesWhereWhereConditions,
$orderBy: [QueryInvoicesOrderByOrderByClause!],
$search: String,
$first: Int,
$page: Int
) {
Invoices(
where: $where,
orderBy: $orderBy,
search: $search,
first: $first,
page: $page
) {
paginatorInfo {
total
currentPage
}
data {
id
label
status
dated_at
total
customer { id label }
}
}
}
Field Type Description idInt Unique identifier. labelString Invoice number. statusInvoiceStatus Payment and publication status. depositBoolean True if it's a deposit (down payment) invoice. exchange_rateFloat Exchange rate used. tax_typeTaxType Tax calculation method. default_discountFloat Global discount value. discount_typeDiscountType Discount type. total_unitsFloat Sum of all line item quantities. subtotalFloat Net amount before taxes and discounts. total_without_taxFloat Amount excluding taxes. total_ecotaxFloat Sum of environmental taxes. totalFloat Grand total including everything. paid_amountFloat Total amount received through payments. remaining_balanceFloat Unpaid balance remaining. dated_atDate Document date. due_atDate Deadline for payment. notesString Public notes displayed on the PDF. internal_notesString Hidden internal comments. for_the_attention_ofString Specific recipient name. external_referenceString Merchant internal reference. vat_payment_methodString VAT strategy (e.g. "on payments"). location_labelString Name of the warehouse/store. public_idString Secure token for external viewing. public_view_countInt Number of times viewed via public link. public_last_accessed_atJSON Timestamp of last public access. currencyCurrency Invoice currency. customerCustomer Associated customer. price_levelPriceLevel Applied price list. account_representativeAccountRepresentative Assigned sales rep. seasonSeason Business season. payment_informationPaymentInformation Bank details for payment. return_statusReturnStatus Goods return progress. credit_statusCreditStatus Credit note progress. returned_quantityFloat Quantity returned so far. unreturned_quantityFloat Quantity still pending return. credited_quantityFloat Quantity already credited. uncredited_quantityFloat Quantity still pending credit. credited_amountFloat Value already processed for credit. uncredited_amountFloat Value still pending credit. pdf_templatePdfTemplate Template used for generation. billing_addressAddress Document billing address. shipping_addressAddress Delivery address. line_items[LineItemInvoice] Detailed list of items. total_taxes[DocumentTaxRate] Summary of taxes. estimates_countInt Number of source estimates. estimates[Estimate] Linked estimates history. orders_countInt Number of source sales orders. orders[Order] Linked sales orders history. shipping_orders_countInt Number of linked deliveries. shipping_orders[ShippingOrder] Linked shipping orders history. product_returns_countInt Number of linked returns. product_returns[ProductReturn] Linked product returns history. credit_notes_countInt Number of linked credit notes. credit_notes[CreditNote] Linked credit notes history. invoice_payments[InvoicePayment] List of payment allocations. integrations[Integration] External platform links. email_histories[EmailHistory] Email logs. files[File] Attachments. has_batch_numbersBoolean True if invoice items use batch tracking. update_stockBoolean True if this invoice updates stock levels. custom_fields[EntityCustomField] Custom fields for this entity.
The following fields can be used in the where parameter:
id, label, status, currency, deposit, exchange_rate, tax_type, default_discount, discount_type, total_units, subtotal, total_without_tax, total_ecotax, total, dated_at, due_at, notes, internal_notes, for_the_attention_of, tracking_completed, created_at, updated_at, customer_id, price_level_id, account_representative_id, season_id, pdf_template_id, payment_information_id, paid_amount, remaining_balance, variant_id, variant_label, variant_sku, location_id, batch_number_id, returned_quantity, unreturned_quantity, credited_quantity, uncredited_quantity, credited_amount, uncredited_amount, estimates_count, orders_count, shipping_orders_count, product_returns_count, credit_note_count, product_tag_id, customer_tag_id, shipping_type, source, credit_note_id, payment_method_id, is_sent, return_status, credit_status.
Example Filters:
Field Example status{ "column": "STATUS", "operator": "EQ", "value": "unpaid" }remaining_balance{ "column": "REMAINING_BALANCE", "operator": "GT", "value": 0 }customer_id{ "column": "CUSTOMER_ID", "operator": "EQ", "value": 100050 }dated_at{ "column": "DATED_AT", "operator": "GTE", "value": "2025-01-01" }season_id{ "column": "SEASON_ID", "operator": "EXISTS", "value": 200001 }
You can sort results using the orderBy parameter:
id
label
status
dated_at
due_at
total
paid_amount
remaining_balance
You can group invoices using the groupBy parameter for reports:
Field Description idGroup by internal ID. yearGroup by year of dated_at. monthGroup by month of dated_at. dayGroup by day of dated_at.
Field Type Description fieldString Field that was validated. labelString Human-readable field label. validBoolean Whether the check passed. messageString Validation message.
Value Description unpublishedDraft status (hidden). draftDocument created, not yet published. unpaidPublished and awaiting payment. partially_paidPartial payment received. paidFully paid. cancelledDocument voided. sent_to_quickbooksExported to QB.
Value Description not_returnedDefault state. partially_returnedPartial returns linked. returnedFully returned.
Value Description not_creditedDefault state. partially_creditedActive credit notes linked. creditedFully credited.
Value Description acceptedE-invoice accepted. approvedE-invoice approved. collectedE-invoice collected. in_disputeE-invoice in dispute. partially_collectedE-invoice partially collected. refusedE-invoice refused. rejectedE-invoice rejected. sentE-invoice sent. submittedE-invoice submitted.
Value Description amountFixed discount amount. percentagePercentage-based discount.
Value Description exclusiveTax calculated on top of the net price. inclusiveTax included in the displayed price.
Value Description frFrench language for deposit invoice line items. enEnglish language for deposit invoice line items.