Pricing table
Show your plans on your own site with one script tag. Prices stay in step with your catalogue.
Create a table
A pricing table is an ordered list of entries. Each entry pairs a monthly plan with an annual plan, or names just one of them. Creating one needs a secret key with the catalog:write scope.
| Field | Notes |
|---|---|
entries | 1 to 8. Each has monthly_plan_id, annual_plan_id or both, plus optional highlight, features (up to 20 lines) and cta_label. |
default_interval | monthly (the default) or annual: which side of the toggle shows first. |
checkout_url | Where each plan's button links. {plan_id}, {plan_code} and {interval} are filled in. |
active | Default true. An inactive table is not shown to visitors. |
Embed it
Create a publishable key (pk_test_… or pk_live_…) and add two tags to your page:
Optional attributes on the div:
| Attribute | Effect |
|---|---|
data-interval | monthly or annual: the side of the toggle shown first, instead of the table's default. |
data-checkout-url | Overrides the table's checkout_url on this page. |
The script has no dependencies and renders inside a Shadow DOM, so your CSS cannot break it and its CSS cannot leak into your page.
From a click to a checkout
A plan's button is a plain link to your checkout_url. Your server knows who is signed in, so it does the rest:
- Read
planandintervalfrom the query string. - Make sure the visitor is signed in, and that they exist as a customer.
- Open a checkout session with your secret key.
- Redirect to the session URL.
Anonymous visitors never create sessions, and a secret key never reaches the browser.
What a publishable key can read
One endpoint: GET /api/v1/pricing-tables/{id}. It returns the table's plans and your branding, and never customer data. An inactive table answers 404 to a publishable key. On every other endpoint a publishable key answers 403.