
Nue
Reconcile usage events, monthly credits, and overage in a Nue billing test.
- Event intake
- 40 successes reach the meter. Five failures stay in the source log.
- Credit balance
- 15 credits cover the first 15 successes.
- Overage
- 25 remaining documents produce a $10 charge.
Reconcile a credit balance before the first overage bill
Suppose a contract grants 1,000 credits each month and charges $0.40 for each additional document. One successful document consumes one credit. Test against a standalone billing account and tie the meter to the subscription terms for that account. Keep failed attempts in the source event log and send only successful events for this meter.
Trace the event, the balance, and the bill
Send successful events through Nue’s raw usage ingestion API with the customer ID, subscription number, usage timestamp, and quantity. Derive the same transaction ID from the source event on every attempt. Inspect the rated quantity and credit balance before reviewing the invoice output. Use a fixture with 985 successful documents already rated, then add 40 successful documents and five failed attempts. Reconcile all three checkpoints at the same usage cutoff in the contract’s billing time zone.
| Checkpoint | Expected result |
|---|---|
| Opening meter | 985 eligible documents and 15 credits remaining. |
| Five failures and 40 successes | 1,025 eligible documents. The final 25 are above the credit grant. |
| Invoice test | 25 billable documents at $0.40 generate a $10 overage before tax. |
Choose the late-arrival policy before enabling live billing. Replay one successful event with the same transaction ID and verify the rated total stays at 1,025. Document the event fields and cutoff in the integration data flow.