Logo

Customer Portal Session

You can create a Stripe Portal Session to allow customers to manage their payment methods and download their invoice history.

The Stripe Portal Session allows customers to:

  • Manage their payment methods
  • Change billing address
  • Download their invoice history

Create a Stripe Portal Session

The session will contain a URL to the Stripe Portal. The customer can use this URL to manage their payment methods and download their invoice history.

const session = await openmeter.customers.stripe.createPortalSession(
  'customer-id-or-key',
  {
    returnUrl: 'https://your-app.com/portal',
  },
);

// session.url: 'https://billing.stripe.com/p/login/test_aEUg12345678901234567890'

Last updated on