> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.solvimon.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.solvimon.com/_mcp/server.

# Portal links

Every hosted page Solvimon serves to one of your customers is a portal URL: one resource, one create call, and a type that decides which page the link opens.

---

## Why this matters

The hosted checkout, the customer portal and a checkout session look like three products, and they are documented as three guides, but they are the same resource. A portal URL is a link Solvimon hosts on your behalf, created with your API key, scoped to one thing, and handed to one customer. Only `type` and its matching sub-object differ.

That is worth knowing before you build against any of them. The lifecycle, the expiry, the revoke call and the webhooks are the same whichever page you are creating, so what you learn once applies to all of them. This page covers that shared part. The guide for each type covers what only that type does.

## The types

`type` is required when you create a link, and it fixes everything else: which sub-object you have to send, where the link points, and how the customer is authenticated. These are the types to build against:

| `type`                           | The page it opens                                                   | Sub-object                       | Guide                                                                                                                |
| :------------------------------- | :------------------------------------------------------------------ | :------------------------------- | :------------------------------------------------------------------------------------------------------------------- |
| `CHECKOUT_SESSION`               | A checkout prepared per buyer, with its customers and subscriptions | `checkout_session`               | [Checkout sessions](/platform-guides/customers-and-billing/checkout-sessions)                                        |
| `INIT_PRICING_PLAN_SUBSCRIPTION` | A public checkout page for one template subscription                | `init_pricing_plan_subscription` | [Hosted checkout](/platform-guides/customers-and-billing/hosted-checkout)                                            |
| `CUSTOMER`                       | One customer's own billing portal                                   | `customer`                       | [Customer portal](/platform-guides/customers-and-billing/customer-portal)                                            |
| `QUOTE_VERSION`                  | A quote for the customer to read and accept                         | `quote_version`                  | [Share, accept and convert a quote](/platform-guides/customers-and-billing/quoting/share-accept-and-convert-a-quote) |

The sub-object is required when you create the link, and sending the wrong one is refused: `customer` on a `QUOTE_VERSION` link answers `400` with "field may only be set when 'type' value is 'CUSTOMER'".

Most types take a `customer_id`, which is the customer the link belongs to. A checkout session does not: it names its own customers inside `checkout_session`, so `customer_id` is refused on that type.

## Link lifecycle

| `status`    | What it means                                                                    |
| :---------- | :------------------------------------------------------------------------------- |
| `PUBLISHED` | The link works until `expires_at`                                                |
| `REVOKED`   | You revoked it                                                                   |
| `EXPIRED`   | `expires_at` passed while the link was `PUBLISHED`                               |
| `CLOSED`    | The link's checkout session is done, completed or failed. Checkout sessions only |

Only `PUBLISHED` moves to `EXPIRED`, so a link you revoked stays `REVOKED` when its expiry passes rather than quietly changing status later.

`CLOSED` is final and behaves unlike the rest: the link accepts no further changes, it cannot be revoked, and it does not expire. It stays readable on purpose, which is what lets the page a buyer is returned to show them how their session ended.

## Expiry

`expiry_period` sets how long the link works from the moment it is created, and Solvimon resolves it into the read-only `expires_at`. It is a `{ "type": ..., "value": ... }` object, where `type` is `MINUTE`, `HOUR`, `DAY`, `WEEK`, `MONTH` or `YEAR`.

```json
"expiry_period": { "type": "DAY", "value": 7 }
```

Checkout sessions are the exception, because the link is minted for one buyer at one moment: at least 30 minutes, at most one hour, one hour when you leave it out, and it cannot be changed afterwards. Create a session when you are about to send someone to it.

## Revoking

[POST /v1/portal-urls/\{id}/revoke](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/post-portal-urls-by-resource-id-revoke) ends a link before its expiry.

**`Revoke a link`**

```bash Revoke a link
curl -X POST https://test.api.solvimon.com/v1/portal-urls/purl_example/revoke \
  -H "X-API-KEY: <apiKey>"
```

Revoking is how you take back a link that reached the wrong person, or one whose contents are no longer what you want to sell. A `CLOSED` link cannot be revoked; there is nothing left to withdraw.

## How the customer is authenticated

Nobody logs in. The link itself carries the credential, and `authentication`, which is read-only and derived from the type, says which kind.

