Skip to content

Pricing tables and checkout

StatsKit gives you a single redirect endpoint that starts a Stripe Checkout session and stamps the visitor’s identity into it, so the purchase is attributed back to the visitor’s journey. You point a link or button at it, no server code required.

A pricing table is built in the dashboard (or via the MCP create_pricing_table tool). It defines the tiers you sell and, importantly, allowlists the Stripe price ids that /v1/checkout is allowed to charge. Only prices configured in a pricing table can be used at checkout, which is what makes it safe to expose the endpoint with a public key.

GET or POST https://statskit.ai/api/v1/checkout. It responds with a 303 redirect to a Stripe Checkout session.

ParamRequiredMeaning
syesYour public ingest key vpk_live_…. Write-only, safe in the browser.
priceyesA Stripe price id. Must be allowlisted in a pricing table.
vidrecommendedThe visitor id (statskit_visitor_id cookie). Stamped into checkout metadata for attribution.
sidrecommendedThe session id (statskit_session_id cookie). Stamped into metadata.
expoptionalExperiment key to tag the checkout with experiment context.
varoptionalVariant key for the tagged experiment.

Auth is the public ingest key in s. vpk_live_… keys are write-only: they can start a checkout and ingest events but cannot read anything, so it is safe to put one in a plain browser link. No secret key is involved, and no server round-trip of your own is needed.

The reason this is safe despite being public is the allowlist: price must already be configured in a pricing table, so the key cannot be used to charge an arbitrary amount.

Checkout link
<a href="https://statskit.ai/api/v1/checkout?s=vpk_live_…&price=price_1QabcXYZ&vid=VID&sid=SID">
Buy Pro
</a>

Swap VID and SID for the visitor’s statskit_visitor_id and statskit_session_id cookie values at click time. When you route through a StatsKit pricing table these are filled in for you.

For a price experiment, pass exp and var so the checkout is tagged with the experiment context. Revenue from the resulting purchase then attributes to that variant.

Price-test checkout
<a href="https://statskit.ai/api/v1/checkout?s=vpk_live_…&price=price_variant_b&vid=VID&sid=SID&exp=pricing_q3&var=b">
Get started
</a>

Each variant of a price test points at its own allowlisted price, and each carries the matching var. Assignment stays deterministic on the vid, so the variant you show and the var you tag should agree.