Callbacks

In this guide, we will look at how to register and consume callbacks to integrate your app with the Leabank API. With callbacks, your app can be notified when something happens during a loan application process, such as a credit decision being made or a status change.

Registering callbacks

Now, whenever something of interest happens during a loan application process, a webhook is fired off by the Leabank API. In the next section, we'll look at how to consume callbacks.

Consuming callbacks

When your app receives a callback request from the Leabank API, check the event type to determine what happened. The payload varies depending on the event type.

Example callback payload

{
  "applicationId": "bc6f2582-1ae0-44fc-b778-c250d2d7e22d",
  "externalApplicationId": "EXT-123",
  "agentId": "my-agent",
  "agentCountryId": "my-agent_se",
  "country": "SE",
  "timestamp": "2024-10-24T17:21:35.531Z",
  "payload": {
    "product": "loan",
    "approvedAmount": 150000,
    "duration": 60
  }
}

In the example above, a loan application was approved, and the payload contains the approved offer details.

Event types

  • Name
    approved
    Description

    Event indicating application has been approved.

  • Name
    declined
    Description

    Event indicating application has been declined.

  • Name
    canceled
    Description

    Event indicating application has been manually cancelled by Leabank.

  • Name
    document-sent
    Description

    Event indicating documents have been sent to customer for signing.

  • Name
    document-signed
    Description

    Event indicating documents have been signed by the customer.

  • Name
    awaiting-confirmation
    Description

    Event indicating application is waiting for confirmation from agent (only sales finance product).

  • Name
    ready-for-disbursement
    Description

    Event indicating application is ready to be disbursed.

  • Name
    issued
    Description

    Event indicating application has been issued (only credit card product).

  • Name
    disbursed
    Description

    Event indicating application has been disbursed.

Example approved event

{
    "applicationId": "bc6f2582-1ae0-44fc-b778-c250d2d7e22d",
    "externalApplicationId": "EXT-123",
    "agentId": "my-agent",
    "agentCountryId": "my-agent_se",
    "country": "SE",
    "timestamp": "2024-10-24T17:21:35.531Z",
    "payload": {
        "product": "loan",
        "approvedAmount": 150000,
        "duration": 60,
        "monthlyCost": 3200,
        "interestRate": 7.95,
        "effectiveInterestRate": 9.52,
        "signingLink": "https://..."
    }
}

Was this page helpful?