Test environment
Axra provides a fully isolated sandbox environment. Test mode does not process real payments and will never charge a real card.
Obtain your sandbox API keys from the API Keys section of the Axra dashboard. Test keys are prefixed with
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.Testing the full checkout flow
Use this flow to verify your end-to-end checkout session integration:1
Create a checkout session
Call
POST /business/payment/session with your test API key. Use a valid amount and currency.2
Open the checkout URL
Open the
checkoutUrl from the response in a browser. You will see Axra’s hosted payment page.3
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.
4
Complete the payment
Submit the form. If you used a 3DS card, the sandbox will auto-complete the authentication challenge.
5
Verify the webhook
Confirm that your server receives a
payment.completed webhook event. Check that you return a 2xx response within 30 seconds, and that your application correctly updates the order or fulfillment status.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.1
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.2
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:
3
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.
4
Inspect the delivery
The ngrok web interface at
http://localhost:4040 shows every request and response in real time. Use it to inspect the payload and debug your signature verification logic.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.
