Credit notes
A credit note documents a correction to an issued invoice. Each note belongs to one invoice and preserves the discount and tax share of its frozen lines. Allocate its credit against an outstanding balance, or create a linked refund on a paid invoice.
Use a credit note when the invoice itself overstated what the buyer owes and you want a numbered document that records the correction. Other corrections have their own tools:
| Situation | Use |
|---|---|
| The invoice is still a draft | Edit the invoice |
| Goods come back and you want receiving, restocking, and the refund handled | A return. Returns and credit notes share each invoice line's remaining value. |
| Money goes back, but the invoice was right | A refund on the order |
The Credit notes guide walks through each flow with full requests and responses.
Lifecycle#
You create a note against an invoice that has been issued and isn't void. The note starts as a draft and moves forward only.
- draft on edit: lines, reason, and memo can change
- draft moves to issued on issue
- issued on allocate, reverse, or refund: the credit moves; the document doesn't change
- issued moves to void on void
status on credit notedraftEditable. It has nocredit_note_number, no PDF, and reserves no credit. Drafts can't be deleted or voided; to abandon one, leave it or empty it withPATCHand"line_items": [].issuedNumbered and frozen. Issuing assignscredit_note_number, stampsissued_at, copies the tax identities from the invoice, and renders the PDF. Lines and totals never change again; only the money fields move as you allocate or refund.voidFinalRetired. Its corrections stop counting against the invoice lines, andavailable_moneyis 0. Reverse every allocation first. A note with a pending or succeeded refund can't be voided.
An issued note blocks voiding its invoice. Void the note before you void the invoice.
Where the credit goes#
Issuing a note on its own moves no money and leaves the invoice balance unchanged. The body of POST /v1/credit-notes/{credit_note_id}/issue decides what happens to the credit:
| Issue body | Effect | Invoice status it needs |
|---|---|---|
| Empty | Issues the note only | Any issued, non-void status |
allocation | Issues the note and applies credit to the balance. If the allocation is refused, the note stays a draft. | open or partially_paid |
refund | Issues the note and refunds credit to the invoice's original payments. refund.reason is required. | paid |
allocation and refund can't be combined in one issue request (400 INVALID_REQUEST, param: allocation). Leave out their amount_money to use as much credit as fits: an allocation applies the smaller of the note's credit and the invoice's outstanding balance, and a refund refunds all of the note's available credit. The response returns the note at data.credit_note and the invoice after issue at data.invoice, plus data.credit_note_allocation or data.refund when you asked for one.
From a note that's already issued, POST /v1/credit-notes/{credit_note_id}/allocations applies credit and requires amount_money, and POST /v1/credit-notes/{credit_note_id}/refunds refunds it, with amount_money optional. The refund call returns the Refund at data.
curl -X POST https://api.withflintpay.com/v1/credit-notes/cn_01KF4B2C6D8E0F2G4H6J8K0M2N/issue \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: issue-cn-inv-1042-1" \
-d '{"expected_version": 1, "allocation": {}}'
Allocations lower the invoice's outstanding_money and raise its credit_money. One that takes the balance to zero closes the invoice: it becomes paid when positive net collection remains, and credited when there is none. Allocations are append-only. Reversing one keeps its record with reversed_at set, returns the amount to the note, and reopens that much of the balance. An invoice that the allocation closed goes back to open or partially_paid. Credit never pays an order's unpaid tip or late fees; see Limits on an allocation.
Refunds go back to the payments collected through Flint on the invoice, not to manually recorded payments. The invoice stays paid, and its refunded_money and refund_status track the refund. Each refund carries credit_note_id and invoice_id, and the note's latest_refund_status follows the most recent one.
The note's money fields#
Five fields track where an issued note's value sits, and they always balance: total_money = allocated_money + pending_refund_money + refunded_money + available_money. A reversed allocation moves its amount from allocated_money back to available_money. A refund holds its amount in pending_refund_money until it resolves, then moves it to refunded_money if it succeeds, or back to available_money if it fails or is canceled.
For example, a $120.00 note applied $80.00 to the invoice. The buyer paid the rest, and a $25.00 refund from the note hasn't resolved yet:
- Allocated
allocated_money$80.00 - Pending refund
pending_refund_money$25.00 - Refunded
refunded_money$0.00 - Available
available_money$15.00 - Total
total_money$120.00
How line amounts are calculated#
Each line names one invoice_line_item_id, at most once per note, and a correction of type quantity (whole units) or amount (a billed value in the invoice currency). Flint calculates from the invoice line as it was frozen at issue, so later catalog prices and tax settings play no part. Credit notes correct merchandise lines only, not charges, tips, or late fees.
- Shared remaining value. Each invoice line has one remaining pool of billed value, units, discount, and tax. Issued, non-void credit notes and committed return lines draw from it, so together they never exceed what the line billed. Drafts reserve nothing. Allocations, reversals, and refunds don't change the pool; voiding a note gives its corrections back.
- Proportional tax and discount. A correction takes its proportional share of the line's remaining tax and discount, each rounded half up in minor units, and
subtotal_moneybalances the line. An amount correction uses up value without using up units, so later quantity corrections divide the reduced value. - The source line's tax mode. With added tax,
total_money = subtotal_money - discount_money + tax_money. With included tax,total_money = subtotal_money - discount_money. Either way, the amount before tax istotal_money - tax_money. - Round-trip lines. Every read line returns the
correctionthat produced it, in the shape draft writes accept. To replace a draft's lines, send them back inPATCHline_items, each with itscredit_note_line_item_id.
See How Flint calculates each line for worked rounding examples and the line errors.
Retries and versions#
| Calls | Idempotency-Key |
|---|---|
| Issue, allocate, refund | Required. Flint keeps the key for as long as the call's effects exist. |
| Create, update, reverse, void | Optional. Flint keeps the key for 24 hours. |
Retrying with the same key and body returns the original result, and a different body returns 409 IDEMPOTENCY_KEY_REUSED. To recover a lost response, list the note's allocations or refunds filtered by idempotency_key. An allocation made on issue has the key issue: followed by the issue request's key, so filter allocations by idempotency_key=issue:<your key>. A refund made on issue keeps your key as it is.
Every note has a version. Issue, allocate, reverse, refund, and void accept an optional expected_version, and replacing a draft's line_items requires it. A stale version returns 409 VERSION_CONFLICT with details[0].current_version. Allocations, reversals, and refund outcomes all move the version, so read it from the latest response.
Because drafts reserve nothing, another note or return can use up the same invoice lines before you issue. Issue never changes the amounts the draft previewed:
- If the stored corrections still fit but their amounts would change, issue returns
409 VERSION_CONFLICTwith the credit note'scurrent_version. Read the note and send the request again with a newIdempotency-Key. - If they no longer fit, issue returns
409 ACTION_NOT_ALLOWEDwith reasonnot_offered.
For either, refresh the draft: retrieve it, resend its corrections with PATCH and the current expected_version, review the new amounts, and issue with a new key. Errors to handle lists every error and reason these endpoints return.
Permissions#
| Calls | Scopes |
|---|---|
| Get, list, list allocations, download the PDF | commerce.credit_notes.read or commerce.credit_notes.write |
| Create, update, issue, allocate, reverse, void | commerce.credit_notes.write |
Issue with refund, or refund an issued note | commerce.credit_notes.write and commerce.refunds.write |
| List a note's refunds | commerce.credit_notes.read and commerce.refunds.read, or the matching write scopes |
Add expand=invoice | Credit note read access and commerce.invoices.read. Without invoice access, the request returns 403 INSUFFICIENT_SCOPE with param: expand. |
Find credit notes#
GET /v1/credit-notes returns notes newest first. Filters combine with AND and apply before pagination. status and reason take several values, repeated or comma-separated, and match any of them. customer_id takes one valid customer ID and matches notes whose source invoice currently belongs to that customer, so you can find a customer's notes across all their invoices.
Add expand=invoice to the list or to GET /v1/credit-notes/{credit_note_id} to include the source invoice's summary as invoice on each note. invoice is the only expansion. Adding or dropping expand between pages keeps the page token valid.
curl -G https://api.withflintpay.com/v1/credit-notes \
-H "Authorization: Bearer YOUR_API_KEY" \
--data-urlencode "customer_id=cus_01KF3Q7A1B3C5D7E9F1G3H5J7K" \
--data-urlencode "reason=returned_goods,billing_error" \
--data-urlencode "expand=invoice"
Buyers see notes through /v1/me/invoices/{invoice_id}/credit-notes, with a customer session or the invoice's access token. Those routes return issued and void notes only, leave out available_money, allocated_money, merchant_id, external_reference_id, and version, and don't accept filters or expand. See Show credit notes to the buyer.
Webhooks#
- credit_
note. created A draft was created. - credit_
note. updated A draft changed, or a linked refund was requested or changed the note's refund amounts. - credit_
note. issued The note was numbered and frozen. - credit_
note. voided The note was voided. - credit_
note_ allocation. created Credit was applied to the invoice. - credit_
note_ allocation. reversed An allocation was reversed.
An allocation that closes the invoice also sends invoice.paid or invoice.credited, and a reversal that reopens it sends invoice.reopened. See Handle webhook events for the order they arrive in.
Related#
Credit notesCreate, issue, allocate, refund, and void a credit note, with full examples.InvoicingThe invoice a credit note corrects, and its balance fields.RefundsRefund statuses, reasons, and events, including refunds made from a credit note.The Credit note object#
A correction against an issued invoice. Credit notes reduce what is owed; refunds return what was already collected.
Returned by GET /v1/credit-notes/{credit_note_id} and carried by the endpoints below.
Attributes
allocated_moneyobjectRequiredCredit applied to the invoice, net of reversed allocations.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
available_moneyobjectRequiredCredit available to allocate or refund. Zero on draft and void notes. On issued notes, total_money equals allocated_money plus pending_refund_money plus refunded_money plus available_money.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
buyer_tax_identityobject or nullRequiredIdentity frozen on the source invoice at issue. Later profile edits do not change this document.
legal_namestring or nullRequiredThe merchant's legal name, printed on invoices and credit notes. `null` when no legal name is set.
registered_addressobject or nullRequiredThe merchant's registered business address, printed on invoices and credit notes. `null` when no address is set.
tax_idsarray of objectRequiredTax IDs printed on invoices and credit notes, in display order. Empty when none are set.
created_atstringRequiredWhen the credit note was created.
credit_note_idstringRequiredUnique identifier of the credit note.
credit_note_numberstringAssigned at issue and stable from then on. Absent while the credit note is a draft.
external_reference_idstring or nullRequiredCaller-owned identifier for this resource in an external system. null when unset.
invoiceobjectSummary of the source invoice. Returned only with expand=invoice.
collection_block_statusenumWhether collection is blocked. While it is inventory_blocked, collection attempts return 409 ACTION_NOT_ALLOWED with details[0].reason inventory_wait.
noneinventory_blockedresolved
created_atstringWhen the invoice was created.
customer_idstringCustomer billed by the invoice. Absent when the invoice has no customer.
due_datestringCalendar due date in YYYY-MM-DD format, interpreted in timezone (UTC when absent). The outstanding balance becomes overdue only after this date ends. Automatic collection runs at the later of issue and the start of this date. With payment terms, issue computes this date from issued_at. Absent when there is no due date.
invoice_idstringRequiredFlint invoice ID.
invoice_numberstringSequential document number assigned when the invoice is issued. Absent on a draft.
is_overduebooleanRequiredWhether the invoice is open or partially_paid and past due with a balance remaining, as is_overdue on the full Invoice reports it.
order_idstringThe order the invoice bills.
outstanding_moneyobjectRequiredWhat is still owed, as outstanding_money on the full Invoice reports it: never below zero, 0 on paid, credited, uncollectible, and void invoices, and equal to total_money on a draft.
paid_moneyobjectRequiredPayments collected toward this invoice, online or as recorded manual payments, minus reversed payments, including payments toward late fees. Never below zero. Refunds don't reduce it; they are in refunded_money.
refund_statusenumHow much of the collected money has been refunded. It doesn't change status.
nonepartially_refundedrefunded
refunded_moneyobjectRequiredMoney refunded to the buyer after collection. Refunds don't reopen the balance; refund_status summarizes them.
statusenumRequiredCurrent invoice status. paid and credited close the current balance and can reopen to open or partially_paid after a payment or credit allocation reversal; invoice.reopened reports that change. void and uncollectible are final. Refunds change refund_status without reopening the balance.
draftopenpartially_paidpaidvoiduncollectiblecredited
total_moneyobjectRequiredThe invoice document total, equal to snapshot.pricing_amounts.total_money. Fixed at issue; a draft previews the backing order total. Late fees are in late_fee_money on the full invoice.
updated_atstringWhen the invoice last changed.
invoice_idstringRequiredThe invoice this credit note corrects.
issued_atstringWhen the credit note was issued. Absent on a draft.
latest_refund_statusenumStatus of the most recent refund linked to this credit note. Absent when no refund has been requested.
pendingsucceededpartially_succeededfailed
line_itemsarray of objectRequiredItemized corrections against frozen invoice lines. Amount and quantity corrections share each source line's remaining value, discount, and tax across issued, non-void credit notes. Drafts reserve no credit.
correctionone ofRequiredThe correction that produced this line, using the same shape accepted by draft writes. Amount corrections return the requested billed value in amount_money, equal to total_money.
credit_note_line_item_idstringRequiredUnique identifier of the credit note line item.
discount_moneyobjectRequiredThe credited share of the frozen line's remaining allocated merchandise discount, rounded half up in currency minor units.
invoice_line_item_idstringRequiredThe invoice snapshot line this corrects.
namestringRequiredLabel of the credited invoice line.
subtotal_moneyobjectRequiredCredited subtotal before the credited discount, in the source line's inclusive or additive price units. Balances the total after tax and discount are rounded from the remaining pool; it is not a rounded per-unit price.
tax_moneyobjectRequiredThe credited share of the frozen line's remaining tax, rounded half up in currency minor units. Included tax is already part of total_money. Tax-exclusive consideration is total_money minus tax_money.
total_moneyobjectRequiredBilled value credited by this line. For inclusive tax, subtotal_money minus discount_money. For additive tax, subtotal_money minus discount_money plus tax_money. A full remaining-value correction consumes the exact remaining components.
memostring or nullRequiredFree text shown on the credit note, up to 4096 characters. null when unset.
merchant_idstringRequiredThe merchant that owns the credit note.
pending_refund_moneyobjectRequiredCredit reserved by linked refunds that have not resolved yet. Released if a refund fails or is canceled.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
reasonenumRequiredWhy the invoice is being corrected. Shown on the credit note document.
returned_goodsorder_adjustmentbilling_errorgoodwillother
refunded_moneyobjectRequiredCredit consumed by linked refunds that succeeded.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
seller_tax_identityobject or nullRequiredIdentity frozen on the source invoice at issue. Later profile edits do not change this document.
legal_namestring or nullRequiredThe merchant's legal name, printed on invoices and credit notes. `null` when no legal name is set.
registered_addressobject or nullRequiredThe merchant's registered business address, printed on invoices and credit notes. `null` when no address is set.
tax_idsarray of objectRequiredTax IDs printed on invoices and credit notes, in display order. Empty when none are set.
statusenumRequireddraft while the credit note is editable, issued once it is numbered and frozen, void once retired.
draftissuedvoid
total_moneyobjectRequiredThe face value of the credit note, the sum of its lines.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
updated_atstringRequiredWhen the credit note last changed.
versionintegerRequiredCurrent credit note version. Send this as expected_version when updating the draft.
voided_atstringWhen the credit note was voided. Absent unless it is void.
{
"allocated_money": {
"amount": 0,
"currency": "USD"
},
"available_money": {
"amount": 0,
"currency": "USD"
},
"buyer_tax_identity": null,
"created_at": "2026-03-21T15:03:00Z",
"credit_note_id": "cn_01KEZF7C001MHR3WBEWAFG5DTD",
"external_reference_id": null,
"invoice_id": "inv_01J00000000000000000000000",
"line_items": [],
"memo": null,
"merchant_id": "mer_01J00000000000000000000000",
"pending_refund_money": {
"amount": 0,
"currency": "USD"
},
"reason": "billing_error",
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"seller_tax_identity": null,
"status": "draft",
"total_money": {
"amount": 0,
"currency": "USD"
},
"updated_at": "2026-03-21T15:04:05Z",
"version": 1
}List credit notes#
/v1/credit-notesRequires scope commerce.credit_notes.read or commerce.credit_notes.write
Rate limit: read
Returns credit notes for the authenticated merchant, newest first. Filter by invoice_id to see everything credited against one invoice. Default order: created_at descending, then credit_note_id descending.
Query parameters
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque next_page_token from the previous response. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An invalid, expired, or mismatched token returns a validation error.
created_afterstringInclusive lower bound on created_at.
created_beforestringExclusive upper bound on created_at.
invoice_idstringFilter by invoice.
customer_idstringFilter by the source invoice's current customer_id.
reasonarray of enumFilter by credit note reason. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.
returned_goodsorder_adjustmentbilling_errorgoodwillother
external_reference_idstringExact-match filter on the caller-owned external reference ID.
querystringSearch across credit note ID, credit note number, memo, and external reference ID. Text fields match any part of the value, and %, _ and \ are ordinary characters, not wildcards. IDs match from the start and need the type prefix, such as cn_01.
statusarray of enumFilter by status. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.
draftissuedvoid
expandarray of enumInclude related objects in the response. Supported expansions: invoice. Include the requested related resources using scoped batch reads for this page. Each relationship requires its existing target read scopes. Expansion changes the representation without changing pagination tokens. Limits: at most 10 unique expand paths per request.
invoice
Response · 200
A page of credit notes.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
allocated_moneyobjectRequiredCredit applied to the invoice, net of reversed allocations.
available_moneyobjectRequiredCredit available to allocate or refund. Zero on draft and void notes. On issued notes, total_money equals allocated_money plus pending_refund_money plus refunded_money plus available_money.
buyer_tax_identityobject or nullRequiredIdentity frozen on the source invoice at issue. Later profile edits do not change this document.
created_atstringRequiredWhen the credit note was created.
credit_note_idstringRequiredUnique identifier of the credit note.
credit_note_numberstringAssigned at issue and stable from then on. Absent while the credit note is a draft.
external_reference_idstring or nullRequiredCaller-owned identifier for this resource in an external system. null when unset.
invoiceobjectSummary of the source invoice. Returned only with expand=invoice.
invoice_idstringRequiredThe invoice this credit note corrects.
issued_atstringWhen the credit note was issued. Absent on a draft.
latest_refund_statusenumStatus of the most recent refund linked to this credit note. Absent when no refund has been requested.
pendingsucceededpartially_succeededfailed
line_itemsarray of objectRequiredItemized corrections against frozen invoice lines. Amount and quantity corrections share each source line's remaining value, discount, and tax across issued, non-void credit notes. Drafts reserve no credit.
memostring or nullRequiredFree text shown on the credit note, up to 4096 characters. null when unset.
merchant_idstringRequiredThe merchant that owns the credit note.
pending_refund_moneyobjectRequiredCredit reserved by linked refunds that have not resolved yet. Released if a refund fails or is canceled.
reasonenumRequiredWhy the invoice is being corrected. Shown on the credit note document.
returned_goodsorder_adjustmentbilling_errorgoodwillother
refunded_moneyobjectRequiredCredit consumed by linked refunds that succeeded.
seller_tax_identityobject or nullRequiredIdentity frozen on the source invoice at issue. Later profile edits do not change this document.
statusenumRequireddraft while the credit note is editable, issued once it is numbered and frozen, void once retired.
draftissuedvoid
total_moneyobjectRequiredThe face value of the credit note, the sum of its lines.
updated_atstringRequiredWhen the credit note last changed.
versionintegerRequiredCurrent credit note version. Send this as expected_version when updating the draft.
voided_atstringWhen the credit note was voided. Absent unless it is void.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/credit-notes \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of credit notes.
{
"data": [
{
"allocated_money": {
"amount": 0,
"currency": "USD"
},
"available_money": {
"amount": 0,
"currency": "USD"
},
"buyer_tax_identity": null,
"created_at": "2026-03-21T15:03:00Z",
"credit_note_id": "cn_01KEZF7C001MHR3WBEWAFG5DTD",
"external_reference_id": null,
"invoice_id": "inv_01J00000000000000000000000",
"line_items": [],
"memo": null,
"merchant_id": "mer_01J00000000000000000000000",
"pending_refund_money": {
"amount": 0,
"currency": "USD"
},
"reason": "billing_error",
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"seller_tax_identity": null,
"status": "draft",
"total_money": {
"amount": 0,
"currency": "USD"
},
"updated_at": "2026-03-21T15:04:05Z",
"version": 1
}
],
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Create credit note#
/v1/credit-notesIdempotentRequires scope commerce.credit_notes.write
Rate limit: write
Creates a draft credit note against an invoice that has been issued and not voided. Include line_items for initial corrections or omit them for an empty draft. The draft uses frozen invoice economics and the remaining pools shared by issued, non-void notes. Drafts reserve no credit. It receives a credit note number when issued.
Request body
external_reference_idstringCaller-owned identifier for this resource in an external system.
invoice_idstringRequiredThe invoice to correct. It has to be past draft and not voided.
line_itemsarray of objectInitial draft corrections. Omit or send [] to create an empty draft. Null is not accepted.
correctionone ofRequiredHow much of the invoice line to credit, by quantity or by amount.
credit_note_line_item_idstringExisting credit note line item to retain. Omit to create a new line item.
invoice_line_item_idstringRequiredThe invoice snapshot line to credit.
memostringFree text shown on the credit note, up to 4096 characters.
reasonenumRequiredWhy the invoice is being corrected: returned_goods, order_adjustment, billing_error, goodwill, or other. Shown on the credit note document.
returned_goodsorder_adjustmentbilling_errorgoodwillother
Response · 201
The created resource.
dataobjectRequiredResource, collection, or operation result returned by this request.
allocated_moneyobjectRequiredCredit applied to the invoice, net of reversed allocations.
available_moneyobjectRequiredCredit available to allocate or refund. Zero on draft and void notes. On issued notes, total_money equals allocated_money plus pending_refund_money plus refunded_money plus available_money.
buyer_tax_identityobject or nullRequiredIdentity frozen on the source invoice at issue. Later profile edits do not change this document.
created_atstringRequiredWhen the credit note was created.
credit_note_idstringRequiredUnique identifier of the credit note.
credit_note_numberstringAssigned at issue and stable from then on. Absent while the credit note is a draft.
external_reference_idstring or nullRequiredCaller-owned identifier for this resource in an external system. null when unset.
invoiceobjectSummary of the source invoice. Returned only with expand=invoice.
invoice_idstringRequiredThe invoice this credit note corrects.
issued_atstringWhen the credit note was issued. Absent on a draft.
latest_refund_statusenumStatus of the most recent refund linked to this credit note. Absent when no refund has been requested.
pendingsucceededpartially_succeededfailed
line_itemsarray of objectRequiredItemized corrections against frozen invoice lines. Amount and quantity corrections share each source line's remaining value, discount, and tax across issued, non-void credit notes. Drafts reserve no credit.
memostring or nullRequiredFree text shown on the credit note, up to 4096 characters. null when unset.
merchant_idstringRequiredThe merchant that owns the credit note.
pending_refund_moneyobjectRequiredCredit reserved by linked refunds that have not resolved yet. Released if a refund fails or is canceled.
reasonenumRequiredWhy the invoice is being corrected. Shown on the credit note document.
returned_goodsorder_adjustmentbilling_errorgoodwillother
refunded_moneyobjectRequiredCredit consumed by linked refunds that succeeded.
seller_tax_identityobject or nullRequiredIdentity frozen on the source invoice at issue. Later profile edits do not change this document.
statusenumRequireddraft while the credit note is editable, issued once it is numbered and frozen, void once retired.
draftissuedvoid
total_moneyobjectRequiredThe face value of the credit note, the sum of its lines.
updated_atstringRequiredWhen the credit note last changed.
versionintegerRequiredCurrent credit note version. Send this as expected_version when updating the draft.
voided_atstringWhen the credit note was voided. Absent unless it is void.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/credit-notes \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"invoice_id": "inv_01J00000000000000000000000",
"line_items": [
{
"correction": {
"quantity": 1,
"type": "quantity"
},
"invoice_line_item_id": "invli_01KEZF7C00EEHJQZDWNCY60NBP"
}
],
"reason": "returned_goods"
}'Get credit note#
/v1/credit-notes/{credit_note_id}Requires scope commerce.credit_notes.read or commerce.credit_notes.write
Rate limit: read
Returns one credit note with its lines, total, and the credit still available to allocate.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Query parameters
expandarray of enumInclude related objects in the response. Supported expansions: invoice. Include the source invoice summary with expand=invoice. Requires commerce.credit_notes.read and commerce.invoices.read. Limits: at most 10 unique expand paths per request.
invoice
curl https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The credit note.
{
"data": {
"allocated_money": {
"amount": 0,
"currency": "USD"
},
"available_money": {
"amount": 0,
"currency": "USD"
},
"buyer_tax_identity": null,
"created_at": "2026-03-21T15:03:00Z",
"credit_note_id": "cn_01KEZF7C001MHR3WBEWAFG5DTD",
"external_reference_id": null,
"invoice_id": "inv_01J00000000000000000000000",
"line_items": [],
"memo": null,
"merchant_id": "mer_01J00000000000000000000000",
"pending_refund_money": {
"amount": 0,
"currency": "USD"
},
"reason": "billing_error",
"refunded_money": {
"amount": 0,
"currency": "USD"
},
"seller_tax_identity": null,
"status": "draft",
"total_money": {
"amount": 0,
"currency": "USD"
},
"updated_at": "2026-03-21T15:04:05Z",
"version": 1
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Update credit note#
/v1/credit-notes/{credit_note_id}IdempotentRequires scope commerce.credit_notes.write
Rate limit: write
Updates draft credit note fields and corrections atomically. Omitted fields are unchanged, a null memo clears it, and line_items requires expected_version. Replacing lines recalculates their amounts from current remaining creditable pools. Scalar edits preserve stored line values. Issued and void credit notes are frozen.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Request body
expected_versionintegerCredit note version last read. Required when line_items is present. Required when any of these fields is present: line_items.
external_reference_idstring or nullCaller-owned identifier for this resource in an external system. Send null to clear it.
line_itemsarray of objectFull replacement of the draft's owned line collection; requires expected_version. Recalculates corrections from current remaining creditable pools. After VERSION_CONFLICT, replace the existing corrections using current_version as expected_version, review the new amounts, and issue again. Scalar memo or reason changes do not reprice lines.
correctionone ofRequiredHow much of the invoice line to credit, by quantity or by amount.
credit_note_line_item_idstringExisting credit note line item to retain. Omit to create a new line item.
invoice_line_item_idstringRequiredThe invoice snapshot line to credit.
memostring or nullSend null to clear it.
reasonenumWhy the invoice is being corrected: returned_goods, order_adjustment, billing_error, goodwill, or other. Cannot be null; omit it to keep the current reason.
returned_goodsorder_adjustmentbilling_errorgoodwillother
curl -X PATCH https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1,
"line_items": [
{
"correction": {
"quantity": 1,
"type": "quantity"
},
"invoice_line_item_id": "invli_01KEZF7C00EEHJQZDWNCY60NBP"
}
],
"memo": "Credit one returned unit."
}'List credit note allocations#
/v1/credit-notes/{credit_note_id}/allocationsRequires scope commerce.credit_notes.read or commerce.credit_notes.write
Rate limit: read
Returns every allocation made from a credit note, including reversed ones. Filter by idempotency_key to find the allocation a given request produced. Default order: allocated_at descending, then credit_note_allocation_id descending.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Query parameters
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque next_page_token from the previous response. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An invalid, expired, or mismatched token returns a validation error.
idempotency_keystringFilter by the original Idempotency-Key, after trimming surrounding whitespace. Matching is exact and case-sensitive. Returns current authorized resources, not the recorded response. A pending resource does not prove that the operation succeeded, and an empty list does not prove that it had no effect.
Response · 200
A page of allocations.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
allocated_atstringRequiredRFC3339 timestamp.
amount_moneyobjectRequiredCredit applied to the invoice balance.
credit_note_allocation_idstringRequiredUnique identifier of the allocation.
credit_note_idstringRequiredThe credit note whose credit was applied.
idempotency_keystringRequiredThe key the caller sent when allocating, or issue: followed by the issue request's Idempotency-Key for an allocation made on issue. It is this allocation's identity and is filterable on the allocations list.
invoice_idstringRequiredThe invoice whose balance the credit reduced.
reversed_atstringWhen the allocation was reversed and its credit returned. Absent while the allocation stands.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/allocations \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of allocations.
{
"data": [
{
"allocated_at": "2026-03-22T12:01:00Z",
"amount_money": {
"amount": 500,
"currency": "USD"
},
"credit_note_allocation_id": "cna_01KEZF7C0054N70FZ2YY47QE7W",
"credit_note_id": "cn_01KEZF7C001MHR3WBEWAFG5DTD",
"idempotency_key": "credit-allocation-1842",
"invoice_id": "inv_01J00000000000000000000000"
}
],
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Allocate credit note#
/v1/credit-notes/{credit_note_id}/allocationsKey requiredRequires scope commerce.credit_notes.write
Rate limit: write
Applies credit from an issued credit note to its invoice, reducing outstanding_money. The amount cannot exceed the credit note's available_money or the invoice's outstanding balance. Closing the balance with credit sets the invoice to paid when positive net collection remains, or credited when there is no positive net collection. Returns the allocation, the credit note, and the recomputed invoice together. An Idempotency-Key is required and becomes the allocation's identity.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Request body
amount_moneyobjectRequiredCredit to apply, no more than the credit note's available_money or the invoice's outstanding balance.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
expected_versionintegerCredit note version last read. Optional; a stale version returns VERSION_CONFLICT.
Response · 201
The created resource.
dataobjectRequiredResource, collection, or operation result returned by this request.
credit_noteobjectRequiredThe credit note with its recomputed available_money and allocated_money.
credit_note_allocationobjectRequiredThe allocation that was created or reversed.
invoiceobjectRequiredThe invoice with its recomputed outstanding balance and status.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/allocations \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"amount_money": {
"amount": 500,
"currency": "USD"
},
"expected_version": 2
}'Get credit note allocation#
/v1/credit-notes/{credit_note_id}/allocations/{credit_note_allocation_id}Requires scope commerce.credit_notes.read or commerce.credit_notes.write
Rate limit: read
Returns one allocation. A non-null reversed_at means the credit was returned to the credit note and the invoice balance reopened.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
credit_note_allocation_idstringRequiredFlint credit note allocation ID.
Response · 200
The allocation.
dataobjectRequiredResource, collection, or operation result returned by this request.
allocated_atstringRequiredRFC3339 timestamp.
amount_moneyobjectRequiredCredit applied to the invoice balance.
credit_note_allocation_idstringRequiredUnique identifier of the allocation.
credit_note_idstringRequiredThe credit note whose credit was applied.
idempotency_keystringRequiredThe key the caller sent when allocating, or issue: followed by the issue request's Idempotency-Key for an allocation made on issue. It is this allocation's identity and is filterable on the allocations list.
invoice_idstringRequiredThe invoice whose balance the credit reduced.
reversed_atstringWhen the allocation was reversed and its credit returned. Absent while the allocation stands.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/allocations/cna_01KEZF7C00EH6DMS9BD8F72CMA \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The allocation.
{
"data": {
"allocated_at": "2026-03-22T12:01:00Z",
"amount_money": {
"amount": 500,
"currency": "USD"
},
"credit_note_allocation_id": "cna_01KEZF7C0054N70FZ2YY47QE7W",
"credit_note_id": "cn_01KEZF7C001MHR3WBEWAFG5DTD",
"idempotency_key": "credit-allocation-1842",
"invoice_id": "inv_01J00000000000000000000000"
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Reverse credit note allocation#
/v1/credit-notes/{credit_note_id}/allocations/{credit_note_allocation_id}/reverseIdempotentRequires scope commerce.credit_notes.write
Rate limit: write
Reverses an allocation and reopens that much of the invoice balance. The original allocation keeps its row and gains reversed_at, so the history stays append-only. Reversing the allocation that closed an invoice moves it from credited back to open or partially_paid. Reversing credit on a paid invoice that also has collected payments moves it to partially_paid.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
credit_note_allocation_idstringRequiredFlint credit note allocation ID.
Request body
expected_versionintegerVersion last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.
curl -X POST https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/allocations/cna_01KEZF7C00EH6DMS9BD8F72CMA/reverse \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 3
}'Issue credit note#
/v1/credit-notes/{credit_note_id}/issueKey requiredRequires scope commerce.credit_notes.write
Rate limit: external_provider_action
Issues a draft credit note and freezes its number, lines, and totals. Provide allocation to issue and apply credit to its invoice atomically, or refund to initiate a linked refund on a paid invoice. Allocation and refund cannot be combined. Omit allocation.amount_money to apply the smaller of the credit available after issue and the invoice's outstanding balance. An explicit amount must be positive, use the invoice's currency, and fit both balances. The result includes credit_note_allocation when allocation is requested. Idempotency-Key is required and is retained for as long as the issue's effects exist, scoped to merchant, environment, credit note, and key. Reuse the key with the identical request to recover the original credit note and allocation. Recover an allocation after a lost response by listing this note's allocations with idempotency_key=issue:<issue key>. For refunds, list this note's refunds filtered by the original idempotency_key. A pending refund is accepted but has not completed. Without allocation or refund, issuance leaves the invoice balance unchanged. Issue validates the stored preview against current shared creditable pools. A fitting correction whose preview changed fails with `VERSION_CONFLICT`, which includes the credit note and `current_version`: replace its existing corrections with PATCH using the current expected_version, review the recalculated amounts, and issue again. A stored correction exceeding the remaining pool fails with `ACTION_NOT_ALLOWED` and reason `not_offered`. Update the draft lines before issuing again. Affected historical tax allocations fail with `ACTION_NOT_ALLOWED` and reason `credit_note_tax_reconciliation_required`.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Request body
allocationobjectIssue the credit note and apply credit to its invoice atomically. If the allocation fails, the note stays a draft. Omit amount_money to apply the smaller of the credit available after issue and the invoice's outstanding balance. Cannot be combined with refund.
amount_moneyobjectCredit to apply. Omit to apply the smaller of the credit available after issue and the invoice's outstanding balance. An explicit amount must be positive, use the invoice's currency, and fit both balances. Either way, the allocation must leave the order's unpaid tip outstanding.
expected_versionintegerCredit note version last read. Optional; a stale version returns VERSION_CONFLICT.
refundobjectCreate a linked refund when the credit note is issued. Requires both credit-note and refund write permissions and a paid invoice. Cannot be combined with allocation.
amount_moneyobjectCredit to refund. Omit to refund all available credit, which Flint resolves once when it accepts the request.
reasonenumRequiredWhy the refund is being made.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderother
reason_messagestringOptional note explaining the refund.
Response · 200
The updated credit note.
dataobjectRequiredResource, collection, or operation result returned by this request.
credit_noteobjectRequiredThe issued credit note. Its version is the target of expected_version.
credit_note_allocationobjectThe linked allocation, present when allocation was requested. Its idempotency_key is issue: followed by the issue request's Idempotency-Key.
invoiceobjectRequiredThe invoice state after the credit note was issued.
refundobjectThe linked refund, present when refund was requested. A pending refund has been accepted but has not completed.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/issue \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1
}'Download credit note PDF#
/v1/credit-notes/{credit_note_id}/pdfRequires scope commerce.credit_notes.read or commerce.credit_notes.write
Rate limit: read
Returns the credit note document as application/pdf rather than a JSON envelope. The PDF exists from issue onward and shows the credited lines, totals, and the invoice it corrects. It uses your current branding, so a later download can differ in logo or colors, but not in content.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Response · 200
A PDF document.
Content type application/pdf
curl https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/pdf \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A PDF document.
Returns application/pdf.
List credit note refunds#
/v1/credit-notes/{credit_note_id}/refundsRequires scopes commerce.credit_notes.read (or the matching write scope) and commerce.refunds.read (or the matching write scope)
Rate limit: read
Lists linked refunds, including failed attempts, newest first. Filter by idempotency_key to recover a refund after a lost response. Default order: time each refund was applied to the credit note (descending), then refund_id descending.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Query parameters
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque next_page_token from the previous response. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An invalid, expired, or mismatched token returns a validation error.
idempotency_keystringFilter by the original Idempotency-Key, after trimming surrounding whitespace. Matching is exact and case-sensitive. Returns current authorized resources, not the recorded response. A pending resource does not prove that the operation succeeded, and an empty list does not prove that it had no effect.
Response · 200
A page of refunds.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
amount_moneyobjectRequiredTotal refunded across all tenders, including `refunded_tip_money`.
created_atstringRequiredRFC3339 timestamp.
credit_note_idstringID of the credit note this refund paid out. Present only on refunds issued through a credit note.
customerobject or nullPresent only when `expand` includes `customer`; `null` when expanded and there is no related customer.
customer_idstringID of the customer on the refunded order or payment. Absent when neither has one.
external_reference_idstringCaller-owned identifier for this resource in an external system.
failure_reasonenumWhy a refund failed or a payment refund was canceled. Failed and canceled amounts become refundable again. Fix the cause, then create a new refund with a new idempotency key. Unknown provider values are returned as refund_failed.
expired_or_canceled_cardlost_or_stolen_cardinsufficient_fundsinsufficient_available_balancedeclinedmerchant_requestpayment_disputedpayment_refund_failedpayment_refund_not_attemptedrefund_failed
idempotency_keystringPresent only on refunds created through POST /v1/credit-notes/{credit_note_id}/refunds or by issuing a credit note with refund: the Idempotency-Key of that call. Use it with GET /v1/credit-notes/{credit_note_id}/refunds?idempotency_key= to recover a refund whose create response was lost.
invoice_idstringID of the invoice whose credit note this refund paid out. Present only on refunds issued through a credit note.
line_item_allocationsarray of objectHow the refund applied to each order line item it covered, with quantity, tax, and adjustments.
merchant_idstringRequiredID of the merchant this resource belongs to.
metadatamap of stringStored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.
orderobject or nullPresent only when `expand` includes `order`; `null` when expanded and there is no related order.
order_idstringID of the order the refund was issued against. Absent for a refund of a payment that has no order, and for a standalone gift card refund.
payment_intentobject or nullPresent only when `expand` includes `payment_intent`; `null` when expanded and there is no related payment intent.
payment_intent_idstringID of the payment the refund was issued against, when it targeted one payment. `payment_refunds` lists every payment it returned money through.
payment_refundsarray of objectThe part of the refund returned through each payment, with its own status. Absent when the refund was all gift card credit or store credit.
payment_review_idstringID of the payment review whose decline created this refund. Present only on refunds issued for a declined review.
reasonenum or nullRequiredWhy the refund was issued. It never changes how the money moves. The buyer's refund receipt shows it only for `requested_by_customer`, `duplicate`, `defective_product`, `wrong_item_shipped`, `never_received`, `not_as_described`, `arrived_too_late`, and `accidental_order`. `null` when no reason was recorded.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderothernull
reason_messagestringNote explaining the refund, up to 1,024 characters.
refund_idstringRequiredUnique identifier for this refund, prefixed `ref_`.
refunded_tip_moneyobjectRequiredShare of `amount_money` that refunds tips.
return_idstringID of the return this refund paid out. Present only on refunds issued by a return.
return_resolution_idstringID of the return resolution that issued this refund. Present only on refunds issued by a return.
statusenumRequiredSummary of payment_refunds and tender_allocations. Only failed is final: succeeded and partially_succeeded can still change when a bank rejects a refund after accepting it. Follow refund.updated.
pendingsucceededpartially_succeededfailed
tax_breakdown_refundsarray of objectTax reversed on order-level charges and flat taxes, one entry per tax breakdown. Tax reversed on line items is in `line_item_allocations[].tax_breakdown_refunds`.
tender_allocationsarray of objectEvery tender the refund drew from, payment or gift card, with its amount, tip share, status, and destination.
unissued_gift_card_recoveriesarray of objectCash returned after an unissued gift card purchase refund failed. Return it through a new refund against payment_intent_id and order_line_item_id. It does not issue another card. Source remaining and pending amounts describe the entire original settlement allocation; repeated entries for that source are not additive.
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredPersisted version of this resource's owned state. Expanded resources and external observations can change independently.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/refunds \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of refunds.
{
"data": [
{
"amount_money": {
"amount": 500,
"currency": "USD"
},
"created_at": "2026-03-22T12:01:00Z",
"credit_note_id": "cn_01KEZF7C001MHR3WBEWAFG5DTD",
"customer_id": "cus_01J00000000000000000000000",
"invoice_id": "inv_01J00000000000000000000000",
"merchant_id": "mer_01J00000000000000000000000",
"order_id": "ord_01J00000000000000000000000",
"payment_intent_id": "pi_4P0PGPVVCQ97Z18QNXAV528WCG",
"reason": "requested_by_customer",
"refund_id": "ref_01KEZF7C00H2GAMWD73WZ7K81W",
"refunded_tip_money": {
"amount": 0,
"currency": "USD"
},
"status": "pending",
"updated_at": "2026-03-22T12:01:00Z",
"version": 1
}
],
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}Refund credit note#
/v1/credit-notes/{credit_note_id}/refundsKey requiredRequires scopes commerce.credit_notes.write (or the matching write scope) and commerce.refunds.write (or the matching write scope)
Rate limit: external_provider_action
Creates a refund against an issued credit note on a paid invoice. Omit amount_money to refund all available credit. Refunds use the source invoice's original payments and do not reopen its balance. Idempotency-Key is required and retained for the lifetime of the refund command, scoped to merchant, environment, credit note, and key. Reusing it with another request conflicts. Recover a lost response by listing this note's refunds with idempotency_key. A failed remainder can be requested with a new key after its outcome is definitive.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Request body
amount_moneyobjectCredit to refund. Omit to refund all available credit, which Flint resolves once when it accepts the request.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredISO 4217 currency code for this amount.
expected_versionintegerCredit note version last read. Optional; a stale version returns VERSION_CONFLICT.
reasonenumRequiredWhy the refund is being made.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderother
reason_messagestringOptional note explaining the refund.
Response · 201
The created resource.
dataobjectRequiredResource, collection, or operation result returned by this request.
amount_moneyobjectRequiredTotal refunded across all tenders, including `refunded_tip_money`.
created_atstringRequiredRFC3339 timestamp.
credit_note_idstringID of the credit note this refund paid out. Present only on refunds issued through a credit note.
customerobject or nullPresent only when `expand` includes `customer`; `null` when expanded and there is no related customer.
customer_idstringID of the customer on the refunded order or payment. Absent when neither has one.
external_reference_idstringCaller-owned identifier for this resource in an external system.
failure_reasonenumWhy a refund failed or a payment refund was canceled. Failed and canceled amounts become refundable again. Fix the cause, then create a new refund with a new idempotency key. Unknown provider values are returned as refund_failed.
expired_or_canceled_cardlost_or_stolen_cardinsufficient_fundsinsufficient_available_balancedeclinedmerchant_requestpayment_disputedpayment_refund_failedpayment_refund_not_attemptedrefund_failed
idempotency_keystringPresent only on refunds created through POST /v1/credit-notes/{credit_note_id}/refunds or by issuing a credit note with refund: the Idempotency-Key of that call. Use it with GET /v1/credit-notes/{credit_note_id}/refunds?idempotency_key= to recover a refund whose create response was lost.
invoice_idstringID of the invoice whose credit note this refund paid out. Present only on refunds issued through a credit note.
line_item_allocationsarray of objectHow the refund applied to each order line item it covered, with quantity, tax, and adjustments.
merchant_idstringRequiredID of the merchant this resource belongs to.
metadatamap of stringStored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.
orderobject or nullPresent only when `expand` includes `order`; `null` when expanded and there is no related order.
order_idstringID of the order the refund was issued against. Absent for a refund of a payment that has no order, and for a standalone gift card refund.
payment_intentobject or nullPresent only when `expand` includes `payment_intent`; `null` when expanded and there is no related payment intent.
payment_intent_idstringID of the payment the refund was issued against, when it targeted one payment. `payment_refunds` lists every payment it returned money through.
payment_refundsarray of objectThe part of the refund returned through each payment, with its own status. Absent when the refund was all gift card credit or store credit.
payment_review_idstringID of the payment review whose decline created this refund. Present only on refunds issued for a declined review.
reasonenum or nullRequiredWhy the refund was issued. It never changes how the money moves. The buyer's refund receipt shows it only for `requested_by_customer`, `duplicate`, `defective_product`, `wrong_item_shipped`, `never_received`, `not_as_described`, `arrived_too_late`, and `accidental_order`. `null` when no reason was recorded.
duplicatefraudulentrequested_by_customerdefective_productwrong_item_shippednever_receivednot_as_describedarrived_too_latecustomer_changed_mindbetter_price_foundaccidental_orderothernull
reason_messagestringNote explaining the refund, up to 1,024 characters.
refund_idstringRequiredUnique identifier for this refund, prefixed `ref_`.
refunded_tip_moneyobjectRequiredShare of `amount_money` that refunds tips.
return_idstringID of the return this refund paid out. Present only on refunds issued by a return.
return_resolution_idstringID of the return resolution that issued this refund. Present only on refunds issued by a return.
statusenumRequiredSummary of payment_refunds and tender_allocations. Only failed is final: succeeded and partially_succeeded can still change when a bank rejects a refund after accepting it. Follow refund.updated.
pendingsucceededpartially_succeededfailed
tax_breakdown_refundsarray of objectTax reversed on order-level charges and flat taxes, one entry per tax breakdown. Tax reversed on line items is in `line_item_allocations[].tax_breakdown_refunds`.
tender_allocationsarray of objectEvery tender the refund drew from, payment or gift card, with its amount, tip share, status, and destination.
unissued_gift_card_recoveriesarray of objectCash returned after an unissued gift card purchase refund failed. Return it through a new refund against payment_intent_id and order_line_item_id. It does not issue another card. Source remaining and pending amounts describe the entire original settlement allocation; repeated entries for that source are not additive.
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredPersisted version of this resource's owned state. Expanded resources and external observations can change independently.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/refunds \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"amount_money": {
"amount": 500,
"currency": "USD"
},
"expected_version": 2,
"reason": "requested_by_customer"
}'Void credit note#
/v1/credit-notes/{credit_note_id}/voidIdempotentRequires scope commerce.credit_notes.write
Rate limit: write
Voids an issued credit note. Reverse every allocation first. A credit note with a pending or succeeded refund can't be voided. Blockers fail with `RESOURCE_IN_USE`, and `details[0].blocking_resources` lists the allocations and refunds. Void is terminal, and an invoice cannot be voided while an issued credit note stands against it.
Path parameters
credit_note_idstringRequiredFlint credit note ID.
Request body
expected_versionintegerVersion last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.
curl -X POST https://api.withflintpay.com/v1/credit-notes/cn_01KEZF7C00N1TRRCVDNY8S471H/void \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"expected_version": 1
}'Was this helpful?
