> ## Documentation Index
> Fetch the complete documentation index at: https://alguna.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Customer Portal Session

It's important to note that a customer portal session requires an account to be created on your Alguna account. The customer portal can reference a given account either by `accountId` or an alias stored against the account.

The request body must include at least one of `accountId` or `accountAlias`. Additionally, you can optionally provide settings for displaying various sections in the Customer Portal.

<ParamField body="accountId" type="string">
  The account id as seen in your Alguna dashboard. Required if no <code>accountAlias</code> is provided.
</ParamField>

<ParamField body="accountAlias" type="string">
  The alias (external id e.g. your Salesforce ID if you connected your integration with Alguna) stored against the account. It could also be your internal account ID for the given customer that you use in your product. Required if no <code>accountId</code> is provided.
</ParamField>

<ParamField body="planOverviewSettings" type="object">
  Settings tied to displaying the <em>Plan Overview</em> section in the Customer Portal.

  The <code>planOverviewSettings.showSection</code> property allows you to show or hide the entire section for a specific account. Defaults to <code>true</code>.

  The <code>planOverviewSettings.allowSubscriptionCancel</code> property is used to allow or disallow canceling subscriptions. Defaults to <code>true</code>.
</ParamField>

<ParamField body="invoiceListSettings" type="object">
  Settings tied to displaying the <em>Invoice List</em> section in the Customer Portal.

  The <code>invoiceListSettings.showSection</code> property allows you to show or hide the invoice list section. Defaults to <code>true</code>.
</ParamField>

<ParamField body="billingDetailsSettings" type="object">
  Settings tied to displaying the <em>Billing Details</em> section in the Customer Portal.

  The <code>billingDetailsSettings.showSection</code> property allows you to show or hide the section. Defaults to <code>true</code>.
</ParamField>

<RequestExample>
  ```json theme={null}
  {
    "accountId": "alguna-id",
    "accountAlias": "ext-39003209203023902",
    "planOverviewSettings": {
      "showSection": true,
      "allowSubscriptionCancel": true
    },
    "invoiceListSettings": {
      "showSection": true
    },
    "billingDetailsSettings": {
      "showSection": true
    }
  }
  ```
</RequestExample>

## Response

<ResponseExample>
  ```json theme={null}
  {
    "sessionUrl": "https://openapi.alguna.site/hs/NWyfb389IdjI930..."
  }
  ```
</ResponseExample>

<ResponseField name="sessionUrl" type="string">
  The URL to which the user should be redirected to access the Customer Portal. A custom domain (e.g. using your own app domain) can be configured to mask the Alguna domain upon request.
</ResponseField>
