webhookUrl you configured in your business profile. Because many payment flows (like 3DS redirects or card network clearing) are asynchronous, you should always confirm payment status through webhooks rather than relying solely on the response from a charge request.
Configure your webhook URL
Set your webhook endpoint in the Axra dashboard under Settings → Business Profile, or update it programmatically:Event types
Axra delivers the following events to your webhook endpoint:Webhook payload structure
Every webhook request shares the same envelope format:data object varies by event type. Below are the payloads for each event.
payment.created
payment.created
payment.completed
payment.completed
payment.failed
payment.failed
reason field contains the failure code.payment.settled
payment.settled
payment.refunded
payment.refunded
payment.disputed
payment.disputed
payment.dispute_won / payment.dispute_lost
payment.dispute_won / payment.dispute_lost
collection.created
collection.created
data.object mirrors GET /business/collections/{id}.collection.processing
collection.processing
collection.completed
collection.completed
collection.failed
collection.failed
collection.expired
collection.expired
payment_link.session.completed
payment_link.session.completed
source identifies the originator (payment_link, invoice, etc.) and sourceId is the originating resource ID.invoice.created
invoice.created
invoice.paid
invoice.paid
recurring_gift.charge.succeeded
recurring_gift.charge.succeeded
chargeCount is the cumulative number of successful charges on this schedule.recurring_gift.charge.failed
recurring_gift.charge.failed
failureCount tracks consecutive failures; the schedule is paused after the configured retry limit.payout.* (initiated / submitted / settled / failed / cancelled / review)
payout.* (initiated / submitted / settled / failed / cancelled / review)
data.object is the same shape as GET /v1/business/payouts/{id}. Fulfill or reconcile your records on payout.settled; reverse on payout.failed.Webhook request headers
Axra includes these headers on every webhook request:Signature verification
To verify a webhook:Get your webhook secret
webhookSecret in the Axra dashboard under Settings → API Keys. Store it as an environment variable — never hardcode it.Compute the expected signature
webhookSecret as the key.Compare using constant-time equality
X-Axra-Signature header using a constant-time comparison function. This prevents timing attacks.Reject if signatures do not match
401 Unauthorized response immediately. Do not process the event.Retry policy
Axra considers a delivery successful when your endpoint responds with an HTTP2xx status code within 30 seconds. If delivery fails, Axra retries with the following schedule:
Best practices
- Return
200quickly — acknowledge receipt immediately, then process the event in a background job. Long-running handlers risk timeouts and unnecessary retries. - Handle duplicates — network retries mean your endpoint may receive the same event more than once. Use
paymentIdas an idempotency key to ensure you process each event exactly once. - Always verify signatures — reject any request where
X-Axra-Signaturedoes not match your computed value. - Use HTTPS in production — plain HTTP webhook URLs are rejected for live-mode credentials.
- Use ngrok during local development — run
ngrok http 3000to get a public URL that tunnels to your local server.
