sincecutoff.com
← all changes

Stripe customer portal sessions support recovery after expiration

Introduced 2026-09-30 · score 0.96

HOW TO USE IT

When creating a portal session that should be recoverable after expiration, set `after_expiration[type]` to `customer_login`. Customers can verify their email and receive a replacement session using the original URL; set `after_expiration[customer_login][expires_at]` to limit recovery.

curl https://api.stripe.com/v1/billing_portal/sessions \ -u "<YOUR_SECRET_KEY>:" \ -H "Stripe-Version: 2026-09-30.preview" \ -d "customer=<CUSTOMER_ID>" \ --data-urlencode "return_url=https://example.com/account" \ -d "after_expiration[type]"=customer_login
curl https://api.stripe.com/v1/billing_portal/sessions \ -u "<YOUR_SECRET_KEY>:" \ -H "Stripe-Version: 2026-09-30.preview" \ -d "customer=<CUSTOMER_ID>" \ --data-urlencode "return_url=https://example.com/account" \ -d "after_expiration[type]"=customer_login \ -d "after_expiration[customer_login][expires_at]"=<UNIX_TIMESTAMP>

WHY THIS HELPS

Let customers reopen the customer portal from an existing session URL after that session expires.

REQUIREMENTS AND LIMITATIONS

  • Availability: API version 2026-09-30.preview
  • customer (required): ID of an existing customer.
  • return_url: Redirect destination when the customer returns to your site; required if no default return URL is set in the Dashboard configuration.
  • after_expiration: Set when creating each portal session to configure behavior after expiration.
  • after_expiration.type (required): Set to `customer_login` to allow customers to verify their email and receive a replacement session with the same configuration.
  • after_expiration.customer_login.expires_at: Timestamp deadline for recovery. If omitted, recovery is available at any time after the session expires.
  • Prerequisite: Create a customer before creating the portal session.
  • Prerequisite: Authenticate customers on your site before creating sessions for them.
  • Prerequisite: Use the customer ID and a `return_url`; `return_url` is required when the Dashboard configuration has no default return URL.
  • Session recovery is enabled by setting `after_expiration` when creating each portal session.
  • If `expires_at` is omitted, customers can recover the session at any time after it expires.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card