Customer Portal
Send customers to a hosted page where they pay invoices, update their details and cancel subscriptions.
The customer portal is a page Access hosts for you. Customers see what they owe and pay it, check their subscription, update their billing information, look through past invoices, and cancel, all without you building any UI. It's modelled on Stripe's customer portal and uses the same object shapes.
The portal takes its logo, colours, font and light or dark mode from your checkout theme, so it looks like the rest of your billing.
How It Works
- Your backend creates a portal session for a customer with your API key.
- Access returns a short-lived
url. - You redirect the customer to it (for example from a "Manage billing" button).
- They use the portal until the link expires, then come back through the Return to … link.
Sessions aren't stored. The URL carries a signed secret that names the customer and expires, so creating one is cheap: make a new session each time a customer clicks your button, and never email or reuse a link.
Create a Session
curl -X POST https://api.tryaccess.xyz/api/v1/billing_portal/sessions \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-d '{
"customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1",
"return_url": "https://yourapp.com/account"
}'Response:
{
"id": "bps_01J9Z8K2P3Q4R5S6T7U8V9W0X1",
"object": "billing_portal.session",
"configuration": "bpc_01J9Z8K2P3Q4R5S6T7U8V9W0X1",
"created": 1793162342,
"expires_at": 1793165942,
"customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1",
"flow": null,
"livemode": true,
"locale": null,
"return_url": "https://yourapp.com/account",
"url": "https://tryaccess.xyz/p/session?secret=eyJhbGciOi..."
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
customer | string | Yes | The ID of one of your customers |
return_url | string | No | Where the portal's Return to … link goes. Defaults to the configuration's default_return_url |
flow_data | object | No | Open the portal on one task instead of its homepage. See Deep links |
locale | string | No | For example en or am |
expires_in | number | No | Seconds until the link stops working: 300 to 86400. Default 3600 (1 hour) |
Treat the URL as a secret
Anyone with the URL can act as that customer until it expires. Redirect to it right away; don't log it, store it or send it by email.
What Customers Can Do
| On the portal | Controlled by |
|---|---|
| See and pay what's due | Always on |
| See their subscription | Always on |
| Update name, email, phone | features.customer_update |
| Browse and search invoices | features.invoice_history |
| Cancel a subscription | features.subscription_cancel |
Pay invoice opens the invoice's own page, where the customer pays by bank or wallet transfer and Access verifies the reference, as for any invoice. Customers don't save payment methods, so there's nothing to manage there.
Cancelling always takes effect at the end of the period the customer paid for: the subscription stays active until current_period_end and isn't billed again. See Subscriptions.
Deep Links
Pass flow_data to send the customer straight to one task. When they finish, after_completion decides what happens next.
curl -X POST https://api.tryaccess.xyz/api/v1/billing_portal/sessions \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-d '{
"customer": "cus_01J9Z8K2P3Q4R5S6T7U8V9W0X1",
"flow_data": {
"type": "subscription_cancel",
"subscription_cancel": { "subscription": "sub_01J9Z8K2P3Q4" },
"after_completion": {
"type": "redirect",
"redirect": { "return_url": "https://yourapp.com/account?canceled=1" }
}
}
}'flow_data.type | Opens | Needs |
|---|---|---|
customer_update | The billing information form | features.customer_update enabled |
subscription_cancel | The cancel page for one subscription | subscription_cancel.subscription, an active or past-due subscription of this customer, and features.subscription_cancel enabled |
after_completion.type | After the task |
|---|---|
portal_homepage | Back to the portal homepage, with a short confirmation (default) |
redirect | To redirect.return_url |
hosted_confirmation | A confirmation page, with your hosted_confirmation.custom_message (up to 500 characters) |
A flow your configuration doesn't allow, or a subscription that's already set to cancel, is rejected with invalid_state.
Configuration
Each merchant has one portal configuration. A merchant who has never changed it gets Access's recommended settings, and created is null until the first change.
You can change it in the dashboard (Settings → Customer portal, which can also put you back on the recommended settings) or with the API.
curl https://api.tryaccess.xyz/api/v1/billing_portal/configuration \
-H "x-api-key: sk_..."{
"id": "bpc_01J9Z8K2P3Q4R5S6T7U8V9W0X1",
"object": "billing_portal.configuration",
"active": true,
"is_default": true,
"business_profile": {
"headline": null,
"privacy_policy_url": null,
"terms_of_service_url": null
},
"default_return_url": null,
"features": {
"customer_update": {
"enabled": true,
"allowed_updates": ["name", "email", "phone"]
},
"invoice_history": { "enabled": true },
"subscription_cancel": {
"enabled": true,
"mode": "at_period_end",
"cancellation_reason": {
"enabled": true,
"options": ["too_expensive", "missing_features", "switched_service", "unused", "other"]
}
},
"subscription_pause": { "enabled": false }
},
"metadata": {},
"created": null,
"updated": null
}Update It
POST changes only the fields you send:
curl -X POST https://api.tryaccess.xyz/api/v1/billing_portal/configuration \
-H "Content-Type: application/json" \
-H "x-api-key: sk_..." \
-d '{
"business_profile": {
"headline": "Acme partners with Access for simplified billing."
},
"default_return_url": "https://yourapp.com/account",
"features": {
"customer_update": { "allowed_updates": ["name", "phone"] },
"subscription_cancel": {
"cancellation_reason": { "options": ["too_expensive", "unused", "other"] }
}
}
}'| Field | Description |
|---|---|
business_profile.headline | Shown next to your logo, up to 60 characters. null shows "… partners with Access for simplified billing." |
business_profile.privacy_policy_url, terms_of_service_url | Your policies (http or https) |
default_return_url | The Return to … link when a session doesn't set return_url |
features.customer_update.enabled, allowed_updates | Whether customers can edit their details, and which of name, email, phone |
features.invoice_history.enabled | Whether customers see their past invoices |
features.subscription_cancel.enabled | Whether customers can cancel. mode is always at_period_end |
features.subscription_cancel.cancellation_reason | Whether customers are asked why, and which reasons they pick from (at least one) |
features.subscription_pause.enabled | Reserved: pausing isn't available yet |
metadata | Your own key/value pairs. A value of "" removes that key |
Cancellation reasons: too_expensive, missing_features, switched_service, unused, customer_service, too_complex, low_quality, other.
Webhooks
The portal's actions send the usual events, so the rest of your integration doesn't need to know where a change came from.
| When a customer… | Event |
|---|---|
| Pays an invoice | invoice.paid |
| Cancels a subscription | customer.subscription.updated with reason: "cancel_requested", then customer.subscription.canceled at period end |
A cancellation made in the portal also carries what the customer told you:
{
"type": "customer.subscription.updated",
"timestamp": "2026-10-28T09:14:02.000Z",
"data": {
"id": "sub_01J9Z8K2P3Q4",
"object": "subscription",
"status": "active",
"cancel_at_period_end": true,
"current_period_end": "2026-11-10T00:00:00.000Z",
"reason": "cancel_requested",
"cancellation_details": {
"reason": "too_expensive",
"feedback": "We need a cheaper plan for a small team."
}
}
}(Other subscription fields are left out above.)
cancellation_details.reason is null when the customer skipped the question, and feedback is null when they left the box empty.
Expired Links
After expires_at (or expires_in seconds) the URL shows "For security reasons, this page has expired." with a link back to the session's return_url. Create a new session to let the customer in again.
Errors
| Scenario | HTTP | Code |
|---|---|---|
customer isn't one of your customers | 400 | resource_not_found |
| A field is missing, unknown or invalid | 400 | parameter_invalid |
| The flow isn't allowed or the subscription can't be canceled | 400 | invalid_state |
| Missing or wrong API key | 401 | unauthorized |
Building Your Own Portal
To build your own UI instead, use the token-based Customer Portal API.
How is this guide?