> ## Documentation Index
> Fetch the complete documentation index at: https://dodopayments-mintlify-external-integration-datafast-autosen.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Customer Portal

> Empower customers to self-serve and manage their subscriptions, billing history, license keys, and profile securely.

<Info>
  The Customer Portal is a secure, hosted area where your customers can manage subscriptions, view invoices and access license keys details—without contacting support.
</Info>

<CardGroup cols={2}>
  <Card title="Create Portal Session (API)" icon="code" href="/api-reference/customers/create-customer-portal-session">
    Programmatically create secure, time‑bound portal sessions.
  </Card>

  <Card title="Subscriptions" icon="repeat" href="/features/subscription">
    Manage recurring plans, upgrades, downgrades, and add‑ons.
  </Card>
</CardGroup>

<br />

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/customer-portal-cover.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=70844e93510e072ac56170d9c6843ba0" alt="Customer portal overview cover" width="2880" height="1554" data-path="images/customer-portal/customer-portal-cover.png" />
</Frame>

## What Is the Customer Portal?

The portal provides a trusted, branded self‑service experience for customers to:

* **Access billing history**: View invoices and download.
* **Manage subscriptions**: Cancel a subscription.
* **Update payment methods**: Change payment methods for active subscriptions or reactivate subscriptions on hold.
* **Retrieve license keys**: Access all keys tied to purchases

## Key Benefits

* **Lower support volume**: Customers resolve common billing requests on their own
* **Faster time‑to‑value**: Immediate access to invoices and keys
* **Reduced churn risk**: Clear visibility into renewals and plan details
* **Secure by design**: Tokenized access with expiring links

## Access Methods

Customers can reach the portal using either a static link or a one‑time dynamic link.

### Static link (email‑based access)

Customers can request portal access by entering their email at a static link that never expires.

The static portal link format varies by environment:

**Test Mode** (for testing and development):

```bash theme={null}
https://test.customer.dodopayments.com/login/{business_id}
```

**Live Mode** (for production with real transactions):

```bash theme={null}
https://customer.dodopayments.com/login/{business_id}
```

Replace `{business_id}` with your actual business identifier, then share the appropriate link with customers so they can enter their email and receive secure access to the portal.

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/email-login.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=a9224c36b14f95f710c827f23d0bd3aa" alt="Email-based login screen" width="2880" height="1550" data-path="images/customer-portal/email-login.png" />
</Frame>

<Steps>
  <Step title="Merchant flow">
    1. Go to Sales → Customer.
    2. Click <i>Share invite</i>.
    3. Copy the <i>Static link</i> and share it with your customer.
  </Step>

  <Step title="Customer flow">
    1. Open the static link.
    2. Enter the email used at purchase.
    3. Receive a secure login link to access the portal.

    <Check>
      Existing customers are recognized automatically.
    </Check>
  </Step>
</Steps>

### Dynamic link (magic link)

A personalized, one‑time magic link that sends customers directly into the portal. The link expires in 24 hours.

<Warning>
  Dynamic links expire after 24 hours. If it expires, generate and send a new link.
</Warning>

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/magic-link.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=c49ec70fa8bd992cbad9f40e807290c2" alt="Magic link direct access" width="2880" height="1554" data-path="images/customer-portal/magic-link.png" />
</Frame>

<Steps>
  <Step title="Merchant flow">
    1. Go to Sales → Customer.
    2. Click <i>Share invite</i>.
    3. Copy the <i>Dynamic link</i> and share it with your customer.
  </Step>

  <Step title="Customer flow">
    1. Open the dynamic link.
    2. Access the Customer Portal directly without entering an email.
  </Step>
</Steps>

## Portal Features

<CardGroup cols={2}>
  <Card title="Billing History" icon="file-invoice">
    View all transactions and invoice details. Download PDFs of every invoice from your account.
  </Card>

  <Card title="Subscriptions" icon="repeat">
    Review active and past subscriptions, including renewal dates. Cancel any plan anytime.
  </Card>

  <Card title="Payment Methods" icon="credit-card">
    Update payment methods for subscriptions. Reactivate subscriptions on hold by updating payment method to clear dues.
  </Card>

  <Card title="Profile" icon="user">
    View or update your name, email, and phone number directly in your profile settings.
  </Card>
