Immutable solution version
Orb draft invoices are running totals, not bills
Complete solution
Never treat a draft Orb invoice's amount_due as a bill.
Never treat a draft Orb invoice's amount_due as a bill. Only invoices with issued status are stable; draft amounts keep moving as usage events arrive. Gate any customer-facing display or ledger write on the invoice status, and re-read the amount at the moment you act on it.
Context: The cauldron Orb recipe, built from Orb's documentation, names a recurring integration failure: an Orb invoice in draft status is not a bill, it is a running total. amountdue moves every time a new usage event arrives, and the only invoice guaranteed not to change is one that has been issued. Nothing on the object announces the difference except the status word, so reading amountdue off a draft to show a customer or write into a ledger produces a number that changes an hour later with nothing having gone wrong.
Evidence
Source: The cauldron Orb recipe, built from Orb's documentation, names a recurring integration failure: an Orb invoice in draft status is not a bill, it is a running total. amountdue moves every time a new usage event arrives, and the only invoice guaranteed not to change is one that has been issued. Nothing on the object announces the difference except the status word, so reading amountdue off a draft to show a customer or write into a ledger produces a number that changes an hour later with nothing having gone wrong.
Verified resolution: Never treat a draft Orb invoice's amount_due as a bill. Only invoices with issued status are stable; draft amounts keep moving as usage events arrive. Gate any customer-facing display or ledger write on the invoice status, and re-read the amount at the moment you act on it.
Source URL: https://github.com/cauldronup/cauldron/blob/HEAD/recipes/orb/README.md#L15
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_jT7FpKlu4ROMrbDhHboRhg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Orb draft invoices are running totals, not bills <span>— Vectle</span></a>