invoices.correctTax
Correct how an issued invoice imported from outside Oatmilk splits its unchanged total into subtotal and sales tax, without voiding it: pass id, expectedRevision, taxes (up to 5 lines of label, rate in percent, and amountMinor; an empty list means no sales tax), a reason of 10 to 500 characters, and an idempotency key. The tax becomes the sum of the lines and the subtotal the total minus that tax, which moves onto the invoice's single line. The total, payments, status, number, dates, and PDF don't change, and the reason and the split before and after are kept in the audit history. Refused for invoices Oatmilk issued (void and duplicate those instead), void or uncollectible invoices, invoices with more than one line or a quantity other than 1, and taxes above the total. Administrator only.
/api/v1/accounting/invoices.correctTaxPermissions
Who can call it
Retries
MCP
accounting_invoices_correct_taxFields
idstring (ID)RequiredThe record's ID.
expectedRevisionintegerRequiredThe record's current revision, from the last time you read it. If someone changed the record since, the request is refused with a conflict so you can reload and check before trying again.
at most 9007199254740991 · greater than 0
taxesarray of objectsRequiredat most 5 items
reasonstringRequiredA short note saying why, kept in the record's history.
10–500 characters
idempotencyKeystringRequiredAny unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match.
8–200 characters
Example
curl https://app.getoatmilk.com/api/v1/accounting/invoices.correctTax \
-H "Authorization: Bearer $OATMILK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"expectedRevision": 3,
"taxes": [
{
"label": "example",
"rate": "13",
"amountMinor": "1250"
}
],
"reason": "Synthetic example from the docs"
}'{
"data": { … }
}Try it
Try it
Checks your input with this action’s real schema and answers like the API, with synthetic data. No key needed, and nothing changes.
curl https://app.getoatmilk.com/api/v1/accounting/invoices.correctTax \
-H "Authorization: Bearer $OATMILK_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"expectedRevision": 3,
"taxes": [
{
"label": "example",
"rate": "13",
"amountMinor": "1250"
}
],
"reason": "Synthetic example from the docs"
}'More in Invoicing.