Attributes
-
idstring
Unique identifier for the object.
-
objectstring
String representing the object’s type. Objects of the same type share the same value.
-
configurationstringExpandable
The configuration used by this session, describing the features available.
-
createdtimestamp
Time at which the object was created. Measured in seconds since the Unix epoch.
-
customerstring
The ID of the customer for this session.
-
customer_
accountnullable string The ID of the account for this session.
-
flownullable object
Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows.
-
livemodeboolean
Has the value
trueif the object exists in live mode or the valuefalseif the object exists in test mode. -
localenullable enum
The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s
preferred_or browser’s locale is used.locales -
on_
behalf_ ofnullable stringConnect only The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this
on_account appear in the portal. For more information, see the docs. Use the Accounts API to modify thebehalf_ of on_account’s branding settings, which the portal displays.behalf_ of -
return_
urlnullable string The URL to redirect customers to when they click on the portal’s link to return to your website.
-
urlstring
The short-lived URL of the session that gives customers access to the customer portal.
{
"id": "bps_1MrSjzLkdIwHu7ixex0IvU9b",
"object": "billing_portal.session",
"configuration": "bpc_1MAhNDLkdIwHu7ixckACO1Jq",
"created": 1680210639,
"customer": "cus_NciAYcXfLnqBoz",
"flow": null,
"livemode": false,
"locale": null,
"on_behalf_of": null,
"return_url": "https://example.com/account",
"url": "https://billing.stripe.com/p/session/test_YWNjdF8xTTJKVGtMa2RJd0h1N2l4LF9OY2lBYjJXcHY4a2NPck96UjBEbFVYRnU5bjlwVUF50100BUtQs3bl"
}
Creates a session of the customer portal.
Parameters
-
configurationstring
The ID of an existing configuration to use for this session, describing its functionality and features. If not specified, the session uses the default configuration.
-
customerstring
The ID of an existing customer.
-
customer_
accountstring The ID of an existing account.
-
flow_
dataobject Information about a specific flow for the customer to go through. See the docs to learn more about using customer portal deep links and flows.
-
localeenum
The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer’s
preferred_or browser’s locale is used.locales -
on_
behalf_ ofstringConnect only The
on_account to use for this session. When specified, only subscriptions and invoices with thisbehalf_ of on_account appear in the portal. For more information, see the docs. Use the Accounts API to modify thebehalf_ of on_account’s branding settings, which the portal displays.behalf_ of -
return_
urlstring The default URL to redirect customers to when they click on the portal’s link to return to your website.
Returns
Returns a portal session object.
{
"id": "bps_1MrSjzLkdIwHu7ixex0IvU9b",
"object": "billing_portal.session",
"configuration": "bpc_1MAhNDLkdIwHu7ixckACO1Jq",
"created": 1680210639,
"customer": "cus_NciAYcXfLnqBoz",
"flow": null,
"livemode": false,
"locale": null,
"on_behalf_of": null,
"return_url": "https://example.com/account",
"url": "https://billing.stripe.com/p/session/test_YWNjdF8xTTJKVGtMa2RJd0h1N2l4LF9OY2lBYjJXcHY4a2NPck96UjBEbFVYRnU5bjlwVUF50100BUtQs3bl"
}