Webhooks and event recovery
Signed transaction notifications, retries and event recovery.
Use test payment details only. No real money moves; live activation is separate.
Register your public HTTPS endpoint with Aim Atlantic to receive signed payment, refund, dispute and recurring-payment notifications in one consistent format.
Only configured and implemented capabilities emit events. Recurring test payments use the same signed envelope. Merchant bank-transfer and settlement-paid events are not available; statement generation does not move money.
Event envelope
{
"id": "d1b9db05-1f40-4a8c-a2bc-995e5b12c370",
"type": "payment.succeeded",
"api_version": "2026-09-28",
"environment": "sandbox",
"created_at": "2026-09-28T12:00:00.000Z",
"sequence": 3,
"data": {
"payment": {
"id": "ef866b31-11ae-4f4f-a6db-75c7b15967e5",
"reference": "order-0001",
"amount": 10000,
"currency": "USD",
"status": "succeeded",
"captured_amount": 10000,
"reserved_amount": 0
}
}
}The event ID is unchanged on retry and manual replay. sequence increases within a payment, including its refund and dispute events. created_at is Aim Atlantic's event creation time, not bank settlement time. Refund and dispute events additionally include data.resource with the relevant resource ID, amount, currency and status. Disputes include a reason and evidence deadline when available.
Supported events
| Events | Meaning |
|---|---|
payment.created | Payment created; awaiting a payment method |
payment.requires_action | Customer authentication is required |
payment.processing | Awaiting the confirmed outcome |
payment.updated | Payment is awaiting a new payment method or another nonterminal update |
payment.partially_captured | Some principal captured; check remaining reservation |
payment.succeeded | Requested principal captured |
payment.attempt_failed | A card attempt failed. data.payment.last_payment_error gives the reason. For direct card, treat it as the failed outcome of that checkout, because status reads requires_payment_method afterwards |
payment.failed | Terminal failure; a declined card attempt can instead return to requires_payment_method |
payment.canceled | Cancellation is confirmed |
refund.created | Refund recorded; outcome can still be pending |
refund.updated, refund.succeeded, refund.failed | Refund state changed; a canceled refund emits refund.failed and retains resource status canceled |
dispute.opened, dispute.updated, dispute.closed | Dispute status or deadline changed; inspect status for won/lost outcomes |
subscription.created, subscription.paused, subscription.resumed, subscription.canceled | Schedule lifecycle; resource identifies the subscription |
invoice.created | A renewal invoice and its payment were recorded |
invoice.paid | The renewal payment captured successfully |
invoice.requires_action | Customer authentication is required on the invoice’s existing checkout |
invoice.payment_pending | Inspect the current payment: it can be processing or need a replacement method |
Subscription lifecycle events attach to the initial payment; invoice events attach to the renewal payment. Sequences are per payment, not global or per subscription. Retrieve the subscription and invoices for authoritative current state. An invoice can emit invoice.payment_pending after a decline; do not treat that as a paid invoice.
Not every transaction visits every state. Multiple upstream notifications describing the same unchanged record need not produce multiple merchant events.
Signature verification
Headers include Aim-Event-Id, Aim-Delivery-Id and Aim-Signature. The signature format is t=UNIX_SECONDS,v1=HEX_HMAC. Compute HMAC-SHA256 using the endpoint's entire signing-secret string over timestamp + "." + raw_request_body. Compare the hex digest in constant time. Reject timestamps more than five minutes in the past or future.
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verify(rawBody, header, secret) {
const match = /^t=(\d+),v1=([a-f0-9]{64})$/.exec(header ?? '');
if (!match || Math.abs(Date.now() / 1000 - Number(match[1])) > 300) return false;
const expected = createHmac('sha256', secret)
.update(`${match[1]}.${rawBody}`).digest();
return timingSafeEqual(expected, Buffer.from(match[2], 'hex'));
}Verify before parsing or changing the body. Store the event durably with a unique constraint on its ID, then return 2xx promptly and process it asynchronously. A duplicate should also return 2xx. Ask Aim Atlantic for the webhook receiver example if your team needs a starting point.
Delivery behavior
- Delivery is at least once, with no ordering guarantee. Discard stale state updates using the per-payment sequence and retrieve the current payment if needed. Do not discard an independently actionable refund merely because a later payment event arrived first.
- Requests time out after 10 seconds. Redirects are not followed. Only
2xxacknowledges delivery. - After a failure, retries are scheduled after 1 minute, 5 minutes, 15 minutes, 1 hour, 3 hours, 6 hours, 12 hours, 24 hours and 24 hours. Scheduling is approximate; an outage can delay work.
- After 10 recorded attempts, the delivery is exhausted. Owners can replay it from Developers. A crash after sending but before saving the result can produce an additional attempt.
- Endpoint creation subscribes to future events. Existing deliveries pause when an endpoint is disabled; events created during the pause remain in event history but are not queued to that endpoint.
- The platform persists events with payment state changes before attempting delivery. A merchant receiver outage does not roll back a payment.
Rotation and recovery
Pause an endpoint, wait for in-flight delivery to finish, rotate its secret, deploy the new secret to your receiver, then enable delivery. Rotation immediately replaces the old secret. Replay retains the event ID and payload but signs the new attempt with the current secret and timestamp.
Use GET /v1/events for recent history and its next_before value for older pages. This is history pagination, not a guaranteed commit-order streaming cursor. Use GET /v1/events/{id} to recover a known event. Never create another payment to compensate for a missed webhook.