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.
Pricing tables
Section titled “Pricing tables”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.
The checkout endpoint
Section titled “The checkout endpoint”GET or POST https://statskit.ai/api/v1/checkout. It responds with a 303 redirect to a Stripe Checkout session.
| Param | Required | Meaning |
|---|---|---|
s | yes | Your public ingest key vpk_live_…. Write-only, safe in the browser. |
price | yes | A Stripe price id. Must be allowlisted in a pricing table. |
vid | recommended | The visitor id (statskit_visitor_id cookie). Stamped into checkout metadata for attribution. |
sid | recommended | The session id (statskit_session_id cookie). Stamped into metadata. |
exp | optional | Experiment key to tag the checkout with experiment context. |
var | optional | Variant key for the tagged experiment. |
Public vpk_ auth
Section titled “Public vpk_ auth”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.
Examples
Section titled “Examples”<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.
curl -i "https://statskit.ai/api/v1/checkout?s=vpk_live_…&price=price_1QabcXYZ&vid=VID&sid=SID"# → HTTP/1.1 303 See Other# → Location: https://checkout.stripe.com/c/pay/cs_live_…Tagging a price test
Section titled “Tagging a price test”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.
<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.