Back to docs
Webhooks
Receive real-time notifications when events happen in your OpenPay instance. Events are delivered via NATS JetStream and follow the CloudEvents v1.0 specification.
Event Format
Every event is wrapped in a CloudEvents envelope:
JSON
{
"specversion": "1.0",
"id": "evt_abc123",
"source": "urn:core-financial:payment-system",
"type": "payments.charge.completed",
"time": "2025-01-15T10:30:00Z",
"datacontenttype": "application/json",
"data": {
"paymentId": "pay_xyz789",
"amount": 500000,
"currency": "NGN",
"status": "succeeded",
"reference": "txn_abc123"
}
}Event Types
payments.charge.completedA payment was successfully captured.
payments.charge.failedA payment attempt failed.
payments.charge.pendingA payment is awaiting completion.
payments.charge.refundedA payment was fully refunded.
payments.charge.disputedA payment was disputed by the customer.
payments.refund.completedA refund was processed successfully.
payments.refund.failedA refund attempt failed.
dlq.event.failedAn event failed processing after max retries.
NATS JetStream Subjects
NATS subjects
# Stream: PAYMENT_EVENTS
# Subjects:
payments.charge.pending
payments.charge.completed
payments.charge.failed
payments.charge.refunded
payments.charge.disputed
payments.refund.completed
payments.refund.failed
# Stream: DLQ_EVENTS
dlq.event.failedRetry Policy
Payment Events
Max 3 delivery attempts with 30-second acknowledgment wait. Failed events are moved to the DLQ stream.
Dead Letter Queue
Failed events are retained for 7 days. Events in the DLQ include the original event, error details, and retry count.