Skip to content
Developer guide

Sandbox testing guide

Built-in test payment methods + an on-demand simulate endpoint so you can drive every status (paid / failed / expired / refunded / chargeback) and verify your webhook handling end to end.

Context and key considerations

Sandbox is a fully isolated environment that never touches real money or real providers. It ships with built-in test payment methods and a simulate endpoint so you can create a payment and drive it through every outcome — completed, failed, expired, refunded, chargeback — asserting your webhook handler at each step. No provider credentials, no waiting.

Use an sk_test_… secret key against https://sandbox.key2pay.ai/api/v1. The test methods + simulate endpoint are available in sandbox only.
1 / 5

How it works

  1. List methods → sandbox always returns the built-in test rails below (even before you configure anything).
  2. Create a payment with a test paymentMethodId → it lands as pending.
  3. Call the simulate endpoint to move it to the status your test needs.
  4. We fire the matching signed webhook(s) to your registered URL; assert + repeat.
Where it shows up. The transaction's environment follows the KEY: a charge with an sk_test_… key is ALWAYS a sandbox transaction, so it appears in your merchant dashboard's sandbox view and in the playground's activity feed — regardless of which environment the dashboard toggle is on. Production (sk_live_…) and sandbox data never mix.
Key2Pay Developer documentationAPI v1
Documentation
Dashboard