# Customer portals

> Short-lived links where a customer can view, download and pay their invoices.

Source: https://docs.borga.is/api/customer-portals

See the [customer portal guide](/billing/customer-portal) for what payers see.

**The customer portal object**

- `id` (string): Prefixed `cprt_`.
- `customer` (string): <Param name="url" type="string">The link to share, on checkout.borga.is.
- `status` (enum): `active`, `expired`, `revoked` or `consumed`.
- `reusable` (boolean): - `expires_at` (timestamp) - `revoked_at` (timestamp | null) - `last_accessed_at` (timestamp | null) - `metadata` (object) - `created_at` (timestamp) ## Create a portal link `POST /v1/customer_portals` **Body** - `customer` (string) <Param name="expires_in" type="integer" default="3600">Seconds, 60 to 86400.
- `reusable` (boolean, default true): `false` for a single-use link.
- `metadata` (object): ```ts Node.js const portal = await borga.customerPortals.create({ customer: "cus_8Jk2Lm4Np6Qr8St0Uv2Wx4Yz", expires_in: 3600, // seconds; up to 24 hours reusable: true, }); // Link or email portal.url to the customer. console.log(portal.url); // https://checkout.borga.is/portal/cprt_… ``` ```json title="Response" { "id": "cprt_2Wx4Yz6Ab8Cd0Ef2Gh4Ij6Kl", "customer": "cus_8Jk2Lm4Np6Qr8St0Uv2Wx4Yz", "url": "https://checkout.borga.is/portal/cprt_2Wx4Yz6Ab8Cd0Ef2Gh4Ij6Kl", "reusable": true, "status": "active", "expires_at": "2026-09-07T13:00:00.000Z", "revoked_at": null, "last_accessed_at": null, "metadata": {}, "created_at": "2026-09-07T12:00:00.000Z" } ``` ## Retrieve a portal link `GET /v1/customer_portals/:id` ## List portal links `GET /v1/customer_portals` Returns up to `limit` links without a cursor. **Query parameters** - `customer` (string) <Param name="limit" type="integer" default="25">Up to 100.

## Revoke a portal link

`DELETE /v1/customer_portals/:id`

The link stops working immediately. Revoking an already revoked link is a no-op.
