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.
string
required
Your business API key. Starts with
bk_live_ for production or bk_test_ for sandbox.string
required
Your API secret. This is the same value as your
webhookSecret.Step 2: Read the response
A successful request returns the following fields:string
required
The JWT token to include in subsequent requests.
string
required
Always
"Bearer". Use this as the prefix in your Authorization header.number
required
Token lifetime in seconds. Always
3600 (one hour).string
The unique identifier for your business profile.
string
Your registered business name.
Step 3: Use the token
Include theaccessToken in the Authorization header of every subsequent request:
Token error responses
Getting your credentials
1
Create an account
Register at the Axra dashboard to create a business profile and generate your API credentials.
2
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.3
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.
4
Regenerate a lost API key
If you lose your API key, call
POST /business/regenerate-api-key to issue a new one. Your previous key is immediately invalidated — update any running services before regenerating.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
For most server-side integrations, the API key header is the simplest and most practical choice. Use JWT tokens if your security policy requires credentials that 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.
