Skip to main content

About Webhooks

Overview

Webhooks are automated messages sent by NGnair Payments to your server when specific payment events occur. They serve as real-time notifications that allow your application to automatically respond to payment-related events without having to constantly poll the payment provider's API.

Key Payment Events

Payment providers typically send webhooks for important events such as:

  • Payment capture successful
  • Payment failure
  • Refund processed
  • Payment dispute/chargeback
  • Payment authorization
  • Subscription renewal

How It Works

  1. After you created a merchant account, you can create a webhook endpoint in your application. Provide the URL where you want to receive the webhook notifications and make sure that your server is able to handle the incoming requests and return a 200 OK response.
  2. When a payment event occurs, NGnair Payments sends a POST request to the webhook URL you provided. The request contains a JSON payload with information about the event.
  3. Your server receives the webhook and processes the event. Check the request signature first to confirm its validity. If valid, you can use the information in the payload to update your application's state, send notifications, or take other actions as needed.
  4. If you need to catch up on events you missed, you can use our Webhook List API to retrieve a list of past events.

This system ensures your application stays synchronized with the payment provider's state and can take appropriate actions (like fulfilling orders or handling failed payments) automatically.