Aurax PayAurax Pay Docs

Webhooks

Webhooks are HTTP callbacks that Aurax Pay sends to your server when something happens โ€” a payment completes, a payout fails, etc. They are the primary way to be notified of asynchronous events.

๐Ÿ’กRegister your webhook URL from Business Settings โ†’ Webhooks in your dashboard. You can register multiple endpoints.

How it works

1. You register a webhook URL in the dashboard
2. A payment event occurs (completed, failed, etc.)
3. Aurax Pay sends a POST request to your URL
4. Your server verifies the signature
5. Your server responds with 200 OK

Delivery and retries

Aurax Pay expects a 2xx response within 10 seconds. If your endpoint fails or times out, we retry with exponential backoff:

AttemptDelay
1st retry30 seconds
2nd retry5 minutes
3rd retry30 minutes
4th retry2 hours
5th retry12 hours

Webhook headers

Every webhook request includes these headers:

HeaderDescription
X-Aurax-SignatureHMAC-SHA256 signature of the raw request body. Use this to verify authenticity.
X-Aurax-EventThe event type. E.g. payment.completed
X-Aurax-DeliveryUnique ID for this delivery attempt. Useful for deduplication.
Content-TypeAlways application/json

Respond quickly, process async

Return a 200 response immediately, then process the webhook asynchronously. If your handler takes longer than 10 seconds, Aurax Pay will consider the delivery failed and retry.

Node.js / Express โ€” recommended pattern
app.post("token-string">'/webhooks/aurax', express.raw({ type: "token-string">'application/json' }), async (req, res) => {
  "token-comment">// 1. Verify signature FIRST
  const signature = req.headers["token-string">'x-aurax-signature']
  const isValid = verifyAuraxSignature(req.body, signature, process.env.AURAX_WEBHOOK_SECRET)
  if (!isValid) return res.status(400).send("token-string">'Invalid signature')

  "token-comment">// 2. Respond 200 immediately
  res.status(200).json({ received: true })

  "token-comment">// 3. Process async
  const event = JSON.parse(req.body)
  await processWebhookEvent(event)
})

async function processWebhookEvent(event) {
  switch (event.event) {
    case "token-string">'payment.completed':
      await fulfillOrder(event.transaction.metadata.orderId)
      break
    case "token-string">'payment.failed':
      await notifyCustomer(event.transaction)
      break
    case "token-string">'payout.completed':
      await markPayoutSent(event.transaction.id)
      break
  }
}