Modules

Credit and Debit Notes

Credit notes and debit notes on issued invoices.

Overview

Requires the Credit notes or Debit notes module. A note always refers to an issued invoice and takes its number from its series when issued. A credit note lowers what the invoice owes (on a paid invoice the excess goes to the customer wallet); a debit note adds a charge. With the Fiscal module on, issued notes can also be issued as official tax documents.

Endpoints

MethodPathPermissionDescription
GET/v1/credit-notesreadList notes (invoice_id, customer_id, status)
POST/v1/credit-noteswriteCreate and issue a note (issue: false keeps a draft)
GET/v1/credit-notes/{id}readRetrieve a note with its lines
POST/v1/credit-notes/{id}/issuewriteIssue a draft (optional series_id)
POST/v1/credit-notes/{id}/voidadminVoid an issued note

Debit notes have the same endpoints under /v1/debit-notes.

Create a Credit Note

1curl -X POST "https://api.corebill.io/v1/credit-notes" \
2 -H "Authorization: Bearer sk_live_your_api_key" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "invoice_id": "inv_a1b2c3",
6 "reason": "return",
7 "return_to_stock": true,
8 "lines": [{ "invoice_item_id": "itl_a1b2c3", "item_name": "USB-C cable 2m", "quantity": 1, "unit_price": 12.5 }]
9 }'
  • Credit reasons: return, discount, error, other. Debit reasons: additional_charge, interest, error, other
  • Line prices are before tax, like invoice lines; the note uses the tax rate of the invoice
  • With invoice_item_id a credit note cannot credit more than what is left of that line
  • return_to_stock (credit notes, Inventory module) puts the products back in the warehouse of the sale
  • A credit note whose wallet balance was already used cannot be voided
  • Events: credit_note.issued, credit_note.voided, debit_note.issued, debit_note.voided