Skip to content
Developer guide

Sandbox-Simulate header

Drive deterministic outcomes (paid / failed / expired / chargeback / slow_payment) from CI via a single request header. No UI needed.

Context and key considerations

The playground at /sandbox/login is great for hands-on debugging, but CI / automated tests need a programmatic way to drive outcomes. Pass the Sandbox-Simulate header on POST /api/v1/payments and we schedule the transition for you — the same state machine the playground uses, no clicks required.

The header is honoured ONLY in sandbox. In production it's silently ignored — a misconfigured test suite can't accidentally drive live data.
1 / 4

Accepted values

ValueDelayOutcomeWebhooks fired
paid5 spending → completedpayment.completed
failed5 spending → failedpayment.failed
expired30 spending → expiredpayment.failed
chargeback30 s + 5 spending → completed (+ dispute claim)payment.completed,
chargeback.created
slow_payment5 minpending → completed (very late)payment.completed
missing_fieldsimmediate422 missing_required_fields — no transaction is creatednone
Key2Pay Developer documentationAPI v1
Documentation
Dashboard