Webhooks
About Aeropay Webhooks
Aeropay allows you to subscribe to a number of webhooks which will send information about transactions when they update. These webhooks allow you to understand in real-time when transactions are created, succeed, decline, or are refunded.
Webhook Topics
Topic Name | Description |
|---|---|
transaction_completed | This topic will send a payload of a transaction object when the transaction is approved by Aeropay. Note: Approved transactions will batch and settle at the next batch window, < 24 hours. When approved, a transaction will be in "Pending" status until 3 business days after the transaction was created. |
transaction_voided | This topic will send a payload of a transaction object when the transaction is voided. |
transaction_refunded | This topic will send a payload of a transaction object when the transaction is refunded. |
transaction_declined | This topic will send a payload of a transaction object when the transaction declines. |
preauthorized_transaction_created | This topic will send a payload of a preauthorized transaction object when the preauthorized transaction is created. |
user_suspended | This topic will send a payload of a userid when a user is suspended. |
user_active | This topic will send a payload of a userid when a previously suspended user has been reactivated. |
merchant_reputation_updated | This topic will send a payload of a users whose reputations have been updated after a successful call to POST /merchantReputation. |
Webhook Flowchart for ACH Payment
Webhook Retries
If your webhook endpoint temporarily can’t process events, Aeropay will automatically resends the undelivered events to your endpoint, increasing the time for your webhook endpoint, with exponential backoff and jitter, to eventually receive and process all events.
Aeropay will retry webhooks if:
- Callback URL fails to respond within 3000ms
- Callback URL fails to respond with 200 status code
Aeropay will attempt up to 5 total retries.
Subscribing to a webhook
HTTP request
Sandbox - POST https://api.sandbox-pay.aero.inc/webhook
Production - POST https://api.aeropay.com/webhook
Code Example - Request
curl --request POST \
--url https://api.sandbox-pay.aero.inc/webhook \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"topic": "transaction_declined",
"url": "https://your-callback-url.com"
}
'
Code Example - Payload from Webhook
{
"topic": "transaction_declined",
"data": {
"locationId": "794",
"paymentType": "payment+",
"createdDate": "1694787546",
"amount": "15.00",
"merchantId": "582",
"status": "declined",
"uuid": "8bc20976-2e18-4c5c-93b4-20fd853d78a4",
"attributes": [{ "value": "3.00", "name": "tip", "description": "flat" }],
"id": "231933",
"userId": "12695",
"title": "Online Transaction",
"apFee": "0.28",
"returnCode": "R01"
},
"date": "2024-04-05 15:25:49"
}{
"topic" : "user_suspended",
"data" : { "userid" : "12695" },
"date": "2024-04-05 15:25:49"
}
Webhook Responses
Webhook | Webhook response |
|---|---|
transaction_completed | |
transaction_refunded | |
transaction_voided | |
transaction_declined | |
preauthorized_transaction_created | |
user_suspended | |
user_active | |
merchant_reputation_updated | |
Updated 6 days ago
