Guides

Customer Portal

A secure page where your customers see their plan, invoices and payments, and pay what they owe.

The customer portal is a page you link your customers to: it shows their subscriptions, invoices (with PDF downloads) and payments, and lets them pay an open invoice. You create a link for one customer at a time; it carries a short-lived token scoped to that customer only.

curl -X POST https://api.pimabill.com/api/portal/customers/usr_98765/sessions \
  -H "Authorization: Bearer sk_live_a1b2c3d4..." \
  -H "Content-Type: application/json" \
  -d '{ "expiresInMinutes": 60 }'
{
  "url": "https://app.pimabill.com/portal/usr_98765?token=...",
  "expiresAt": "2026-10-25T13:00:00.000Z"
}
  • The path uses your ID for the customer (externalId).
  • expiresInMinutes is between 5 and 10080 (7 days); the default is 60.
  • Create the link from your server when the customer asks for it (for example from a "Billing" button in your app), then redirect them to url.

Never put an API key in a portal link: the portal refuses API keys, because a link that carried one would give your customer full access to your account.

Building your own page

The portal's data is also available to your own frontend, with the same token, under /api/portal/customers/{externalId}/...: billing, subscriptions, invoices, payments, invoices/{invoiceId}/pdf and invoices/{invoiceId}/checkout (which returns a payment link for an open invoice).

Copyright © 2026