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.Issue a credit note
Always send anIdempotency-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
Uselines 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
invoice, customer, and status as filters, plus limit and offset for pagination.
Void a credit note
Voiding marks a credit note asvoid and retains its number in the gapless sequence. Use this only when a credit note was issued in error.
Fetch the PDF
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.Operational guidance
- Always call
POST /v1/credit_notes/previewfirst when building a support or finance UI. Usewould_exceedto gate the submit button before the user commits. - Send an
Idempotency-Keyon everyPOST /v1/credit_notescall. 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. issuedcredit 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
numberfield (CN-XXXXXX) is the document reference. In test mode it is prefixedTEST-CN-to distinguish from live records.

