Skip to main content

What are usage events?

A usage event is one recorded data point against a meter — an API request, token spend, or document generation. The HTTP path stays POST /v1/sdk/meter-events. See Plans and billing glossary for the meter noun and credit peg.

Record usage

Event fields

Common types

  • api_call
  • transaction
  • email
  • storage
  • custom

Record usage in bulk

trackUsageBulk submits many events in one request — useful for flushing a buffered queue or backfilling. The batch is validated first, then each event is inserted individually:
The response is { success, inserted, results }, where each results entry carries the event reference and its per-event creditDebit outcome (same shape as the single-event response).

Credit debit results

When the customer is on a credit-based (usage-based) plan, trackUsage debits credits and reports what happened in creditDebit:
autoRecharge.triggered: true means an off-session recharge was initiated because the balance crossed the customer’s auto-recharge threshold — the credits arrive when that charge succeeds, not in this response. See the Auto-recharge guide.

Grant credits

Assign credits to a customer without collecting payment — sign-up bonuses, goodwill credits, or enterprise allotments. Grants are idempotent when you supply an idempotencyKey, so retries are safe:
The response includes { success, customerRef, credits, balance, reason }. Each grant emits a customer.credit.granted webhook. Credits can also be granted from the customer detail page in the SolvaPay Console.

Read a customer’s balance

The response also carries creditsPerMinorUnit and a display exchange rate for rendering the balance in the provider’s display currency. Credit balances are USD-normalized internally; the display fields are for presentation only.

Relationship to meters

Use both when needed:
  • trackUsage() / trackUsageBulk() for customer-level usage and credit debit
  • Meter events for named meter ingestion and aggregation

Next steps