Skip to navigation

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:

typeThe page it opensSub-objectGuide
CHECKOUT_SESSIONA checkout prepared per buyer, with its customers and subscriptionscheckout_sessionCheckout sessions
INIT_PRICING_PLAN_SUBSCRIPTIONA public checkout page for one template subscriptioninit_pricing_plan_subscriptionHosted checkout
CUSTOMEROne customer’s own billing portalcustomerCustomer portal
QUOTE_VERSIONA quote for the customer to read and acceptquote_versionShare, 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.

statusWhat it means
PUBLISHEDThe link works until expires_at
REVOKEDYou revoked it
EXPIREDexpires_at passed while the link was PUBLISHED
CLOSEDThe 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.

"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 ends a link before its expiry.

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.

authenticationTypesHow it works
IDENTITY_TOKENEverything except checkout sessionsThe link carries a token under t, and token and url stay readable on the link afterwards
SIGNED_TOKENCHECKOUT_SESSIONThe link carries a random handle under h, which the page exchanges for a short-lived token scoped to that one link

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.

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.

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

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)
{
"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=..."
}
CallDoes
POST /v1/portal-urlsCreate a link of any type
GET /v1/portal-urlsList links, filtered by customer, by type or by expiry
GET /v1/portal-urls/{id}Read one link
PATCH /v1/portal-urls/{id}Change the link’s own configuration
POST /v1/portal-urls/{id}/revokeEnd a link early

Two calls exist only for checkout sessions: POST /v1/portal-urls/{id}/preview runs the buyer’s preview from your side, and POST /v1/portal-urls/{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:

EventFires when
PORTAL_URL.CREATEDA link is created
PORTAL_URL.UPDATEDA link changes, including every edit a buyer makes in a checkout session
PORTAL_URL.EXPIREDA published link reaches its expiry

Checkout sessions add PORTAL_URL.CHECKOUT_SESSION_COMPLETED and PORTAL_URL.CHECKOUT_SESSION_FAILED. See 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.