Skip to main content
PymtHouse tracks per-user usage entitlements as allowances — USD micro balances backed by OpenMeter subscriptions and grants. Every new user starts with a Starter plan allowance; providers can add manual top-ups on top of the subscription balance. All allowance amounts are expressed as USD micros (integer strings; 1000000 = $1.00).
Allowance storage is OpenMeter-backed, not a Postgres wei ledger. Reads use OpenMeter entitlement APIs; grants call OpenMeter createGrant. OPENMETER_URL must be configured.

Authentication

All allowance endpoints use M2M HTTP Basic auth:
The authenticated client’s app must match the clientId in the path. Mismatches return 404.

Read allowances

Returns the user’s allowance breakdown: balance consumed, remaining, and all active grants.
Response:
SDK:

Grant a manual top-up

Add additional USD micro balance on top of the user’s existing subscription allowance:
Request body:
Grants are additive on top of the Starter subscription’s included usage — they do not replace it.
SDK:

Check real-time access balance

For a lightweight gate check before allowing a user action that consumes entitlement:
Response:
SDK:

Starter plan entitlement

Every app has a Starter plan with a default includedUsdMicros allowance (typically 5000000 = $5.00). New users are automatically subscribed to the Starter plan when provisioned, and the Starter allowance is the baseline grant for every new user. Providers update the Starter allowance via:
This triggers an immediate OpenMeter plan sync. See Plans for more on the Starter plan structure.

User subscription status

Read the full OpenMeter subscription state for a user (plan, period, status):
SDK:

Error responses


Key design decisions

  1. OpenMeter-authoritative. Allowance balances are never stored in Postgres. All reads and grants go through OpenMeter entitlement APIs, keeping the billing source of truth consistent with metering.
  2. Additive grants. POST /allowances calls OpenMeter createGrant on top of the existing Starter subscription — it does not replace or reset the subscription’s included usage.
  3. Separate balance endpoint. GET .../usage/balance is a lightweight gate check that returns only hasAccess and balance totals, suitable for pre-request checks without pulling full allowance detail.

Implementation tasks

  • Call getUsageBalance() (or GET .../usage/balance) before dispatching signed requests to check hasAccess.
  • Use grantUserAllowance() (or POST .../allowances) with source: "manual" for one-time top-ups (e.g. support credits, promotional credits).
  • Use source: "promo" or source: "trial" for time-limited promotional grants when your billing flow distinguishes them.
  • Poll GET /allowances for the full grant history when building a user billing detail view.