Credit Notes Queries

Retrieve credit notes issued to customers, including linked invoices.

CreditNote — Returns a single credit note by id

query GetCreditNote($id: ID!) {
  CreditNote(id: $id) {
    id
    label
    status
    dated_at
    total
    currency { id label }
    customer { id label }
    line_items {
      id
      variant { id label }
      quantity
      price
    }
  }
}

CreditNotes — Returns a paginated list of credit notes with sorting and filters

query CreditNotes(
  $where: QueryCreditNotesWhereWhereConditions,
  $orderBy: [QueryCreditNotesOrderByOrderByClause!],
  $search: String,
  $first: Int,
  $page: Int
) {
  CreditNotes(
    where: $where,
    orderBy: $orderBy,
    search: $search,
    first: $first,
    page: $page
  ) {
    paginatorInfo {
      total
      currentPage
    }
    data {
      id
      label
      status
      dated_at
      total
      customer { id label }
    }
  }
}

Available fields

FieldTypeDescription
idIntUnique identifier.
labelStringCredit note number.
statusCreditNoteStatusCurrent status.
dated_atDateDocument date.
tax_typeTaxTypeTax calculation method (Exclusive/Inclusive).
total_unitsFloatTotal quantity of items credited.
subtotalFloatValue before taxes and discounts.
total_without_taxFloatTotal excluding taxes.
total_ecotaxFloatEnvironmental tax total.
totalFloatGrand total of the credit note.
exchange_rateFloatCurrency exchange rate.
notesStringPublic notes for documents.
internal_notesStringPrivate internal notes.
currencyCurrencyDocument currency.
customerCustomerLinked customer.
account_representativeAccountRepresentativeLinked sales rep.
price_levelPriceLevelApplied price level.
location_labelStringOrigin location name.
line_items[LineItemCreditNote]List of items credited.
total_taxes[DocumentTaxRate]Summary of taxes applied.
billing_addressAddressAssociated billing address.
product_returns_countIntNumber of linked product returns.
product_returns[ProductReturn]Source product returns.
invoices_countIntNumber of linked invoices.
invoices[Invoice]Associated invoices.
invoice_payables[InvoicePayment]Payment allocations.
invoice_payments[InvoicePayment]Detailed payment link history.
creditableFloatAmount available for refund.
seasonSeasonBusiness season.
pdf_templatePdfTemplateDesign used for PDF generation.
email_histories[EmailHistory]History of sent emails.
files[File]Attached documents.
integrations[Integration]External platform links.
created_atDateTimeCreation time.
updated_atDateTimeLast update time.
custom_fields[EntityCustomField]Custom fields for this entity.

Filters

The following fields can be used in the where parameter:

id, label, status, tax_type, total_units, total_without_tax, total_ecotax, subtotal, total, exchange_rate, notes, internal_notes, currency, customer_id, account_representative_id, price_level_id, pdf_template_id, created_at, dated_at, updated_at, season_id, product_returns_count, invoices_count, variant_id, variant_label, variant_sku, product_tag_id, customer_tag_id, location_id, is_sent.

Example Filters:

FieldExample
status{ "column": "STATUS", "operator": "EQ", "value": "pending" }
customer_id{ "column": "CUSTOMER_ID", "operator": "EQ", "value": 100050 }
dated_at{ "column": "DATED_AT", "operator": "GTE", "value": "2025-01-01" }

Sorting

You can sort results using the orderBy parameter:

  • id
  • label
  • status
  • tax_type
  • total_units
  • total_without_tax
  • total_ecotax
  • subtotal
  • total
  • exchange_rate
  • currency
  • customer_id
  • customer_label
  • dated_at
  • created_at


Data Types

CreditNoteEInvoiceValidationResult

FieldTypeDescription
validBooleanWhether the e-invoice is valid.
checks[EInvoiceValidationCheck]List of validation checks performed.
errors[String]List of validation errors.
messageStringValidation message summary.
credit_noteCreditNoteThe validated credit note.

Enums

CreditNoteStatus

ValueDescription
unpublishedDraft status (hidden).
draftDocument created, not yet sent or processed.
pendingPublished and awaiting allocation.
refundedBalance fully settled with refund or invoice allocation.
cancelledDocument voided.

TaxType

ValueDescription
exclusiveTax calculated on top of the net price.
inclusiveTax included in the displayed price.