Retrieve credit notes issued to customers, including linked invoices.
CreditNote — Returns a single credit note by id
CreditNote — Returns a single credit note by idquery 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
CreditNotes — Returns a paginated list of credit notes with sorting and filtersquery 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
| Field | Type | Description |
|---|---|---|
id | Int | Unique identifier. |
label | String | Credit note number. |
status | CreditNoteStatus | Current status. |
dated_at | Date | Document date. |
tax_type | TaxType | Tax calculation method (Exclusive/Inclusive). |
total_units | Float | Total quantity of items credited. |
subtotal | Float | Value before taxes and discounts. |
total_without_tax | Float | Total excluding taxes. |
total_ecotax | Float | Environmental tax total. |
total | Float | Grand total of the credit note. |
exchange_rate | Float | Currency exchange rate. |
notes | String | Public notes for documents. |
internal_notes | String | Private internal notes. |
currency | Currency | Document currency. |
customer | Customer | Linked customer. |
account_representative | AccountRepresentative | Linked sales rep. |
price_level | PriceLevel | Applied price level. |
location_label | String | Origin location name. |
line_items | [LineItemCreditNote] | List of items credited. |
total_taxes | [DocumentTaxRate] | Summary of taxes applied. |
billing_address | Address | Associated billing address. |
product_returns_count | Int | Number of linked product returns. |
product_returns | [ProductReturn] | Source product returns. |
invoices_count | Int | Number of linked invoices. |
invoices | [Invoice] | Associated invoices. |
invoice_payables | [InvoicePayment] | Payment allocations. |
invoice_payments | [InvoicePayment] | Detailed payment link history. |
creditable | Float | Amount available for refund. |
season | Season | Business season. |
pdf_template | PdfTemplate | Design used for PDF generation. |
email_histories | [EmailHistory] | History of sent emails. |
files | [File] | Attached documents. |
integrations | [Integration] | External platform links. |
created_at | DateTime | Creation time. |
updated_at | DateTime | Last 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:
| Field | Example |
|---|---|
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:
idlabelstatustax_typetotal_unitstotal_without_taxtotal_ecotaxsubtotaltotalexchange_ratecurrencycustomer_idcustomer_labeldated_atcreated_at
Data Types
CreditNoteEInvoiceValidationResult
CreditNoteEInvoiceValidationResult| Field | Type | Description |
|---|---|---|
valid | Boolean | Whether the e-invoice is valid. |
checks | [EInvoiceValidationCheck] | List of validation checks performed. |
errors | [String] | List of validation errors. |
message | String | Validation message summary. |
credit_note | CreditNote | The validated credit note. |
Enums
CreditNoteStatus
CreditNoteStatus| Value | Description |
|---|---|
unpublished | Draft status (hidden). |
draft | Document created, not yet sent or processed. |
pending | Published and awaiting allocation. |
refunded | Balance fully settled with refund or invoice allocation. |
cancelled | Document voided. |
TaxType
TaxType| Value | Description |
|---|---|
exclusive | Tax calculated on top of the net price. |
inclusive | Tax included in the displayed price. |
