Prerequisites
- A Macropay account with an organization
- An Organization Access Token
- At least one customer with an order or subscription
We recommend using the Sandbox environment for this guide
so you can test without processing real payments.
Overview
The Macropay Customer Portal gives your customers a self-service destination to:- View and download invoices
- Manage active subscriptions (upgrade, downgrade, cancel)
- Access purchased benefits (license keys, file downloads, etc.)
- View usage-based billing charges
Step 1: Create a Customer Session Token
To give a customer authenticated access to the portal, generate a session token via the API:Step 2: Redirect to the Portal
Simple redirect
Redirect your customer to thecustomerPortalUrl returned from the session creation:
Using the Next.js adapter
The@macropay/nextjs package provides a shorthand:
Step 3: Embed the Portal (Optional)
For a seamless experience, embed the portal directly in your app using an iframe:Step 4: Customize Branding
Customize the portal appearance in the Macropay dashboard:- Go to Settings > Branding
- Upload your logo
- Set your primary brand color
- Configure accent colors
Hosted Portal (No Code Required)
Customers can also access the portal directly without any integration on your part:What’s Next?
Customer Management
Learn about customer records and states
Customer State API
Query customer entitlements from your backend
Benefits
Configure benefits like license keys and file downloads
Subscription Management
Handle subscription upgrades and downgrades