API reference
Credit notes
What customers are credited: issued against the invoice they correct, or kept as credit to apply to later invoices.
- GET
/v1/credit_notesList credit notes - POST
/v1/credit_notesWrite a draft credit note - GET
/v1/credit_notes/{credit_note_id}Get a credit note - PATCH
/v1/credit_notes/{credit_note_id}Change a draft credit note - DELETE
/v1/credit_notes/{credit_note_id}Delete a draft credit note - POST
/v1/credit_notes/{credit_note_id}/applyApply a credit note to invoices - POST
/v1/credit_notes/{credit_note_id}/issueIssue a credit note onto the books - POST
/v1/credit_notes/{credit_note_id}/voidVoid an issued credit note
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
| Name | Type | Description |
|---|---|---|
statusQuery | string or null | Only |
party_idQuery | string or null | An id that starts with |
limitQuery | integer | Page size, 1–200. |
cursorQuery | string or null | The |
Response
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 "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
Response
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 -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
| Name | Type | Description |
|---|---|---|
credit_note_idPath · Required | string | An id that starts with |
Response
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 "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
| Name | Type | Description |
|---|---|---|
credit_note_idPath · Required | string | An id that starts with |
Request body
Response
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 -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
| Name | Type | Description |
|---|---|---|
credit_note_idPath · Required | string | An id that starts with |
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 -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
| Name | Type | Description |
|---|---|---|
credit_note_idPath · Required | string | An id that starts with |
Request body
Response
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 -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
| Name | Type | Description |
|---|---|---|
credit_note_idPath · Required | string | An id that starts with |
Response
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 -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
| Name | Type | Description |
|---|---|---|
credit_note_idPath · Required | string | An id that starts with |
Request body
Response
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 -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
| Name | Type | Description |
|---|---|---|
dataRequired | array of CreditNoteOut | |
has_moreRequired | boolean | |
next_cursorRequired | string or null |
CreditNoteCreate
| Name | Type | Description |
|---|---|---|
issue_dateRequired | string (date) | |
linesRequired | array of CreditNoteLineIn | |
memo | string or null | |
number | string or null | Unique in these books; the next CN-0001-style number when left out. |
original_invoice_id | string or null | An id that starts with |
party_idRequired | string | The customer: a counterparty of these books. |
CreditNoteOut
| Name | Type | Description |
|---|---|---|
applied_toRequired | array of CreditAppliedOut | |
created_atRequired | string (date-time) | |
currencyRequired | string | |
customer_nameRequired | string or null | |
entry_idRequired | string or null | An id that starts with |
idRequired | string | An id that starts with |
issue_dateRequired | string (date) | |
issued_atRequired | string (date-time) or null | |
linesRequired | array of CreditNoteLineOut | |
memoRequired | string or null | |
numberRequired | string | |
original_invoice_idRequired | string or null | An id that starts with |
party_idRequired | string | An id that starts with |
row_versionRequired | integer | |
statusRequired | string |
|
subtotalRequired | string | |
tax_totalRequired | string | |
totalRequired | string | |
unappliedRequired | string | What is left of the credit to apply; 0 for a draft or a void credit note. |
void_entry_idRequired | string or null | An id that starts with |
voided_atRequired | string (date-time) or null |
CreditNoteUpdate
| Name | Type | Description |
|---|---|---|
issue_date | string (date) or null | |
lines | array of CreditNoteLineIn or null | |
memo | string or null | |
number | string or null | |
original_invoice_id | string or null | An id that starts with |
party_id | string or null | An id that starts with |
CreditNoteApply
| Name | Type | Description |
|---|---|---|
invoice_ids | array of string or null | The customer's invoices to apply it to; the oldest first when left out. |
CreditNoteVoid
| Name | Type | Description |
|---|---|---|
reason | string or null |
CreditNoteLineIn
| Name | Type | Description |
|---|---|---|
account_idRequired | string | The income (or deferred revenue) account it comes off. |
descriptionRequired | string | What is credited, as the customer reads it. |
quantity | number | string | Default 1 |
service_end | string (date) or null | |
service_start | string (date) or null | |
tax_amount | number | string | Must be 0 until tax is supported. |
unit_priceRequired | number | string |
CreditAppliedOut
| Name | Type | Description |
|---|---|---|
amountRequired | string | |
invoice_idRequired | string | An id that starts with |
numberRequired | string |
CreditNoteLineOut
| Name | Type | Description |
|---|---|---|
account_idRequired | string | An id that starts with |
amountRequired | string | |
descriptionRequired | string | |
line_noRequired | integer | |
quantityRequired | string | |
service_endRequired | string (date) or null | |
service_startRequired | string (date) or null | |
tax_amountRequired | string | |
unit_priceRequired | string |