Skip to content
Merxian

Testing

Test your integration

The sandbox environment runs the same API with separate data and test payments. Test every path there before you use live keys.

On this page

How the sandbox works#

Every account has a sandbox environment and a live environment. Each environment has its own data, API keys, and webhook endpoints.

  • Sandbox keys start with mx_sandbox_. They reach only sandbox data.
  • Sandbox and live use the same base URL, https://api.merxian.com. The key selects the environment.
  • Hosted pages of the sandbox have /sandbox/ in the URL, for example https://checkout.merxian.com/sandbox/s/cs_6HvB2nQx9LmT4kWpR.
  • Resource IDs from the sandbox do not exist in live.

See Accounts and environments.

What the sandbox does#

  • It runs the same API, with the same validation, errors, and idempotency.
  • It processes payments with test payment details only. No real money moves.
  • It calculates tax and sends webhook events in the same way as live.
  • It accepts webhook endpoints on http. The endpoint must still be reachable from the internet.

What the sandbox does not do#

  • It does not accept real payment details, and it does not charge anyone.
  • It cannot simulate a dispute yet.
  • The dashboard cannot send a test event or redeliver an event yet. To test your endpoint, cause real events in the sandbox, for example with a checkout session.

Merxian does not publish test payment details yet.

What to test#

Test at least these paths before you go live:

  1. Authentication: a missing key, a key of the wrong environment, and a key without the required scope.
  2. A successful hosted checkout, from the create call to your fulfilment.
  3. A failed payment, and a new attempt on the same page.
  4. A buyer who cancels on the page, and a session that expires.
  5. Webhook signature verification, duplicate events, and events in a different order.
  6. Full and partial refunds, and a refund above the refundable amount.
  7. Retries with the same Idempotency-Key, and a key reused with a different body.
  8. Lists with more than one page.

Test scenarios describes each case with the expected result.

Try refund, payment.succeeded,POST /v1/transactions, orIdempotency-Key.