Webhook Integration

Seamlessly Connect and Automate Your Payouts with Our Webhooks

Introduction

Kredete uses webhooks to notify your application about updates on event objects initiated with our API. Webhooks allow you to kick off additional workflows based on these events. Each time a subscribed event occurs, Kredete sends a POST request to your designated webhook URL containing details about the event transaction.

The webhook system supports reliable delivery through an intelligent retry mechanism with exponential backoff and logging. Below are the supported webhook events and details on how to create and handle webhooks.


Supported Webhook Events

Customer Events

  • customer.add: Triggered when a new customer is added.

Payment Events

  • payment.transfer: Triggered when a payment transfer occurs.

Virtual Account Events

  • virtual_account.add: Triggered when a new virtual account is added.

Creating a Webhook

A webhook is a real-time communication method that allows your application to receive notifications from external services when specific events occur, such as customer creation, payment transfers, or virtual account additions.

How It Works

  1. Endpoint Setup:
    Create a publicly accessible URL (endpoint) on your server or application to receive webhook data.

  2. Registration:
    Register your webhook URL within Kredete’s API settings or configuration.

  3. Event Trigger:
    When an event occurs, Kredete sends an HTTP POST request to your registered webhook URL.

  4. Data Delivery:
    The POST request contains a payload (often in JSON) with structured data about the event.

  5. Data Processing:
    Your application processes the webhook payload, triggering actions or updating your system.

Please note: In the event the webhook event fails, we implemented an intelligent retry mechanism with exponential backoff. This means that if an initial delivery fails, we'll automatically retry it, gradually increasing the delay between attempts.

This prevents overwhelming the target service and allows for temporary network or server issues to resolve. If retries exceed a certain threshold, we'll log the final failure, providing you with detailed information. With our service, you can rest assured that your webhooks will reach their destination, even in challenging network conditions.

Intelligent Retry Mechanism

In case of delivery failure:

  • Kredete implements an intelligent retry mechanism with exponential backoff.
  • If retries exceed a certain threshold, the system logs the failure and provides detailed information for troubleshooting.

Webhook Request Structure

Each webhook request is a POST request with the following structure:

  • URL: The endpoint where the webhook is sent.
  • Data: A JSON object containing the event details.
  • Headers: Optional headers such as Content-Type: application/json.

Payload Structure

The webhook payload includes:

  • event: The event type (e.g., virtual_account.add).
  • timestamp: The time when the event was triggered (in ISO 8601 format).
  • data: Specific data related to the event.
  • signature: A cryptographic signature for verifying webhook authenticity.

Verifying Webhook Signatures

To ensure the authenticity of webhooks:

  1. Obtain the Secret Key:
    Retrieve the secret key used to generate the webhook signature.

  2. Reconstruct the Payload:
    Create a JSON string containing the event and data fields from the webhook payload.

  3. Calculate the Signature:
    Use the HMAC-SHA256 algorithm and your secret key to calculate a signature for the reconstructed payload.

  4. Compare Signatures:
    Match the calculated signature with the signature included in the webhook. If they match, the payload is verified.