🎉New feature launched

9th Swift Documentation

We help African businesses get paid by anyone, anywhere in the world—while giving them the tools to collect payments, access loans, and manage daily operations through a complete business banking solution.

Webhook

Introduction

This document provides details on the webhook functionality of the Payment API. Webhooks are HTTP callbacks that occur when certain events happen in the system. They allow your application to receive real-time notifications about events, such as successful payments, failed transactions, etc.

How To Use Webhook

  • Configure a webhook listener for your app and then create a webhook and subscribe it to the transaction event that you need.

Webhook Endpoints

A webhook URL is simply a POST endpoint that a resource server sends updates to parse, request and return.

Example of Webhook
// Using Express
app.post('/mywebhookurl', function(req, res) {
  // Retrieve the request's body
  const event = req.body;
  
  // Do something with event
  res.send(200);
});

Avoid long-running tasks

If you have long-running tasks in your webhook function, you should acknowledge the event before executing the long-running tasks. Long-running tasks will lead to a request timeout and an automatic error response from your server. Without a 200 OK response, we retry as described in the paragraph above.

Supported Events

EventDescription
Payment SuccessTriggered when a payment is successfully processed.
Payment FailedTriggered when a payment fails.
Refund InitiatedTriggered when a refund is initiated.
Subscription RenewalTriggered when a subscription renews successfully.
Subscription CancelledTriggered when a subscription is cancelled.

Payload Format

Webhook payloads are JSON objects containing information about the event. Below is an example payload for a payment success event:

Authentication

All webhook requests are authenticated using HMAC-SHA256 signatures. Each request includes a X-Signature header containing the HMAC-SHA256 signature generated using your secret key.

Handling Webhooks

  1. Receive the webhook payload from the Payment API.
  2. Verify the X-Signature header using your secret key.
  3. Parse the JSON payload to extract event details.
  4. Process the event according to your business logic.
  5. Respond with a 200 OK status code to acknowledge receipt of the webhook.

Retry Mechanism

If your endpoint fails to respond with a success status code (2xx), the Payment API will retry sending the webhook payload with exponential backoff for up to 5 times.

Testing

You can test webhook functionality using the staging environment and the provided staging endpoint. Use test payments and subscriptions to trigger different webhook events and verify your application's handling of each event.

Conclusion

Implementing webhooks allows your application to react to payment events in real-time, enabling better user experience and operational efficiency. If you have any questions or need assistance, please contact our support team at [email protected].

Was this page helpful?

© Copyright 2025. All rights reserved.

Latest Blogs & Resources

Card image

African ever growing fintech ecosystem is attracting more investors than ever before. In 2021, global investment in African fintech companies reached a record $4 billion, up from $1.3 billion in 2020.

Card image

African ever growing fintech ecosystem is attracting more investors than ever before. In 2021, global investment in African fintech companies reached a record $4 billion, up from $1.3 billion in 2020.

Card image

African ever growing fintech ecosystem is attracting more investors than ever before. In 2021, global investment in African fintech companies reached a record $4 billion, up from $1.3 billion in 2020.

dashboard-pix

Connecting Africa Through Digital Payments

🎉New feature launched

Empowering Your Business with Seamless Financial Solutions

Experience the future of payment processing with 9th Swift. Our all-in-one platform offers seamless transactions, global reach, and robust security, empowering your business to thrive in the digital age.

01

How long until I receive payments?

Settlement happens within 24 hours, depending on payment method and verification status.
02

Are there hidden charges?

No. What you see is what you pay. All fees are clear up front.
03

What kinds of businesses are supported?

From small merchants to mid-size enterprises, especially those serving domestic and international clients.
04

What is required to get started?

Basic business verification (legal documents, bank account info). We try to make onboarding simple.