A/B Testing: Create An Experiment
A/B testing lets you compare two routing strategies — or two configurations of the same strategy — on a live split of traffic, with built-in guardrails and statistical significance checks. There is no separate create/manage API: an experiment is just anotheralgorithm.type on the existing /routing/create endpoint, alongside single, priority, volume_split, and advanced.
Why run one
Any routing change — turning on multi-objective routing, enabling autopilot, retuning hedging — is a bet that the new behaviour beats what you have today. The honest way to settle that bet is to run both on the same live traffic at the same time and measure the difference, rather than flip the change globally and hope the week-over-week numbers move for the right reason. That’s what an experiment does: it holds one arm (control) on your current behaviour and sends a minority slice to the other (variant), so the two are compared under identical market conditions. The design has two safety properties built in:- A guardrail. If the variant’s authorisation rate falls more than
guardrail_threshold_pppercentage points below control, the experiment is flaggedGuardrailBreachedimmediately — this is a deliberately eager point-estimate check, because no cost saving is worth an auth regression, and it trips without waiting for statistical significance (once past the minimum sample gate). - A significance test. A winner is only declared when the difference is statistically real. Once each arm clears
min_sample_size, results run a two-sample z-test on per-transaction economic value (which collapses to a plain two-proportion auth-rate test when no cost dimension is involved). Until then the verdict staysCollectingData; a positive-but-noisy gap staysNotSignificantrather than prematurely crowning the variant. Only ap < 0.05gap yieldsVariantWins/VariantLoses. See A/B Testing: Results for reading the verdict.
algorithm.type = “ab_test”
algorithm.data (ABTestData) Fields
SR Config Override
enable_multi_objective and use_autopilot are the same dials used by multi-objective routing and autopilot, scoped to just this arm.
Common Experiment Shapes
The dashboard’s A/B test builder resolves its strategy dropdown into these foursr_routing + override combinations — useful presets when constructing the payload by hand:
A
sr_config_tuning experiment (compare two SR tunings rather than two strategies) uses sr_routing for both arms and only sets hedging_percent/elimination_threshold on the variant, leaving control on the live config.
Activate The Experiment
Creating an experiment does not make it active — activate it like any other routing algorithm:How Traffic Is Split
Arm assignment is deterministic per payment:payment_id is hashed and taken modulo 100 against variant_split_pct, so retries of the same payment always land in the same arm.
Two integration points use this assignment:
- Real payments —
/decide-gateway//decision_gatewayroute into the assigned arm. This only happens when the merchant featureab-test-real-paymentsis enabled — see Merchant Features. Off by default so a newly created experiment doesn’t affect live traffic until you opt in. - Simulation / Decision Explorer —
/routing/evaluatepreviews what each arm would do for a given payment context, without a real transaction.
sr_routing, the payment proceeds through normal SR routing carrying that arm’s SrConfigOverride. If it resolves to another algorithm’s id, that algorithm’s output is used directly and the response’s routing_approach becomes AB_TEST_STATIC_ALGORITHM.
Editing Or Removing An Experiment
Only an inactive experiment can be edited or deleted — see Update & Delete Routing Algorithm. Deactivate first with/routing/deactivate if it’s currently live.
Related
- A/B Testing: Results
- Merchant Features — enabling
ab-test-real-paymentsand autopilot. - Multi-Objective Routing
- Create Routing Algorithm