Skip to main content
A credit note is an immutable accounting document that adjusts an already-issued invoice. Unlike a refund, which moves money, a credit note records the adjustment — it can pair with a refund, an out-of-band settlement, or both. On Node, npm install @ionicfi/sdk gives you typed calls for every request below; the server SDK guide has details. Each example also shows raw curl.

How credit notes work

1

Preview the credit note

Call POST /v1/credit_notes/preview with the invoice and amount to confirm the creditable remaining before committing. The preview returns the computed totals without persisting anything.
2

Issue the credit note

Call POST /v1/credit_notes with an Idempotency-Key. Provide either explicit lines or a shorthand amount. Specify how the credit is settled: via a linked refund, an out-of-band payment, or both. The settlement amounts must sum to the credit total.
3

Retrieve and distribute

Retrieve the credit note by ID or fetch its PDF for your buyer. The credit note is immutable once issued — only void changes its state.

Preview a credit note

Preview the computed totals before issuing. The response shows how much of the invoice can still be credited and whether your requested amount would exceed it.
The preview response includes:

Issue a credit note

Always send an Idempotency-Key — issuing a credit note can trigger a refund, and a double POST creates a double refund.

Request fields

amount_refunded and out_of_band_amount must sum to the credit total. If you supply only out_of_band_amount, the full settlement is recorded as out-of-band with no money movement initiated by Ionic.

Lines vs. amount

Use lines when you need to credit specific invoice line items or add a custom adjustment line:

Line item fields

Retrieve a credit note

List credit notes

The list endpoint accepts invoice, customer, and status as filters, plus limit and offset for pagination.

Void a credit note

Voiding marks a credit note as void and retains its number in the gapless sequence. Use this only when a credit note was issued in error.
Voiding a credit note does not reverse a linked refund. If money was already returned to the buyer, reverse it separately before voiding.

Fetch the PDF

The response streams the rendered PDF inline (Content-Type: application/pdf). Credit notes in test mode are labeled TEST-CN- in the document number.

Statuses

Webhooks

Ionic emits the following events for credit notes. See Webhook events for the full catalog.
Ionic auto-issues a credit note when you refund a charge that is linked to an invoice. The event handler is idempotent on refund_id — a credit note is never duplicated if the same refund triggers both a webhook and an explicit API call.

Operational guidance

  • Always call POST /v1/credit_notes/preview first when building a support or finance UI. Use would_exceed to gate the submit button before the user commits.
  • Send an Idempotency-Key on every POST /v1/credit_notes call. Use a key derived from your invoice ID and the reason for the adjustment so retries after network failures are safe.
  • Store your ticket or approval ID in metadata. That gives your finance team a join key between Ionic credit notes and your CRM or ERP records.
  • issued credit notes are immutable. If a credit note amount is wrong, void it and issue a corrected one — do not attempt to edit financial fields.
  • For VAT or audit purposes, the number field (CN-XXXXXX) is the document reference. In test mode it is prefixed TEST-CN- to distinguish from live records.