API reference

Credit notes

What customers are credited: issued against the invoice they correct, or kept as credit to apply to later invoices.

Guides: Bill customers with invoices

List credit notes

GET/v1/credit_notes

client.creditNotes.list()

The credit notes of these books, the newest first, each with what it is applied to and what is left.

Parameters

NameTypeDescription
statusQuerystring or null

Only draft, issued or void credit notes.

party_idQuerystring or null

An id that starts with party_.

limitQueryinteger

Page size, 1–200.

Default 50
cursorQuerystring or null

The next_cursor of the previous page.

Response

200CreditNotePage

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/credit_notes" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Write a draft credit note

POST/v1/credit_notes· Idempotent

client.creditNotes.create()

Write a draft credit note for a customer, for an invoice it corrects or on its own. Nothing is on the books until it is issued.

Request body

CreditNoteCreate

Response

201CreditNoteOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/credit_notes" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"issue_date":"2026-09-30","lines":[{"account_id":"…","description":"…","unit_price":0}],"party_id":"…"}'

Get a credit note

GET/v1/credit_notes/{credit_note_id}

client.creditNotes.get()

One credit note, its lines, what it is applied to and what is left.

Parameters

NameTypeDescription
credit_note_idPath · Requiredstring

An id that starts with cn_.

Response

200CreditNoteOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl "https://api.ledgerit.ai/v1/credit_notes/{credit_note_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN"

Change a draft credit note

PATCH/v1/credit_notes/{credit_note_id}· Idempotent

client.creditNotes.update()

Change a draft. An issued credit note is refused with conflict.

Parameters

NameTypeDescription
credit_note_idPath · Requiredstring

An id that starts with cn_.

Request body

CreditNoteUpdate

Response

200CreditNoteOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X PATCH "https://api.ledgerit.ai/v1/credit_notes/{credit_note_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Delete a draft credit note

DELETE/v1/credit_notes/{credit_note_id}· Idempotent

client.creditNotes.delete()

Delete a draft. An issued credit note is voided instead.

Parameters

NameTypeDescription
credit_note_idPath · Requiredstring

An id that starts with cn_.

Response

204No content

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X DELETE "https://api.ledgerit.ai/v1/credit_notes/{credit_note_id}" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Apply a credit note to invoices

POST/v1/credit_notes/{credit_note_id}/apply· Idempotent

client.creditNotes.apply()

Apply what is left of an issued credit note to the customer's invoices: those listed, or the oldest first.

Parameters

NameTypeDescription
credit_note_idPath · Requiredstring

An id that starts with cn_.

Request body

CreditNoteApply

Response

200CreditNoteOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/credit_notes/{credit_note_id}/apply" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Issue a credit note onto the books

POST/v1/credit_notes/{credit_note_id}/issue· Idempotent

client.creditNotes.issue()

Put a draft on the books: each line against the total off the customer's receivable. A credit note that corrects an invoice is applied to it at once, as far as the invoice is still open.

Parameters

NameTypeDescription
credit_note_idPath · Requiredstring

An id that starts with cn_.

Response

200CreditNoteOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/credit_notes/{credit_note_id}/issue" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)"

Void an issued credit note

POST/v1/credit_notes/{credit_note_id}/void· Idempotent

client.creditNotes.void()

Take an issued credit note off the books by reversing its entry. Refused with conflict while any of it is applied.

Parameters

NameTypeDescription
credit_note_idPath · Requiredstring

An id that starts with cn_.

Request body

CreditNoteVoid

Response

200CreditNoteOut

Errors

400
The request was malformed or a parameter is invalid.
401
No valid credential was sent.
403
The credential or the member's role does not allow this.
404
No such resource in this ledger.
409
A conflicting request, e.g. one with the same Idempotency-Key still running.
422
A well-formed request a business rule refused.
429
Too many requests; retry after the Retry-After header.
500
Something failed on our side; the request_id identifies it.

Example

curl
curl -X POST "https://api.ledgerit.ai/v1/credit_notes/{credit_note_id}/void" \
  -H "Authorization: Bearer $LEDGERIT_TOKEN" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'

Objects

The objects these operations take and return.

CreditNotePage

NameTypeDescription
dataRequiredarray of CreditNoteOut
has_moreRequiredboolean
next_cursorRequiredstring or null

CreditNoteCreate

NameTypeDescription
issue_dateRequiredstring (date)
linesRequiredarray of CreditNoteLineIn
memostring or null
numberstring or null

Unique in these books; the next CN-0001-style number when left out.

original_invoice_idstring or null

An id that starts with inv_.

party_idRequiredstring

The customer: a counterparty of these books.

CreditNoteOut

NameTypeDescription
applied_toRequiredarray of CreditAppliedOut
created_atRequiredstring (date-time)
currencyRequiredstring
customer_nameRequiredstring or null
entry_idRequiredstring or null

An id that starts with je_.

idRequiredstring

An id that starts with cn_.

issue_dateRequiredstring (date)
issued_atRequiredstring (date-time) or null
linesRequiredarray of CreditNoteLineOut
memoRequiredstring or null
numberRequiredstring
original_invoice_idRequiredstring or null

An id that starts with inv_.

party_idRequiredstring

An id that starts with party_.

row_versionRequiredinteger
statusRequiredstring

draft, issued or void.

subtotalRequiredstring
tax_totalRequiredstring
totalRequiredstring
unappliedRequiredstring

What is left of the credit to apply; 0 for a draft or a void credit note.

void_entry_idRequiredstring or null

An id that starts with je_.

voided_atRequiredstring (date-time) or null

CreditNoteUpdate

NameTypeDescription
issue_datestring (date) or null
linesarray of CreditNoteLineIn or null
memostring or null
numberstring or null
original_invoice_idstring or null

An id that starts with inv_.

party_idstring or null

An id that starts with party_.

CreditNoteApply

NameTypeDescription
invoice_idsarray of string or null

The customer's invoices to apply it to; the oldest first when left out.

CreditNoteVoid

NameTypeDescription
reasonstring or null

CreditNoteLineIn

NameTypeDescription
account_idRequiredstring

The income (or deferred revenue) account it comes off.

descriptionRequiredstring

What is credited, as the customer reads it.

quantitynumber | stringDefault 1
service_endstring (date) or null
service_startstring (date) or null
tax_amountnumber | string

Must be 0 until tax is supported.

Default 0
unit_priceRequirednumber | string

CreditAppliedOut

NameTypeDescription
amountRequiredstring
invoice_idRequiredstring

An id that starts with inv_.

numberRequiredstring

CreditNoteLineOut

NameTypeDescription
account_idRequiredstring

An id that starts with gla_.

amountRequiredstring
descriptionRequiredstring
line_noRequiredinteger
quantityRequiredstring
service_endRequiredstring (date) or null
service_startRequiredstring (date) or null
tax_amountRequiredstring
unit_priceRequiredstring