Every request to the Axra Pay API must be authenticated. Axra supports two methods: passing your API key directly in a request header, or exchanging your key and secret for a short-lived JWT token. Both methods work for all endpoints — choose the one that fits your architecture.Documentation Index
Fetch the complete documentation index at: https://docs.useaxra.com/llms.txt
Use this file to discover all available pages before exploring further.
Method 1: API key header
The simplest way to authenticate is to include your API key in thex-api-key header on every request. This approach works well for server-side integrations where your API key is stored securely in an environment variable.
Method 2: JWT token exchange
For integrations that prefer short-lived credentials, you can exchange yourapiKey and apiSecret for a JWT bearer token. The token expires after one hour and must be refreshed before it does.
Your
webhookSecret doubles as your apiSecret for token authentication. They are the same credential.Step 1: Request a token
Send aPOST request to /business/auth/token with your apiKey and apiSecret in the request body.
Your business API key. Starts with
bk_live_ for production or bk_test_ for sandbox.Your API secret. This is the same value as your
webhookSecret.Step 2: Read the response
A successful request returns the following fields:The JWT token to include in subsequent requests.
Always
"Bearer". Use this as the prefix in your Authorization header.Token lifetime in seconds. Always
3600 (one hour).The unique identifier for your business profile.
Your registered business name.
Step 3: Use the token
Include theaccessToken in the Authorization header of every subsequent request:
Token error responses
| HTTP status | Meaning |
|---|---|
401 Unauthorized | The apiKey or apiSecret is invalid. |
400 Bad Request | The request body is missing apiKey or apiSecret. |
Getting your credentials
Create an account
Register at the Axra dashboard to create a business profile and generate your API credentials.
Copy your credentials immediately
Your
apiKey (format: bk_live_...) and webhookSecret are shown only once when your account is created. Copy both values to a secure password manager or secrets vault before leaving the page.Store credentials securely
Never hard-code credentials in your source code. Store them as environment variables or in a secrets management service such as AWS Secrets Manager, HashiCorp Vault, or your hosting provider’s secret store.
Axra stores API keys as SHA-256 hashes. Your raw key is never stored on Axra’s servers, which is why it cannot be retrieved after creation — only regenerated.
Choosing an authentication method
| API key header | JWT token | |
|---|---|---|
| Setup complexity | Minimal | Requires token exchange and refresh logic |
| Best for | Server-side integrations, scripts, internal tools | Architectures that require short-lived credentials |
| Token lifetime | Long-lived (until regenerated) | 1 hour |
| Revocation | Regenerate key to invalidate | Tokens expire automatically |
Next steps
Payments
Start accepting payments with server-to-server card charging.
Checkout Sessions
Use a hosted payment page to accept payments without handling card data.
