Browse documentation

On this page

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

  1. Open the invoice and choose Create Credit Note from its actions.
  2. 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

1. Read the invoice's version id and line ids

Fetch the invoice and keep:

  • its id: the version you're crediting. Not anchor_id. Versions are frozen, so this reference never moves.
  • each line's id you want to credit.
Shell
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 →

FieldWhereRule
credited_document_idCredit noteThe invoice's id (version), not anchor_id. Credit notes only.
credited_document_item_idLineThe invoice line this line credits. Requires credited_document_id.

What you get

CreditResult
Full line (same amount and tax)The invoice line's split exactly, rounding included
Partial lineThe credited tax shared across the same components and rates, largest remainder for the rounding cent
Line without credited_document_item_idPriced at the credit note's own date, like any document
The credit that settles the lineExactly 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.

RuleField and code
A line can't be credited past what is left of it. Draft credits count; a voided credit frees its partitems_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 onceitems_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_id points at the invoice's latest version, which can change. Use the version id. 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 with items: CREDITED_LINE_ID_REQUIRED.
  • Mixing linked and unlinked lines is allowed; only linked lines take the invoice's rates.

Next: Report tax by component →

Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout
We use cookies to improve your experience.

We use cookies and local storage for essential settings and, with your choices, analytics and advertising. Online identifiers and activity can be personal data. You can reject optional categories or change your choices.

These cookies are necessary for the basic functionality of the website, ensuring a seamless user experience. They cannot be disabled.