Lendbox
  • Home
  • Borrowers
    • Creating a Borrower
  • Loans
    • Creating/Disbursing a Loan
    • Loan Statement
    • Repayments
    • Loan Discounts
  • Borrower Website
  • Loan Products
  • Staff Members
  • Branches
  • API Integration
    • REST API
    • Webhooks
Powered by GitBook
On this page
  1. API Integration

Webhooks

What are Webhooks in Lendbox API?

Webhooks are GitHub-like callbacks issued by the Lendbox API, providing you with a way to receive real-time updates directly from the platform. Instead of pulling data from the API at specific intervals, webhooks allow you to listen for specific events and take action immediately when those events occur.

Key Benefits of Using Webhooks:

  • Real-Time Updates: Have the ability to instantly act without waiting for users or programs to request data.

  • Improved User Experience: Your application can react to any event (for example, loan status changes) quickly, enhancing user interaction without asking users to refresh or pull for information manually.

How to Set Up Webhooks

  1. Webhook Integration:

    • You need to specify a public, accessible URL on your server where you will receive webhook notifications.

  2. Setup Webhook Notifications:

    • Through your Lendbox dashboard, you will register your webhook URL by navigation to API Integration > Webhooks.

    • Choose the types of events for which you want notifications (e.g., loan created, loan updated, borrower created, etc).

  3. Handling Webhook Payload:

    • When an event you're subscribed to occurs, Lendbox will send an HTTP POST request to your subscribed URL.

    • The request body will include relevant information about the event in JSON format.

    Example Payload:

    {
        "event": "borrower_created",
        "data": {
            "id": "xyz123",
            "firstName": "John",
            "lastName": "Doe",
            "createdAt": "2025-04-17T12:30:00Z"
        }
    }
  4. Responding to Calls:

    • Your application should receive the webhook request and return an HTTP status code to acknowledge receipt and processing of the data (e.g.non-2xx codes indicate an error).

    • After processing the webhook data, implement logic based on the information (e.g. processing repayments, updating databases).

PreviousREST API

Last updated 2 months ago