Webhooks

Set up event notifications

Webhooks

Webhooks allow PayMongo to notify your application when events happen in your account. Receive real-time updates about payments, refunds, and other events.

What are Webhooks?

Webhooks are HTTP callbacks that notify your application when specific events occur:

  • Payment completed
  • Payment failed
  • Refund processed
  • Payout sent

Instead of polling the API, your application receives instant notifications.

Dashboard Overview

View all configured webhooks:

ColumnDescription
URLYour endpoint URL
EventsSubscribed events
StatusActive, Inactive, Failed
CreatedWhen configured
Last TriggeredMost recent event

Creating a Webhook

Step 1: Add Endpoint

  1. Click "Add Webhook"
  2. Enter your endpoint URL
  3. Must be HTTPS
  4. Must be publicly accessible

Step 2: Select Events

Choose which events to receive:

EventDescription
payment.paidPayment successful
payment.failedPayment failed
source.chargeableSource ready for payment
refund.createdRefund initiated
payout.createdPayout generated

Step 3: Save

Click "Create Webhook" to activate.

Webhook Secret

Each webhook has a secret key for verification:

Viewing Secret

  1. Click on the webhook
  2. Click "Show Secret"
  3. Copy the secret key

Verifying Webhooks

Use the secret to verify webhook authenticity:

signature = HMAC-SHA256(secret, payload)

Compare with the Paymongo-Signature header.

Managing Webhooks

Enabling/Disabling

Toggle webhooks on or off:

  1. Find the webhook
  2. Click the toggle
  3. Status changes immediately

Editing Webhooks

Modify existing webhooks:

  1. Click the webhook
  2. Click "Edit"
  3. Update URL or events
  4. Save changes

Deleting Webhooks

Remove webhooks you no longer need:

  1. Click the webhook
  2. Click "Delete"
  3. Confirm deletion

Webhook Events

Payment Events

EventTrigger
payment.paidSuccessful payment
payment.failedFailed payment
payment.refundedPayment refunded
payment.pendingPayment awaiting action

Source Events

EventTrigger
source.chargeableReady to charge
source.cancelledSource cancelled
source.expiredSource expired
source.failedSource creation failed

Payout Events

EventTrigger
payout.createdPayout initiated
payout.paidPayout completed
payout.failedPayout failed

Webhook Payload

Payload Structure

{
  "data": {
    "id": "evt_xxx",
    "type": "event",
    "attributes": {
      "type": "payment.paid",
      "data": {
        // Event data
      }
    }
  }
}

Headers

HeaderDescription
Paymongo-SignatureHMAC signature
Content-Typeapplication/json

Retry Policy

Failed webhooks are retried automatically:

AttemptDelay
1st retry1 minute
2nd retry5 minutes
3rd retry30 minutes
4th retry2 hours
5th retry4 hours

After 5 failed attempts, the webhook is marked as failed.

Viewing Webhook Logs

Recent Deliveries

View delivery history:

ColumnDescription
EventEvent type
TimeWhen sent
StatusSuccess/Failed
ResponseHTTP response code

Debugging

Click on a delivery to see:

  • Request payload
  • Response body
  • Headers
  • Timing

Best Practices

PracticeRecommendation
Use HTTPSSecure your endpoints
Verify signaturesAlways validate authenticity
Respond quicklyReturn 200 within 30 seconds
Handle duplicatesEvents may be sent more than once
Process asyncQueue events for background processing
Monitor failuresWatch for delivery issues

Troubleshooting

Common Issues

IssueSolution
Not receivingCheck URL accessibility
Signature invalidVerify using correct secret
TimeoutSpeed up endpoint response
SSL errorCheck certificate validity

Feel free to reach out to [email protected] if you have questions about webhooks!