logoAccess

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

  1. Your backend creates a portal session for a customer with your API key.
  2. Access returns a short-lived url.
  3. You redirect the customer to it (for example from a "Manage billing" button).
  4. 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

Create portal 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

FieldTypeRequiredDescription
customerstringYesThe ID of one of your customers
return_urlstringNoWhere the portal's Return to … link goes. Defaults to the configuration's default_return_url
flow_dataobjectNoOpen the portal on one task instead of its homepage. See Deep links
localestringNoFor example en or am
expires_innumberNoSeconds 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 portalControlled by
See and pay what's dueAlways on
See their subscriptionAlways on
Update name, email, phonefeatures.customer_update
Browse and search invoicesfeatures.invoice_history
Cancel a subscriptionfeatures.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.

Pass flow_data to send the customer straight to one task. When they finish, after_completion decides what happens next.

Open the cancel page for one subscription
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.typeOpensNeeds
customer_updateThe billing information formfeatures.customer_update enabled
subscription_cancelThe cancel page for one subscriptionsubscription_cancel.subscription, an active or past-due subscription of this customer, and features.subscription_cancel enabled
after_completion.typeAfter the task
portal_homepageBack to the portal homepage, with a short confirmation (default)
redirectTo redirect.return_url
hosted_confirmationA 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.

Retrieve the configuration
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:

Update the configuration
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"] }
      }
    }
  }'
FieldDescription
business_profile.headlineShown next to your logo, up to 60 characters. null shows "… partners with Access for simplified billing."
business_profile.privacy_policy_url, terms_of_service_urlYour policies (http or https)
default_return_urlThe Return to … link when a session doesn't set return_url
features.customer_update.enabled, allowed_updatesWhether customers can edit their details, and which of name, email, phone
features.invoice_history.enabledWhether customers see their past invoices
features.subscription_cancel.enabledWhether customers can cancel. mode is always at_period_end
features.subscription_cancel.cancellation_reasonWhether customers are asked why, and which reasons they pick from (at least one)
features.subscription_pause.enabledReserved: pausing isn't available yet
metadataYour 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 invoiceinvoice.paid
Cancels a subscriptioncustomer.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.

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

ScenarioHTTPCode
customer isn't one of your customers400resource_not_found
A field is missing, unknown or invalid400parameter_invalid
The flow isn't allowed or the subscription can't be canceled400invalid_state
Missing or wrong API key401unauthorized

Building Your Own Portal

To build your own UI instead, use the token-based Customer Portal API.

How is this guide?