| `authentication` | Types                               | How it works                                                                                                         |
| :--------------- | :---------------------------------- | :------------------------------------------------------------------------------------------------------------------- |
| `IDENTITY_TOKEN` | Everything except checkout sessions | The link carries a token under `t`, and `token` and `url` stay readable on the link afterwards                       |
| `SIGNED_TOKEN`   | `CHECKOUT_SESSION`                  | The link carries a random handle under `h`, which the page exchanges for a short-lived token scoped to that one link |

> **Note**
>
> `SIGNED_TOKEN` is the direction of travel. It is what new link types use, and the intention is for the existing types to move onto it as well, which would make `IDENTITY_TOKEN` the older of the two. Nothing changes for links you have today, and we will say so here before anything does.

> **Warning**
>
> A `SIGNED_TOKEN` link returns its `token` and `url` **only in the create response**. They are left out of later reads, of list responses and of webhooks, because only a hash of the handle is stored. Capture the `url` when you create the link, or create a new one.

## Create, read and change a link

Every type uses the same endpoints. Only the sub-object changes.

**`Create a portal link`**

```bash Create a portal link
curl -X POST https://test.api.solvimon.com/v1/portal-urls \
  -H "X-API-KEY: <apiKey>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "CUSTOMER",
    "customer_id": "cust_example",
    "expiry_period": { "type": "DAY", "value": 7 },
    "customer": {
      "display": { "invoices": true }
    }
  }'
```

**`Response (trimmed)`**

```json Response (trimmed)
{
  "object_type": "PORTAL_URL",
  "id": "purl_example",
  "type": "CUSTOMER",
  "status": "PUBLISHED",
  "authentication": "IDENTITY_TOKEN",
  "expiry_period": { "type": "DAY", "value": 7 },
  "expires_at": "2026-12-09T10:00:00Z",
  "url": "https://portal.solvimon.com/customer?t=..."
}
```

| Call                                                                                                   | Does                                                   |
| :----------------------------------------------------------------------------------------------------- | :----------------------------------------------------- |
| [POST /v1/portal-urls](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/post-portal-urls)                                   | Create a link of any type                              |
| [GET /v1/portal-urls](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/get-portal-urls)                                     | List links, filtered by customer, by type or by expiry |
| [GET /v1/portal-urls/\{id}](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/get-portal-urls-by-resource-id)                 | Read one link                                          |
| [PATCH /v1/portal-urls/\{id}](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/patch-portal-urls-by-resource-id)             | Change the link's own configuration                    |
| [POST /v1/portal-urls/\{id}/revoke](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/post-portal-urls-by-resource-id-revoke) | End a link early                                       |

Two calls exist only for checkout sessions: [POST /v1/portal-urls/\{id}/preview](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/post-portal-urls-by-resource-id-preview) runs the buyer's preview from your side, and [POST /v1/portal-urls/\{id}/complete](https://docs.solvimon.com/api-docs/transaction-api/portal-urls/post-portal-urls-by-resource-id-complete) resumes a session that failed to finish.

## Webhooks

`PORTAL_URL` events are delivered for every type, so one subscription follows all your links:

| Event                | Fires when                                                               |
| :------------------- | :----------------------------------------------------------------------- |
| `PORTAL_URL.CREATED` | A link is created                                                        |
| `PORTAL_URL.UPDATED` | A link changes, including every edit a buyer makes in a checkout session |
| `PORTAL_URL.EXPIRED` | A published link reaches its expiry                                      |

Checkout sessions add `PORTAL_URL.CHECKOUT_SESSION_COMPLETED` and `PORTAL_URL.CHECKOUT_SESSION_FAILED`. See [Webhook event types](/platform-guides/for-developers/webhook-event-types).

`data` holds the portal URL, with the caveat above: a `SIGNED_TOKEN` link's `token` and `url` are never in it.

## Edge cases

* **One link, one subject.** A link is scoped to the invoice, customer, quote or session it was created for. It cannot be repointed at another one later; create a new link instead.
* **An expired link is not deleted.** It stays readable through the API with `status` `EXPIRED`, so you can still see what was sent and when it lapsed.
* **Permissions are shared.** The `PORTAL_URL` permissions apply to every type: creating a link needs `PORTAL_URL.CREATE`, reading one needs `PORTAL_URL.VIEW`.