Test environment
Axra provides a fully isolated sandbox environment. Test mode does not process real payments and will never charge a real card.| Setting | Value |
|---|---|
| Test base URL | https://staging-api.useaxra.com |
| Production base URL | https://api.useaxra.com/api/v1 |
| API key prefix | bk_test_ |
bk_test_ to distinguish them from live keys (bk_live_).
Test cards
Use these card numbers in the sandbox to trigger specific payment outcomes. For all test cards, use any future expiry date and any 3-digit CVV.| Card number | Result |
|---|---|
4242 4242 4242 4242 | Successful charge, no 3DS required |
4000 0000 0000 0002 | Card declined |
4000 0025 0000 3155 | 3DS authentication required — succeeds |
4000 0082 6000 3178 | 3DS authentication required — fails |
4000 0000 0000 9995 | Insufficient funds |
4000 0000 0000 3220 | 3DS2 required |
Testing the full checkout flow
Use this flow to verify your end-to-end checkout session integration:Create a checkout session
Call
POST /business/payment/session with your test API key. Use a valid amount and currency.Open the checkout URL
Open the
checkoutUrl from the response in a browser. You will see Axra’s hosted payment page.Enter a test card
Enter one of the test card numbers from the table above. Use any future expiry date and any 3-digit CVV.
Complete the payment
Submit the form. If you used a 3DS card, the sandbox will auto-complete the authentication challenge.
Testing a direct charge
For server-to-server (S2S) charging, you can test the charge endpoint directly withcurl:
bk_test_your_test_key with your actual sandbox API key. Swap out the card number to trigger a different outcome — for example, use 4000000000000002 to test your declined-card handling.
S2S charging must be enabled for your business in the Axra dashboard before you can use the charge endpoint. If you receive a
400 with a message about S2S not being enabled, contact support@useaxra.com.Testing webhooks locally
Your local development server is not reachable from the internet by default. Use ngrok to create a public tunnel to your local machine.Install and start ngrok
Download ngrok from ngrok.com, then expose your local server:ngrok will print a public URL such as
https://abc123.ngrok.io.Set your webhook URL
In the Axra dashboard, open your business profile settings and set the Webhook URL to your ngrok tunnel with your webhook path appended — for example:
Trigger a test payment
Create a checkout session or fire a test charge. Axra will send webhook events to your ngrok URL, which forwards them to your local server.
Verifying idempotency
Axra deduplicates charge requests within a 1-minute window based on the request parameters. To verify this is working:- Send the same charge request twice with identical parameters within 60 seconds.
- Confirm that both responses return the same
paymentId— this means the second request returned the cached result rather than creating a new charge. - Check that no duplicate payment appears in your dashboard.
paymentId as an error.
Pre-launch checklist
Before switching to your live API key, verify that your integration handles each of these scenarios correctly:| Scenario | What to verify |
|---|---|
| Successful payment flow | payment.completed webhook received; order fulfilled |
| 3DS authentication flow | Customer redirected and authenticated; payment confirmed via webhook |
| Card declined | User shown an appropriate error; no order created |
| Insufficient funds | User shown an appropriate error; no order created |
| Webhook signature verification | Your endpoint rejects requests with an invalid X-Axra-Signature |
| Refund flow | Refund created via API; payment.refunded webhook received |
| Checkout session creation and redirect | Session created; checkoutUrl opens the hosted payment page correctly |
