Portal Sessions
The SDK gives you four methods for managing customer portal links. These are the one-time URLs your customers click to see their own billing. This page covers:- Creating a portal session
- Getting one portal session
- Listing portal sessions
- Revoking a portal session
Setup
mf_sk_...). The SDK throws an AuthenticationError immediately if you initialize the client with a publishable key.
portalSessions.create
Mints a one-time portal link for a customer. The returned url is what you send to your customer.
Signature
Example
customerExternalId (your system’s ID) or customerId (MarginFront’s UUID). returnUrl is optional and informational.
See the Portal Sessions API reference for the full field list and error codes.
portalSessions.get
Looks up one portal session by ID. Useful for checking whether a link has been opened or has expired.
Signature
Example
token and url fields are NOT included in this response. Those are only returned by create. The return type is ListedPortalSession, the same shape returned by list. If you need the URL again, mint a new session with create.
portalSessions.list
Lists portal sessions your organization has created. Optionally filter to one customer.
Signature
Example
includeExpired: true to see them all.