</CardGroup>

## Updating Payment Methods

Customers can update their payment methods directly from the Customer Portal. This feature is especially important for reactivating subscriptions that have been placed on hold due to failed payments.

### Viewing Current Payment Method

From the subscription management page, customers can see their current payment method displayed alongside subscription details. The payment method section shows the card type, last four digits, and an "Edit" button to update it.

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/subscription-payment-method.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=277b0ff37a07b4be665ada5ebaaed1a5" alt="Subscription details page showing current payment method with edit option" width="3104" height="1962" data-path="images/customer-portal/subscription-payment-method.png" />
</Frame>

### Updating Payment Method

When customers click "Edit" on the payment method section, they can:

1. **Select an existing payment method**: Choose from previously saved payment methods
   <Frame caption="Edit payment method modal showing saved payment methods">
     <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/edit-payment-method.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=6ff13cc0a1a0adad9aeff496542c5f58" width="3104" height="1962" data-path="images/customer-portal/edit-payment-method.png" />
   </Frame>
2. **Add a new payment method**: Enter new card details securely
   <Frame caption="Payment method update form with card input fields">
     <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/update-payment-method-form.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=f0b9051689805b015e00ee008aa9d27f" width="3104" height="1962" data-path="images/customer-portal/update-payment-method-form.png" />
   </Frame>

### Reactivating Subscriptions on Hold

When a subscription is placed on `on_hold` state due to a failed payment, customers must update their payment method to reactivate it. The update process automatically:

1. **Creates a charge** for remaining dues
2. **Generates an invoice** for the charge
3. **Processes the payment** using the new payment method
4. **Reactivates the subscription** to `active` state upon successful payment

<Warning>
  Subscriptions in `on_hold` state will not renew automatically. Customers must update their payment method to clear dues and reactivate the subscription.
</Warning>

<Info>
  After successfully updating the payment method for an `on_hold` subscription, customers will see a confirmation page and receive email notifications about the successful payment and subscription reactivation.
</Info>

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/GNdvRYG-xZ5EZMcJ/images/customer-portal/payment-successful.png?fit=max&auto=format&n=GNdvRYG-xZ5EZMcJ&q=85&s=e227452b28ea6f17260e64deb5c0013c" alt="Payment successful page confirming payment method update and subscription reactivation" width="3104" height="1962" data-path="images/customer-portal/payment-successful.png" />
</Frame>

### Payment Method Update Flow

<Steps>
  <Step title="Access subscription details">
    Navigate to the subscription management page in the Customer Portal to view subscription details and current payment method.
  </Step>

  <Step title="Click Edit on payment method">
    Click the "Edit" button next to the payment method section to open the payment method update interface.
  </Step>

  <Step title="Select or add payment method">
    Choose an existing saved payment method or add a new one by entering card details securely.
  </Step>

  <Step title="Confirm changes">
    Click "Confirm Changes" to update the payment method. For `on_hold` subscriptions, this will automatically create a charge for remaining dues.
  </Step>

  <Step title="Complete payment (if on hold)">
    If the subscription is on hold, customers will be redirected to complete the payment for remaining dues. Upon successful payment, the subscription is automatically reactivated.
  </Step>

  <Step title="Confirmation">
    Customers receive confirmation that the payment method has been updated and, if applicable, that the subscription has been reactivated.
  </Step>
</Steps>

## Integration Examples

Create a time‑bound Customer Portal session for a specific customer via API, then redirect the user to the session URL.

<CodeGroup>
  ```typescript Node.js theme={null}
  const session = await client.customers.customerPortal.create('cus_123');

  // Redirect the user to the hosted Customer Portal
  window.location.href = session.link;
  ```
</CodeGroup>

## Troubleshooting

* **Link expired**: Generate and send a new dynamic link.
* **Email not recognized**: Ask the customer to use the email associated with their purchase
* **Subscription on hold**: If a subscription is on hold, customers must update their payment method through the portal to clear dues and reactivate the subscription. The update process will automatically charge for remaining dues.
* **Payment method update failed**: If payment fails during the update process for an `on_hold` subscription, the subscription will remain on hold. Customers can try again with a different payment method.
