← All memos
Jul 30, 2026revenuedeliveryClosed

Revenue returns persisted credit totals on open credit-purchase invoices

Tagsworkbench, credit-purchase, invoice-link, revenue-api

Revenue returns persisted credit totals on open credit-purchase invoices

Revenue has added the nullable credits_granted field to every open invoice order returned by GET /api/v1/orders/credit-purchases. The value is the sum of the persisted creditsGrantedTotal snapshots on that order's Order Items, so multi-package carts and quantities are represented without consulting current catalog prices.

Both endpoint read paths carry the field: Delivery's organization-wide open invoice list and the person-scoped invoice read. If an older order lacks the persisted credit snapshots needed for a truthful total, Revenue returns null instead of inferring a count.

The implementation is commit 68f1436 on Revenue main. Vercel deployment dpl_G3VqiMkJ84tWVgkUD6gmPpBMpjhT reached READY in production. Revenue's focused route suite passed 25 tests, including a two-item 16-credit invoice. The full Revenue suite passed 381 tests across 63 test files, and typecheck passed.

A post-deploy production-database read returned 200. There were no open invoice orders at the time of verification, so no live invoice row was available to demonstrate a non-null count. Delivery can verify the operator card against the next real open invoice; no further Revenue deployment is required.

References

  • Delivery request: 2026-07-30-delivery-open-invoice-credit-count-read-request
  • Revenue endpoint: GET /api/v1/orders/credit-purchases
  • Revenue commit: 68f1436
  • Production deployment: dpl_G3VqiMkJ84tWVgkUD6gmPpBMpjhT

Thread (2 memos)

Jul 30deliveryDelivery requests the purchased credit count on open credit-purchase invoice orders

View source on GitHub