4. Handling Refund Transactions
Refunds change what you owe, so they need to reach Kintsugi as deliberately as the sales they reverse. A credit note records a refund against the original transaction, keeping your filings anchored to net sales rather than gross. This guide covers when to create credit notes, how to shape them, and how full and partial refunds behave.
Understanding Credit Notes
A credit note in Kintsugi represents a refund, return, or adjustment against an original sale. Each credit note:
- Is created against the original transaction, which Kintsugi records on the credit note's
related_tofield - Carries the amount being credited on
total_amountand on each line item - Updates the original transaction's refund status
- Offsets the original sale in compliance calculations
The outcome is filings that reflect what you actually kept.
Credit notes are transactions: Credit notes are transaction records with their own endpoint. Create them with POST /v1/transactions/{original_transaction_id}/credit_notes, and Kintsugi records them with a type of FULL_CREDIT_NOTE or PARTIAL_CREDIT_NOTE.
When to Create Credit Notes
Create a credit note whenever you refund, accept a return, or adjust a completed sale:
- Product returns: The customer sends items back
- Service cancellations: The customer cancels and is refunded
- Billing adjustments: You correct an overcharge or an error
- Partial refunds: You refund specific line items rather than the whole order
Which sales can be credited: A sale can carry a credit note while its status is PENDING, COMMITTED, or PARTIALLY_REFUNDED. A CANCELLED sale, an already FULLY_REFUNDED one, or a record Kintsugi has set aside is rejected with 400. A cancelled order needs no credit note in the first place.
Creating Credit Notes
Create credit notes with POST /v1/transactions/{original_transaction_id}/credit_notes. The path parameter is the original transaction's Kintsugi transaction ID, not your external_id.
Required Fields
external_id: Your unique identifier for the credit note (for example,"CN-2026-001")date: Credit note date, normally the refund date, in ISO 8601 formatstatus:PENDING,COMMITTED, orCANCELLEDtotal_amount: The amount being creditedcurrency: ISO 4217 currency code, for exampleUSDtransaction_items: The line items being credited
Optional Fields
description: The reason for the refund, which is worth sending on every credit noteaddresses: Addresses for the credit note, where they differ from the originaltaxable_amount,tax_amount_imported,tax_rate_imported: Tax figures you already calculated elsewhere
Credit Note Line Items
Each item mirrors a line from the original sale and requires:
external_id: Your identifier for the credit note linedate: Item dateexternal_product_id: The same product identifier used on the original linequantity: Units being creditedamount: Value being credited for that line
Either sign works: Send total_amount and item amount positive or negative as you prefer. Kintsugi normalizes credit note amounts to negative on write, so the stored record is consistent either way. Quantities stay positive. The Create Credit Note reference carries a complete worked example.
Credit Note Workflow
You never edit the original sale. You attach a credit note to it, and Kintsugi adjusts your liability from there.
Full Versus Partial Refunds
Kintsugi reads the amounts and classifies the refund for you.
Full Refunds
When the credit note covers the full original amount, Kintsugi records:
- Credit note
type: "FULL_CREDIT_NOTE" - Original transaction
refund_status: "FULLY_REFUNDED"
The original sale is fully offset for compliance purposes.
The two fields are derived differently: type is decided per credit note, by comparing that note's taxable_amount against the sale's. refund_status is cumulative, comparing every committed credit note's total against the sale's total_amount. On a single full refund they agree; across several partial refunds they can differ, so read refund_status when you need the sale's overall position.
Partial Refunds
When the credit note covers less than the original amount, Kintsugi records:
- Credit note
type: "PARTIAL_CREDIT_NOTE" - Original transaction
refund_status: "PARTIALLY_REFUNDED"
The sale is reduced, not erased. You can add further partial credit notes against the same transaction until the credited total reaches the original amount.
Two caps apply, both against the remaining balance: Kintsugi checks the credit note total against what is still creditable on the sale, and separately checks each line against what is still creditable on the matching original line. Either one over is a 400 and nothing is written, so an over-refund is rejected rather than trimmed to fit.
The transaction-level cap is the sale's total_amount plus any total_tax_amount_imported, minus everything already credited by committed credit notes. A PENDING credit note does not consume the balance, so two pending notes can each pass validation and then fail when you commit the second.
Matching the Original Transaction
Credit note line items should mirror the sale they reverse:
- Use the same
external_product_idvalues - Keep credited quantities at or below the original quantities
- Keep credited amounts at or below the original amounts
That discipline gives you clean reporting on which products were returned, and an audit trail that holds up under review.
Where an amount has to be spread across lines rather than itemized, Kintsugi allocates it in proportion to each line's remaining creditable balance, skipping lines that are already fully credited and giving the last eligible line the rounding remainder. Tax and quantity follow the same split, so a partial refund's tax reconciles against the lines it credited.
Credit Note Statuses
Credit notes use the same status values as transactions:
PENDING: Created, refund not yet finalizedCOMMITTED: Refund complete and included in compliance calculationsCANCELLED: Credit note voided, for example a reversed refund
Move credit notes to COMMITTED once the refund has actually been processed so your compliance figures track reality.
Updating Credit Notes
Update with PUT /v1/transactions/{original_transaction_id}/credit_notes/{credit_note_id}. Typical cases:
- Status changes: Moving
PENDINGtoCOMMITTEDafter the refund settles - Amount corrections: Fixing an incorrect refund figure
- Item adjustments: Revising which lines were credited
Filed records lock: Once the original transaction is included in a filing, its credit notes are locked and can no longer be updated. Make corrections before the filing period closes.
Best Practices
Creating Credit Notes
- Mirror the original: Same products, same address treatment, amounts that reconcile
- Validate before you post: Check the remaining creditable balance so the request is not rejected
- Use descriptive external IDs: Tie the credit note back to the sale, for example
CN-\{original_id\} - Always send a description: The refund reason is the first thing anyone asks about months later
- Set status to match reality:
PENDINGwhile the refund is in flight,COMMITTEDonce it clears
Finding Original Transactions
- Store Kintsugi transaction IDs: The credit note path parameter needs the Kintsugi ID, so save it when you create the transaction
- Fall back to external lookup: Without the Kintsugi ID, resolve it with
GET /v1/transactions/external/{external_id} - Handle not-found cleanly: The original transaction must exist before a credit note can reference it
Error Handling
Common failures when creating credit notes:
- Original transaction not found: Confirm you are passing the Kintsugi transaction ID, not your
external_id - Amount exceeds creditable balance: Subtract already-committed credit notes from the sale total plus imported tax before you post, and check the line-level balances too
- Sale cannot be credited: The sale must be
PENDING,COMMITTED, orPARTIALLY_REFUNDED; cancelled and fully refunded sales are rejected - Product mismatch: Reference the same products as the original line items
- Missing required fields:
currencyandstatusare required alongsideexternal_id,date,total_amount, andtransaction_items
See the Error Handling guide for detailed strategies.
Refund Scenarios
Single Item Return
A customer returns one item from a multi-item order:
- Find the original transaction
- Create a credit note containing only the returned line item
- Credit that item's share of the order
- Kintsugi marks the original transaction
PARTIALLY_REFUNDED
Full Order Refund
The entire order is refunded:
- Find the original transaction
- Create a credit note containing every line item
- Credit the full original amount
- Kintsugi marks the original transaction
FULLY_REFUNDED
Multiple Partial Refunds
Refunds arrive over time:
- Create a credit note for the first refund
- Add further credit notes as later refunds are issued
- Kintsugi tracks the cumulative credited total
- The original stays
PARTIALLY_REFUNDEDuntil the credited total reaches the original amount
Refund Status Tracking
Credit notes are cumulative. Each one reduces the remaining balance, and the refund status follows the total.
Refund Status on the Original
Kintsugi derives refund_status on the sale from the credit notes committed against it. Until one is committed the field is absent rather than carrying a "not refunded" value, and only committed credit notes count: a PENDING credit note neither consumes the balance nor moves the status.
You can also set it directly: refund_status is writable on POST /v1/transactions and on update, which is how a historical import lands a sale that was already refunded before you integrated. Kintsugi recomputes it from committed credit notes whenever one is attached. See Transaction Statuses.
Next Steps
With refund handling in place:
-
Verify credit notes: Read them back with
GET /v1/transactions/{transaction_id}and filter the transaction list bytransaction_typeto review credit notes on their own. See the Get Transactions API reference. -
Monitor refund status: Track
refund_statusacross your transactions so compliance figures stay accurate. -
Plan for edge cases: Decide up front how you handle reversed refunds and refunds that span filing periods.
For endpoint-level detail, see: