POST /ab-tests answers
403 with code: FEATURE_LOCKED and details.feature: "abTests". Reading,
stopping, declaring a winner and deleting are never gated. Every route works
in the API key’s mode (live or test).
Start a test
variants are the challengers (B, C, D). Variant A is the product as it is
now and is added for you.
Subscriptions
SendsubscriptionId instead of productId to test a subscription. A
subscription can run subscription_offer, checkout_layout or
checkout_copy tests. Each subscription_offer variant is a whole offer:
endDetail: "introPricing").
Optional: name, and weights — the traffic split in whole percents, A
first, each 5–95, adding up to 100 (default: equal).
Routes
Results
pValue— two-proportion z-test of the conversion rate against A (two-sided). Under 0.05 = 95% confident they differ.probabilityToBeat— Bayesian chance (flat prior, exact) the variant’s conversion rate is higher than A’s.revenueProbabilityToBeat— price tests: chance the variant earns more per visitor. Price tests are judged on this (metric: "revenue_per_visitor").verdict—collectinguntil both arms have 100+ visitors and 10+ conversions between them; thenwinning,losingorno_difference.- Conversions are paid, unrefunded sales credited to the variant the buyer saw; revenue is in your account currency.
Subscription results
For a subscription test (itemKind: "subscription"), conversions are new
subscribers (trials included, counted when the subscription starts) and
revenue is everything they paid so far. Each variant also has:
retention— percent of the variant’s subscribers still active or in trial.paidRate— percent who paid at least one full period (trial → paid).mrr— monthly recurring revenue of active paying subscribers: each one’s latest full-period payment, normalised to a month by the variant’s interval.subscription_offertests are judged on MRR per visitor (metric: "mrr_per_visitor"), so a cheaper plan or a longer trial only wins if it really brings in more recurring revenue. Until somebody has paid a full period, the verdict follows the conversion rate.
Visitor assignment
POST /ab-tests/public/assign with { productId, visitorId, currency? }
(or subscriptionId for a subscription)
returns { test: { testId, variantId, type, basePrice, overrides } } or
{ test: null }. visitorId is the visitor’s own random id (16–64
characters of A-Z a-z 0-9 _ -); the same id always gets the same variant,
and the first call logs the visit. Bots get null. With currency, a price
variant also comes back as displayPrice, converted exactly as checkout will
charge it.
The hosted product page and checkout send the same id as abVisitor, and
the variant they actually rendered as abVariant, when they create the
checkout session. The server charges the variant only when abVariant
matches its own record of the visitor; otherwise (no claim, "", or another
id — the page could not load the variant) it charges the product’s own price
and the sale is not credited to the test. A price never comes from the page.
GET /pricing/quote/{productId} and GET /personal-deadlines/public/offer
take the same pair as vid + abv. The hosted subscription checkout
sends abVisitor + abVariant too: a
matching subscription_offer variant sets the price per period, the interval
and the trial; anything else charges the subscription’s own offer.
Webhook
ab_test.completed fires when a test ends — a winner was declared, it was
stopped, or a conflicting product edit stopped it — with every variant’s
results. See Webhook events.
MCP tools
list_ab_tests, create_ab_test, get_ab_test, get_ab_test_results,
stop_ab_test, declare_ab_test_winner, delete_ab_test.