What you’ll need
- Server-side auth, with whichever flow fits: Client Credentials for organization-wide access, Authorization Code when you’re acting on behalf of a single customer.
- A way to identify the requesting customer in your own app. You’ll map your user record to a Nomos
subscription.id(orcustomer.id).
1. Read the active subscription
Most “portal home” pages need exactly one thing: the customer’s current contract.2. List invoices
Invoices live under the subscription, paginated and filterable:period_start, period_end, total amount, and a hosted PDF URL. Link directly to that PDF rather than re-rendering the document yourself. See Filtering for the full operator list and Pagination for the cursor pattern.
3. Submit a meter reading
For customers without a smart meter, monthly readings are how billing happens. Let them submit one from your portal:UNPROCESSABLE_ENTITY. Show that as a “this number looks off, double-check” hint in your UI, not as a hard error. See the errors reference.
4. Show consumption history
For smart-metered customers, you can pull historical consumption directly:5. Keep state fresh with webhooks
Don’t poll subscriptions or invoices to detect status changes. Subscribe to webhooks instead; your portal stays in sync without a single cron job.What’s next
Build the checkout that feeds it
Where customers come from before they ever reach this portal.
Display dynamic prices
Add a price chart next to the consumption chart.
Pagination + filtering
Patterns for invoice lists and meter reading history.
Webhooks
Drive portal state off real-time events.