Amwal Tech logoDocs

Webhooks Overview

Webhooks allow Amwal to notify your backend servers in real time whenever an asynchronous payment event occurs, such as order approval, installment tracker decisions, refund executions, or dispute status changes.


Supported Webhook Events

Event TypeDescriptionTrigger Condition
order.createdNew order initiatedCustomer starts checkout process
order.successPayment successfulPayment confirmed and completed
order.failedPayment failedPayment declined, failed, or cancelled
order.updatedOrder RefundContain the Bank gateway refund details (refund_tracker).
installment.tracker.approvedThe installment is approvedContain the Installment tracker object with its status "A"
installment.tracker.rejectedThe installment is rejectedContain the Installment tracker object with its status "R"
order.disputedChargeback dispute updateContains disputed_status to identify the chargeback status: PENDING, RESOLVED, or LOST.
payment_link.expiredPayment link expiredThe payment link reaches its configured expiration time.
modal.closedPayment modal closedThe customer closes the payment modal.

For detailed JSON schemas and parameter definitions for each event, see Webhook Event Types.


Error Handling & Retry Logic

Retry Mechanism

Amwal implements an automated retry policy to ensure reliable delivery of payment events even during temporary endpoint outages or network degradation:

  • Max attempts: 5 retries
  • Backoff: 2^attempt seconds exponential backoff
  • Max delay: 1 hour
  • Retry triggers: HTTP 5xx server errors, connection timeouts, and network reachability errors
  • No retry: HTTP 4xx client errors (e.g. 400 Bad Request, 401 Unauthorized, 404 Not Found)

Delivery Schedule

When a retry trigger occurs, deliveries are rescheduled according to exponential backoff:

AttemptDelayTotal Elapsed Time
InitialImmediate0 seconds
Retry 12 seconds~2 seconds
Retry 24 seconds~6 seconds
Retry 38 seconds~14 seconds
Retry 416 seconds~30 seconds
Retry 532 seconds (up to max delay 1 hr)Final attempt

Webhook Security & Headers

Incoming webhook requests from Amwal include essential security headers:

HeaderDescription
X-Api-KeyYour API key fingerprint to verify sender authenticity and match the registered public key.
X-SignatureBase64-encoded RSA-PSS with SHA-256 signature generated by Amwal.
Content-TypeSet to application/json.

Verifying Webhook Signatures

To ensure incoming webhook requests are genuine and have not been tampered with in transit, verify the X-Signature header using RSA-PSS SHA-256. See the complete verification tutorial and code examples in Webhook Signature Verification.

On this page