Documentation

Events & Webhooks

Events & Webhooks

Outgoing webhooks are how PerfectPay pushes payment, refund, dispute, payout, and subscription updates to your systems.

Outgoing Payload Shape

Webhook payloads include top-level fields like these:

JSON
{
  "merchant_id": "merchant_123",
  "event_id": "evt_018e31720d1b7a2b82677d3032cab959",
  "event_type": "payment_succeeded",
  "content": {
    "type": "payment_details",
    "object": {}
  },
  "timestamp": "2026-03-22T15:12:00Z"
}

content is a typed envelope. Depending on the event, it carries payment, refund, dispute, mandate, payout, or subscription data.

Event Types

Payment Events

EventTrigger
payment_succeededPayment completed successfully
payment_failedPayment attempt failed
payment_processingPayment is being processed
payment_cancelledPayment was cancelled
payment_capturedPayment was captured (manual capture)
payment_authorizedPayment was authorized

Refund Events

EventTrigger
refund_succeededRefund completed
refund_failedRefund could not be completed

Dispute Events

EventTrigger
dispute_openedA dispute or chargeback was opened
dispute_expiredDispute response window expired
dispute_acceptedDispute was accepted
dispute_cancelledDispute was cancelled
dispute_challengedDispute was challenged
dispute_wonDispute was resolved in your favor
dispute_lostDispute was resolved against you

Mandate Events

EventTrigger
mandate_activeA mandate became active
mandate_revokedA mandate was revoked

Webhook Delivery Flow

Loading diagram...

Configure Delivery

Configure outgoing webhooks from the dashboard. The business profile stores the webhook URL, response hash key, and custom outbound headers used for delivery.

Delivery Troubleshooting

Use the Events API when you need delivery history, attempt-level diagnostics, or a manual retry:

EndpointPurpose
POST /events/{merchant_id}List events with filters such as event_type and is_delivered
GET /events/{merchant_id}/{event_id}/attemptsInspect delivery attempts for a specific event
POST /events/{merchant_id}/{event_id}/retryManually retry delivery

Verification Guidance

PerfectPay signs webhook responses using the business profile's configured response hash key or webhook secret. Verify the signature before you fulfill an order or mutate internal state.

Operational Defaults

  • Treat deliveries as at least once
  • Deduplicate on event_id
  • Process asynchronously after basic validation
  • Keep your handler fast and idempotent