Publish a product page or buy button
In this guide
Keyseal can host a branded product page, open checkout from your website, and issue a free licence after a buyer confirms their email address. Each plan has its own buy link. A hosted product page and an embedded button can both point to the same plan.
Publish a product page
To share an offer with its documents, enter HTTPS links to the terms of sale and privacy notice in the product settings, then share its public page at /p/{organization}/{product}. Both links appear above the plans. If your website opens checkout directly with a /b/… URL or an embedded button, place links to both documents beside the buy button.
Open the product in the console, enable its public page and copy the link. To do this programmatically, send PATCH /api/v1/products/{product_id} with {"page_enabled": true}, call the MCP tool catalog_products_update, or run keyseal products update <product-id> --page. Use --no-page to withdraw the page. The optional HTTPS image_url (--image-url in the CLI) supplies the product image. Uploaded product thumbnails and static images on the configured Keyseal origin appear inline and in social previews. Other HTTPS hosts appear as an “Open external image” link. The store, customer area, free checkout, emails and console previews apply the same rule to publisher logos.
The console shows an authenticated preview, including on private product pages. The management API returns that preview from GET /api/v1/products/{product_id}/image. The store serves the returned image_url once the page is enabled. Replacing or clearing the image withdraws its previous URL. An image from another site stays a plain link: Keyseal never makes a visitor load an image hosted elsewhere, to protect their privacy.
To host the image at Keyseal, drop it on the product page in the console (preview and “Remove” button; the address field sits behind “Use an address”; on a new product the image is sent right after saving), run keyseal products upload-image <product-id> <file>, call the MCP tool catalog_products_upload_image, or send PUT /api/v1/products/{product_id}/image with the file in standard base64 as content_base64. The file must be a still PNG, JPEG or WebP of at most 512 KiB and eight million pixels. Keyseal strips the metadata and keeps a WebP of at most 768 pixels per side. It is served only while the product page is enabled.
The organization logo
Upload the logo in Settings › Organization in the console, with PUT /api/v1/organization/logo (content_base64), keyseal organization upload-logo <file> (live key) or the MCP tool organization_upload_logo. The same input limits apply; Keyseal keeps a WebP of at most 256 pixels per side at /organization-logos/{organization_id}/{digest}.webp. It holds for both environments and appears in buyer emails, the customer area and product pages. Mail proxies may keep it up to a day. Clearing logo_url removes it, and replacing it withdraws the old address (caches may keep showing the old logo for up to a day). A logo hosted elsewhere appears only as an “Open external logo” link.
The automatic updates-ending email gives the end date and explains that the software keeps working. Keyseal provides fixed wording in both languages, including for previously queued reminders and organizations with older custom templates. Buyers can renew from their customer area. A requested renewal email still contains its renewal link.
| Address | What the buyer sees |
|---|---|
/p/{organization} |
The publisher's store, with a card for each product whose page is enabled |
/p/{organization}/{product} |
Description, available plans, seat and update allowances, features, and the latest published release with its plain-text notes |
/b/{organization}/{plan} |
Stripe Checkout for a paid plan, or the email form for a free plan |
The public page lists free plans and plans with an active price already synced to Stripe. Each must be public. Renewal plans are available to existing customers through their renewal links. Store pages use the organization's logo and colours, work without JavaScript, include Open Graph tags, and can be cached for 60 seconds. Disabled and unknown pages return the same 404.
Pages open in the live environment by default. Append ?environment=test&locale=en for the English test page. Test pages have a banner and request exclusion from search results. Both English (en) and French (fr, the default) are available.
Display prices on your website
From your website's server, request GET /v1/catalog/{organization}/{product}. For example,
/v1/catalog/atelier/editor?environment=test returns the test plans. The default environment
is live. Find the plan by its slug in plans. Resolve its buy_url against the Keyseal
origin to reach checkout in the same environment.
In this example, the Team plan costs €15.99 per year before tax in the test environment.
{
"product": {"slug": "editor", "name": "Editor"},
"plans": [
{
"slug": "team", "name": "Team", "free": false,
"amount": 1599, "amount_exponent": 2, "currency": "eur", "interval": "year", "tax_behavior": "exclusive",
"buy_url": "/b/atelier/team?environment=test"
}
]
}
Divide the integer amount by 10 ** amount_exponent to get the price in units of currency.
The exponent reflects how Stripe represents that price. With exponent 2, 1599 in EUR is €15.99
and 500 in UGX is 5 Ugandan shillings. For a paid plan, format the result for your reader.
const price = plan.amount / 10 ** plan.amount_exponent;
const text = new Intl.NumberFormat("en", {
style: "currency", currency: plan.currency, maximumFractionDigits: plan.amount_exponent
}).format(price);
The interval is month or year for subscriptions and null for a one-time
purchase. Label an inclusive price as tax included and an exclusive price as excluding tax.
Checkout calculates the tax due for the buyer. A free plan has free: true and null for
amount, amount_exponent, currency, interval and tax_behavior.
An unknown or disabled page returns 404 not_found. An enabled page with no plans on sale
returns the product with "plans": []. The same applies when the publisher's sales are suspended.
Hide the buy buttons in that case.
Embed a buy button
To test the button, add the script once per page and place the link where you want the button to appear. This example uses a fictional plan. With environment=test, a paid plan uses its Stripe test price and the payment is simulated.
<script src="https://keyseal.io/js/keyseal.v1.js" defer></script>
<a class="keyseal-button" href="https://keyseal.io/b/acme/tool-pro?environment=test&locale=en">Buy Tool Pro</a>
To publish the button in your store, select Live in the Keyseal console and open Catalogue. On the row for the plan you want to sell, click Buy link. Replace the entire href value with the copied link and add ?locale=en for checkout in English. Set the button text to match your plan. The live link uses the actual price of your paid plan.
You can also open that plan in the catalogue and copy the script and button from Integration code. Style the keyseal-button link with your own CSS.
On an eligible click the script opens a 520 × 760 window and adds the embedding page's origin to the URL. The anchor and the script must point to the same Keyseal origin. Host the page on HTTPS. For a test plan, you can also use http://localhost[:port]. Live embeds exclude local origins. A blocked popup, an unsupported origin, a modifier click, or disabled JavaScript leaves the link usable through normal browser navigation. The versioned script has a one-hour public cache and makes no network requests of its own.
| Browser event | Meaning |
|---|---|
keyseal:purchased |
Keyseal recorded the purchase or renewal and its confirmation reached the publisher's page |
keyseal:claimed |
The free-plan form was submitted. The buyer still needs to confirm their address |
keyseal:closed |
The window closed before the page received either confirmation. The purchase may have completed |
The script dispatches each event on the clicked link and on window. The first two carry organization, product, plan and environment in event.detail. The close event carries an empty object. Only the most recently opened checkout window is observed. The buyer's email address, licence key and checkout session ID stay off the publisher's page.
window.addEventListener("keyseal:purchased", (event) => {
document.querySelector("#thanks").hidden = false;
});
Alternatively, const stop = Keyseal.on("purchased", (detail, link) => { /* update the page */ }) registers a callback. Call stop() to unsubscribe. The same API accepts claimed and closed. Use browser notifications for feedback and signed server notifications for fulfilment. Outgoing webhooks
Offer a free licence
Create a public perpetual or perpetual_with_updates plan. Enable Free in the console, set free: true in POST /api/v1/plans or catalog_plans_create, or use the CLI. Leave the price empty.
keyseal plans create --product <product-id> --slug tool-free --name Free --kind perpetual --public --free
You can update an eligible unpriced plan with PATCH /api/v1/plans/{plan_id}. An incompatible kind or a price on creation returns 422 free_plan_not_allowed. Adding a price to a plan that remains free returns 422 plan_is_free. Free plans work independently of Stripe, including when the publisher has no Stripe connection.
What happens after a click
Paid plan. Keyseal redirects the buyer to Stripe Checkout. After payment, the success page refreshes until Keyseal has recorded the order. It shows the active licence's key for up to 24 hours. Keyseal also emails the key. A renewal extends the existing licence and the success page shows the update entitlement. In embedded checkout, canceling returns the buyer to a Keyseal page with a close button.
With a discount code. /b/{organization}/{plan}?code=XXX (plus &environment=test in test) applies a discount code made in Keyseal in advance: the payment page shows the discounted price, with no input field. keyseal.js passes the address on as it is. A code that is unknown, inactive, expired, used up, for another product or refused by Stripe opens a "This code is no longer valid" page (status 410, without the code) with a button to buy at the regular price: without that click, no full-price session is opened. A 100% code asks for no card. A free plan ignores the code. Without ?code=, nothing changes. Your proxy's access log must not write code= (see docs/en/deploy.md).
Free plan. The buyer enters an email address and sees who will receive it. Keyseal queues a confirmation email, up to three per address per hour in that publisher and environment. The same inbox message appears when the limit is reached. The link lasts 48 hours and opens a confirmation button. Opening the email link alone leaves the licence unissued, so an email scanner can safely visit it.
Confirming issues one licence per address and plan, displays its key and emails it to the buyer. A repeat confirmation points to the customer area. If the link expired, start again from the plan. Free claims create a licence.created event with origin: "free" and create no order. The customer area gives buyers access to their licences and covered files.
The sale alert
Each owner of the organization gets an email for each sale paid through the checkout page: a purchase, a renewal or a subscription's first invoice, including orders at 0. The email gives the amount in its currency, the product, the plan, the discount's name when a code was used, and a View the sale button to the console. It holds nothing of the buyer and never the code's text. A subscription's later invoices, and free, manual or imported licences, send none. In test, the subject starts with [TEST].
The alert is on by default, for both environments. To turn it off, use Settings › Organization in the console, PATCH /api/v1/organization with {"sale_alerts": false}, the MCP tool organization_update, or keyseal organization sale-alerts off (with a live key).