Skip to main content

Tenancy: realm, billing account, and billing user

Vluna uses two distinct scopes. Do not mix them up.

Concepts

ConceptIdentifierMeaning
Realmrealm_idProject boundary. All data is isolated by realm.
Billing accountbilling_account_idPayor/account boundary for billing details, invoices, payments, subscriptions, checkout, portal, contracts, and account administration.
Billing userbilling_user_idRuntime subject for usage, grants, wallet balance, limits, events, and self-service reports under a billing account.

Request scoping (HTTP)

Every request must include:

  • X-Realm-Id: <realm_id>

Runtime requests include both principal and user context:

  • X-Principal-Id: <principal_id>
  • X-User-Id: <user_id>

Account/payor-scoped requests include account context, typically via:

  • X-Principal-Id: <principal_id> and/or
  • X-Billing-Account-Id: <billing_account_id>

For public /api/v1 endpoints, the bearer token is issued for a principal and user and carries the resolved billing account and billing user scope.

What should be constant vs per request

FieldTypical sourceChanges when
realm_idapp configonly when you switch environments (dev, staging, prod)
service keyserver configrotates over time
principal_idyour app request contextchanges per customer
billing_account_idmapping table or token issue responsechanges per customer
user_idyour app request contextchanges per end user
billing_user_idtoken issue response or admin/ops responsechanges per end user under an account

Next