For Developers

Webhooks

Instant notifications on payment status changes

When a payment status changes, AiPay sends an HTTP POST to your configured URL. Set notif_url in your company settings on the Dashboard.

Setup

  1. 1Set webhook URL (notif_url) in your company settings on the Dashboard
  2. 2AiPay will POST to this endpoint on every status change
  3. 3Respond with HTTP 200 to acknowledge receipt
  4. 4On non-200 responses, AiPay retries with exponential backoff

Example — Invoice Event

{
  "event_type": "invoice_update",
  "timestamp": "2026-06-07T12:00:00Z",
  "user_id": "uuid-here",
  "data": {
    "invoice_id": "uuid-here",
    "status_code": 9,
    "status": "paid",
    "amount": 5000,
    "account": "+770****6543",
    "account_name": "Иван Иванов",
    "message": "Order #123"
  }
}

Example — Device Event

{
  "event_type": "device_status",
  "data": {
    "pos_id": "uuid-here",
    "status": "working"
  }
}

Security

Verify request signatures to authenticate webhook payloads. AiPay signs every request with HMAC.

Best Practices

  • Process webhooks asynchronously and respond with 200 quickly
  • Implement idempotency — AiPay may deliver an event twice
  • Log all webhooks for debugging
  • Test in sandbox before going to production