# Customer portal

A page where your customers see what they owe and what they've paid, and manage their saved cards and subscriptions. No passwords: they sign in with a one-time link sent to their email.

**URL:** `https://paylynks.io/portal/<merchant_id>`

## What customers can do

- Pay open invoices and payment requests
- See payment history (bank payments show as clearing until they settle)
- Update the card on a subscription, or cancel it
- Remove saved cards (a card paying an active subscription has to be replaced on the subscription first)

They only see records with their email at your business.

## Sending customers in

- **Dashboard:** open a customer → **Email a link to their customer portal**.
- **Your own app:** create a one-time link and redirect the customer to it.

```bash
curl -X POST https://paylynks.io/api/v1/customers/cus_.../portal_sessions \
  -H "Authorization: Bearer $PAYLYNKS_SECRET_KEY"
```

```json
{ "object": "portal_session", "customer": "cus_...", "url": "https://paylynks.io/api/portal/auth?...", "expires_in": 1800 }
```

The link works once and expires in 30 minutes. It becomes a 7-day session on the customer's device.
