For the complete documentation index, see llms.txt. This page is also available as Markdown.

Customer Portal Sessions

Create a customer portal session

post

Creates a customer portal session from a secure server using an API Key. The returned session contains the token and URL to hand to the customer.

Authorizations
AuthorizationstringRequired

An API Key token generated in the Dashboard in the format 'APIKey TOKEN_HERE'.

Path parameters
storeIdstring · flake-idRequired

The ID of the store to create the portal session for.

Example: 411486491630370816
customerIdstring · flake-idRequired

The ID of the customer to create the portal session for.

Example: 411486491630370816
Body

Request to create a new customer portal session from your back-end server using the management API

expires_in_secondsinteger · nullableOptional

How long the portal session stays valid, in seconds. When unset, a default expiry is used.

return_urlstring · nullableOptional

URL to redirect the customer back to after completing the portal flow

Responses
200

OK

application/json

Represents a customer portal session

idstring · flake-idRequiredExample: 411486491630370816
store_idstring · flake-idRequiredExample: 411486491630370816
customer_idstring · flake-idRequiredExample: 411486491630370816
tokenstring · nullableOptional

The token used to access the portal session

urlstring · nullableOptional

The URL to redirect the customer to for this portal session

return_urlstring · nullableOptional

URL to redirect the customer back to after completing the portal flow

created_atstring · date-timeRequired

Date and time when the portal session was created

expires_atstring · date-timeRequired

Date and time when the portal session expires

post/v1/stores/{storeId}/customers/{customerId}/portal-sessions
POST /v1/stores/{storeId}/customers/{customerId}/portal-sessions HTTP/1.1
Authorization: APIKey TOKEN_HERE
Content-Type: application/json
Accept: */*
Content-Length: 195

{
  "flow": {
    "subscription_cancel": {
      "subscription_id": "411486491630370816"
    },
    "subscription_payment_method_update": {
      "subscription_id": "411486491630370816"
    }
  },
  "expires_in_seconds": null,
  "return_url": null
}
{
  "id": "411486491630370816",
  "store_id": "411486491630370816",
  "customer_id": "411486491630370816",
  "flow": {
    "subscription_cancel": {
      "subscription_id": "411486491630370816"
    },
    "subscription_payment_method_update": {
      "subscription_id": "411486491630370816"
    }
  },
  "token": null,
  "url": null,
  "return_url": null,
  "created_at": "2026-01-01T00:00:00.000Z",
  "expires_at": "2026-01-01T00:00:00.000Z"
}

Last updated

Was this helpful?