Usage-based subscription flow does not materialize charges/invoice lines, blocking customer credit consumption #4312
Unanswered
pratham-ez
asked this question in
Q&A
Replies: 1 comment 5 replies
-
|
@turip ? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Use case
I am integrating OpenMeter for usage-based billing with prepaid customer credits.
My target flow is:
Goal: use customer credit balance as the source of truth for ongoing spend control and potential usage blocking logic.
Problem
In this flow, usage is ingested and meter queries show usage, but billing artifacts for that customer are not materialized:
invoice_create_no_linesfundedonly, noconsumed)This prevents validating the expected “usage -> charge/invoice -> credit deduction” lifecycle for non-flat pricing.
Environment
http://localhost:48888credits.enabled: trueenable_credit_then_invoice: trueSteps to reproduce
/api/v3/openmeter/customers/{id}/credits/grants)GET /api/v3/openmeter/customers/{id}/chargesPOST /api/v1/billing/invoices/invoicewithcustomerIdGET /api/v3/openmeter/customers/{id}/credits/balanceGET /api/v3/openmeter/customers/{id}/credits/transactionsActual behavior
GET /customers/{id}/chargesreturns empty (total: 0)POST /api/v1/billing/invoices/invoicereturns 400:invoice_create_no_linesfunded, but noconsumedExpected behavior
For a customer with active subscription, non-flat usage-based pricing, ingested usage, and available credits:
Code-level hint / suspicion
This validation indicates non-flat invoice items require
featureKey:openmeter/billing/gatheringinvoice.goBeta Was this translation helpful? Give feedback.
All reactions