Credit an Invoice at Its Original Tax Rates
Goal: a credit note reverses exactly the tax the invoice charged, split the same way, even if rates changed in between.
Why: an unlinked credit-note line is priced on the credit note's own date. Credit a December invoice in January after a rate rise, and it reverses more tax than was charged.
In the app
- Open the invoice and choose Create Credit Note from its actions.
- Adjust quantities or remove lines you aren't crediting, then save.
Lines copied from the invoice are linked to it automatically and keep its rates. Lines you add by hand are priced at the credit note's date. Copying an existing credit note starts a new, unlinked one.
With the API
Working in your own language? These samples use plain HTTP. For a typed client in TypeScript, Python, Go, Java or PHP, generate one from the OpenAPI spec.
1. Read the invoice's version id and line ids
Fetch the invoice and keep:
- its
id: the version you're crediting. Notanchor_id. Versions are frozen, so this reference never moves. - each line's
idyou want to credit.
2. Create the credit note with links
curl -X POST $BASE/v1/credit-notes \
-H "$AUTH" -H "$PARTNER" -H "$CT" \
-d '{
"people_id": "<customer people_id>",
"currency": "USD",
"document_issue_date": "2027-01-10",
"credited_document_id": "<invoice id>",
"items": [
{
"item_id": "<item id>",
"item_quantity": "1",
"item_cost": "1000.00",
"item_tax": [ { "tax_id": "<tax id>" } ],
"credited_document_item_id": "<invoice line id>"
}
]
}'
Endpoint reference: POST /v1/credit-notes →
| Field | Where | Rule |
|---|---|---|
credited_document_id | Credit note | The invoice's id (version), not anchor_id. Credit notes only. |
credited_document_item_id | Line | The invoice line this line credits. Requires credited_document_id. |
What you get
| Credit | Result |
|---|---|
| Full line (same amount and tax) | The invoice line's split exactly, rounding included |
| Partial line | The credited tax shared across the same components and rates, largest remainder for the rounding cent |
Line without credited_document_item_id | Priced at the credit note's own date, like any document |
| The credit that settles the line | Exactly what is left of the line. A rounding difference from earlier partial credits is added to that line as a rounding adjustment, which Core sets; one sent in the request is ignored |
Example: an invoice dated 2026-12-15 charged 8.75%. A full credit dated 2027-01-10, after the district rose to 1.50%, still reverses $87.50: state $72.50, county $2.50, district $12.50.
Limits
Each refusal saves nothing and returns 400 with the field that caused it.
| Rule | Field and code |
|---|---|
| A line can't be credited past what is left of it. Draft credits count; a voided credit frees its part | items_N_item_quantity or items_N_item_cost: CREDIT_EXCEEDS_REMAINING, with credit_remaining: {"N": {"quantity", "amount"}} beside the errors |
| The credit note is in the invoice's currency (its exchange rate may differ) | currency: CREDIT_CURRENCY_MISMATCH |
| One credit note names each invoice line once | items_N_credited_document_item_id: CREDITED_LINE_REPEATED |
Restoring a voided credit note re-checks what is left and returns 409 CREDIT_EXCEEDS_REMAINING if the line was credited again meanwhile.
Pitfalls
- Using
anchor_idpoints at the invoice's latest version, which can change. Use the versionid. Credits made against earlier versions still count against the same lines. - Editing a credited invoice without line ids. An update must send each credited line with its
items[].id; leaving one out, or sending it without its id, is refused withitems:CREDITED_LINE_ID_REQUIRED. - Mixing linked and unlinked lines is allowed; only linked lines take the invoice's rates.