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

# Customer Portal

> A self-serve hub where customers manage subscriptions, orders, receipts, and benefits — no support tickets required.

Every subscription business eventually drowns in the same requests: "Where's my invoice?", "Cancel my plan", "I need my license key again." The Customer Portal hands all of that back to the customer. It's a hosted, self-serve space where buyers can review what they've paid for, download receipts, update their billing, and unlock the benefits they're entitled to — without ever reaching your inbox.

Because Macropay is the [Merchant of Record](/), the receipts and invoices your customers pull from the portal are tax-compliant out of the box: VAT and sales tax are calculated, collected, and remitted by us, and our name is the seller of record on their statement. You ship the product; the portal handles the paperwork.

<img className="block dark:hidden" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/customer-portal/overview.light.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=6c59dc890a585b1c2088deb5782e5c46" width="2560" height="1600" data-path="assets/features/customer-portal/overview.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/customer-portal/overview.dark.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=35735575d9fe559e57d77c7108c2d52d" width="2560" height="1600" data-path="assets/features/customer-portal/overview.dark.png" />

## What customers can do

<CardGroup cols={2}>
  <Card title="Review orders & subscriptions" icon="receipt">
    Full purchase history, current plan status, and renewal dates in one view.
  </Card>

  <Card title="Download tax-compliant receipts" icon="file-invoice">
    Invoices and receipts reflect the VAT/sales tax we remit on your behalf as Merchant of Record.
  </Card>

  <Card title="Manage billing" icon="credit-card">
    Update payment details, switch plans, or cancel — securely, without touching card data you'd have to protect.
  </Card>

  <Card title="Claim benefits" icon="key">
    Retrieve license keys, file downloads, Discord and GitHub access, and any custom entitlements tied to a product.
  </Card>
</CardGroup>

## Two ways in

There are two paths to the portal: a public URL your customers sign in to, and a pre-authenticated link you mint from the API and drop into your own app.

### 1. The hosted sign-in URL

The portal lives at a fixed address tied to your organization:

```
https://macropay.ai/your-org-slug/portal
```

Customers authenticate by entering the email address they used at checkout. We send a verification code, and they're in — no password to set or remember. This is the zero-integration option: link to it from your footer, your welcome email, or a "Manage billing" menu item and you're done.

<img className="block dark:hidden" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/customer-portal/signin.light.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=f72552d54a0bab8346fcb8dbc1f6dced" width="2560" height="1600" data-path="assets/features/customer-portal/signin.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/customer-portal/signin.dark.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=09a07bbb3409ae6646010ea4c2e444e8" width="2560" height="1600" data-path="assets/features/customer-portal/signin.dark.png" />

### 2. A pre-authenticated portal link

If your users are already logged into your product, sending them through an email-code flow is friction you don't need. Create a **customer session** instead: it returns a one-time, pre-authenticated URL that drops the customer straight into their portal.

Call `customerSessions.create` with the customer's ID, then redirect to the `customerPortalUrl` on the response.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { Macropay } from "@macropayments/sdk";

  const macropay = new Macropay({
    accessToken: process.env["MACROPAY_ACCESS_TOKEN"] ?? "",
  });

  // Mint a session when the user clicks "Manage billing"
  export async function openPortal(customerId: string) {
    const session = await macropay.customerSessions.create({
      customerId,
    });

    redirect(session.customerPortalUrl);
  }
  ```

  ```python Python theme={null}
  from macropay import Macropay
  import os

  macropay = Macropay(
      access_token=os.environ.get("MACROPAY_ACCESS_TOKEN", ""),
  )

  # Mint a session when the user clicks "Manage billing"
  session = macropay.customer_sessions.create(
      customer_id="cus_123",
  )

  # session.customer_portal_url -> redirect your user here
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.macropay.ai/v1/customer-sessions \
    -H "Authorization: Bearer $MACROPAY_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{ "customer_id": "cus_123" }'
  ```
</CodeGroup>

<Tip>
  The returned link is short-lived and scoped to a single customer. Generate it on demand — right when the user clicks through — rather than storing it.
</Tip>

## A note on security

The portal lets customers update payment methods, but your servers never see raw card numbers. Card details are captured and stored in our **PCI DSS Level 1 compliant** vault, so the sensitive surface stays off your infrastructure and out of your compliance scope.

<Note>
  Disputes and chargebacks initiated against a payment are also handled by us as Merchant of Record — another support burden the portal and our MoR model keep off your plate.
</Note>

## Where it fits

The Customer Portal is the self-serve counterpart to checkout: [hosted checkout](/features/checkout/links) gets customers in, and the portal keeps them happy afterward. For agent- and usage-based products, the same portal surfaces metered orders and prepaid credit balances, so customers can see exactly what their usage cost — fully reconciled against the events and meters you bill on.
