Every operation you trigger on a payment deserves a clear answer. These webhooks deliver one instantly - so you can act before a missed capture or failed refund becomes a problem you discover too late.
Primer notifies you with a failure webhook whenever a payment operation attempt does not succeed and the payment status has not changed as a result. The following event types are supported:
PAYMENT.CAPTURE.FAILED - a capture attempt did not succeedPAYMENT.REFUND.FAILED - a refund attempt did not succeedPAYMENT.CANCELLATION.FAILED - a cancellation attempt did not succeedPAYMENT.AUTHORIZATION_ADJUSTMENT.FAILED - an authorization adjustment attempt did not succeedThese events are operational signals, not status changes. Receiving a PAYMENT.CAPTURE.FAILED event, for example, means the capture attempt was unsuccessful - it does not mean the payment has failed or that the authorization has been lost.
When does a failure webhook fire? Common scenarios include:
Particularly useful with Primer Workflows. If you trigger captures or refunds automatically through a Workflow, failure webhooks are the signal you need to keep your own systems in sync. Because the action happened upstream, your backend won’t know it failed unless Primer tells you - these events close that gap.
A webhook is emitted for every individual failed attempt. If the same operation fails multiple times, you will receive a separate event each time.
The webhook payload is intentionally minimal. To retrieve the full context - including the error reason, timeline, and processor response - call GET /payments/{id}?expand=transactions.events after receiving the event.
What to do when you receive a failure event
The right action depends on the failure type: for amount mismatches, you may want to retry the capture with a corrected amount; for PSP errors or timeouts, a retry after a short delay is often appropriate. In all cases, make sure your internal systems reflect the outcome - update your order management, notify your operations team if needed, and avoid leaving the payment in an ambiguous state on your end.
An HMAC signature generated using the webhook payload and a shared signing secret. This is then converted to a base64 encoded string.
A secondary signature that is added when you have rotated your secret within the past 24 hours.
The type of the webhook raised.
PAYMENT.CAPTURE.FAILED, PAYMENT.CANCELLATION.FAILED, PAYMENT.AUTHORIZATION_ADJUSTMENT.FAILED, PAYMENT.REFUND.FAILED The date-time that the webhook was sent.
The Unix timestamp at which the webhook payload was signed.
"1689221338"
The notification configuration details.
The payload version.
"2.4"
The requested amount for the operation in minor units. Present for capture, refund, and authorization adjustment events. Not applicable for cancellation events.
Return a 200 status to indicate that the data was received successfully