Webhook Library

Payment Source Created

🚧

Deprecation warning

This webhook event will soon be deprecated. Since the main use case for this webhook is to let you know that payments can be initiated from a payment source it is important to know which destination the payment can be made to. Therefore it is more useful to trigger an action based on the payment_source.beneficiary.updated webhook.

"type": "payment_source.created"

Payload object type: Payment Source

This webhook is triggered when your customer successfully creates a payment source using the Link SDKs Connect() or CreatePaymentSource() functions.

{
  "payload": {
    "id": "ab172710-740c-452b-a78f-8a36a9cf48ef",
    "customer_id": "0fd6d135-a4be-40ac-9630-1738ced7da69",
    "status": "AWAITING_BENEFICIARY_COOL_OFF",
    "bank_identifier": "LEANMB1",
    "bank_name": "Lean Mock Bank"
  },
  "type": "payment_source.created",
  "message": "A payment source was pre-authorized by your customer.",
  "timestamp": "2021-06-23T14:17:34.342847Z",
  "event_id": "00405221-21fc-4aa2-a237-3edfe4c38411"
}

Beneficiary Created

"type": "payment_source.beneficiary.created"

Payload object type: Payment Source Beneficiary

This webhook is triggered when your customer successfully creates a payment source using the Link SDKs Connect() or CreatePaymentSource() functions. This webhook is also triggered when a destination is added to a payment source using the Link SDK UpdatePaymentSource() function which creates a new beneficiary object within the payment source.

Unlike the payment_source.created webhook, the focal object for this webhook is the beneficiary, which represents the pathway between a payment_source and payment_destination. Many beneficiaries can be created for the same payment source which in the real world allows the payment source to make payments to many destinations.

{
  "payload": {
    "id": "2cd827ab-d0c4-462f-b2a2-12e3ef1b7d8e",
    "customer_id": "0fd6d135-a4be-40ac-9630-1738ced7da69",
    "payment_source_id": "ab172710-740c-452b-a78f-8a36a9cf48ef",
    "payment_destination_id": "99da636d-d022-4e0a-a450-a293ecdcb125",
    "status": "ACTIVE"
  },
  "type": "payment_source.beneficiary.created",
  "message": "A beneficiary was added for a payment source.",
  "timestamp": "2021-06-23T15:59:11.02946Z",
  "event_id": "5cf79ddb-ac0e-43fb-894d-5a54eb6c4856"    
}

Beneficiary Updated

"type": "payment_source.beneficiary.updated"

Payload object type: Payment Source Beneficiary

This webhook is triggered when a beneficiary object changes status from AWAITING_BENEFICIARY_COOL_OFF to ACTIVE. When this webhook is received, the payment source which the beneficiary belongs to can start to make payments to the payment destination that the beneficiary in question refers to.

📘

When received, we suggest notifying the payment_source's customer that payments can now be made through this payment source using a push notification.

{
  "payload": {
    "id": "2cd827ab-d0c4-462f-b2a2-12e3ef1b7d8e",
    "customer_id": "0fd6d135-a4be-40ac-9630-1738ced7da69",
    "payment_source_id": "ab172710-740c-452b-a78f-8a36a9cf48ef",
    "payment_destination_id": "99da636d-d022-4e0a-a450-a293ecdcb125",
    "status": "ACTIVE"
  },
  "type": "payment_source.beneficiary.updated",
  "message": "A beneficiary was updated for a payment source.",
  "timestamp": "2021-06-24T12:27:28.663129Z",
  "event_id": "9a826354-d2ea-499e-9f05-a5ad316ef3f1"
}

Payment Created

"type": "payment.created"

Payload object type: Payment

This webhook is triggered when your customer has successfully initiated a payment or when the payment was unsuccessful while going through the pay() flow within the Link SDK. The status of the payment is reflected in the status field within the payload.

{
  "payload": {
    "id": "66214bdb-5f1a-4127-9ddc-cc44c0446c82",
    "customer_id": "0fd6d135-a4be-40ac-9630-1738ced7da69",
    "intent_id": "b896af3a-1781-4a48-b173-ce4b2ca6a522",
    "status": "ACCEPTED_BY_BANK",
    "amount": 10.17,
    "currency": "AED",
    "bank_transaction_reference": "0H129D0RT04YY"
  },
  "type": "payment.created",
  "message": "A payment object has been created.",
  "timestamp": "2020-06-22T13:15:28.565512Z",
  "event_id": "f4096636-85f3-42f1-8148-3cf9b5377db2"
}

Payment Updated

"type": "payment.updated"

Payload object type: Payment

This webhook is triggered when there is an update to a specific payment. The new status of the payment is reflected in the status field within the payload.

{
  "payload": {
    "id": "e4e672fb-7f3c-43ea-be31-84195a65d0d7",
    "customer_id": "8ad2437d-2815-4b5c-82fd-543d85567668",
    "intent_id": "17e030df-91a9-4463-964c-6656605d5bcf",
    "status": "ACCEPTED_BY_BANK",
    "amount": 670,
    "currency": "AED",
    "bank_transaction_reference": "44778733",
    "end_user_id": "eb3b08f9-4d5e-4ea3-8d28-09b4917a61a9"
  },
  "type": "payment.updated",
  "message": "A payment object has been updated.",
  "timestamp": "2022-10-07T10:43:45.128593273Z",
  "event_id": "db2d5765-a303-4f0a-8bbe-b7a4711cf60b"
}

Entity Created

"type": "entity.created"

Payload object type: Entity

This webhook is triggered when your customer succesfully connects their account through the LinkSDK's connect(). The entity object is used by you to retrieve data from your customer's bank account. Where the entity_id serves as a token representing the holding bank account.

{
  "payload": {
    "id": "09934cdd-882c-4638-aa2f-bad17bf1a107",
    "customer_id": "0fd6d135-a4be-40ac-9630-1738ced7da69",
    "app_user_id": "20210908115512",
    "permissions": ["transactions", "balance", "identity", "accounts"],
    "bank_details": {
      "name": "Lean Mock Bank",
      "identifier": "LEANMB1",
      "logo": "https://cdn.leantech.me/img/bank-assets/uae/glyphs/citi/g-white-citi_uae.png",
      "main_color": "#ffffff",
      "background_color": "#003B70"
    }
  },
  "type": "entity.created",
  "message": "An entity object has been created.",
  "timestamp": "2021-09-08T10:57:21.613015Z",
  "event_id": "6573f646-a793-4e5e-897d-61b80e0e835c"
}

Entity Reconnected

"type": "entity.reconnected"

Payload object type: Reconnect

This webhook is triggered when your customer succesfully reconnects their account through the LinkSDK's reconnect(). The entity object is used by you to retrieve data from your customer's bank account. Where the entity_id serves as a token representing the holding bank account.

{
  "payload": {
    "id": "043722c7-7135-4eac-9641-a0b7b460248a",
    "reconnect_id": "bb30820d-ab9e-46d5-a64c-8a01455d1a88"
   },
   "type": "entity.reconnected",
   "message": "The reconnect was successful and the results are ready for collection from the results endpoint.",
   "timestamp": "2022-08-15T04:30:42.205222546Z",
   "event_id": "000b2e1e-bec3-4722-93e3-3f7987a16635"
}

Results Ready

"type": "results.ready"

Payload object type: Results

The results ready webhook is triggered after Lean's system has retrieved data requested to be delivered asynchronously.

{
  "payload": {
    "id": "dbd310a2-ebd9-4a0f-ae10-0f82f25f1bff"
  },
  "type": "results.ready",
  "message": "Your results are ready.",
  "timestamp": "2021-09-02T15:38:54.573741Z",
  "event_id": "f8752072-cef2-4056-9ff0-d5d2aa1e4558",
}

Bank Availability Updated

"type": "bank.availability.updated"

Payload object type: Bank

The Bank Availability webhook is triggered when a bank is taken offline by either Lean or by you in the Application Dashboard. When a bank is unavailable usage of the LinkSDK is restricted for end-users.

{
  "payload": {
    "identifier": "LEANMB1",
    "availability": {
      "active": {"payments": true, "data": true},
      "enabled": {"payments": true, "data": true}
    }
  },
  "type": "bank.availability.updated",
  "message": "The bank status has been updated.",
  "timestamp": "2021-12-14T15:06:46.083515Z",
  "event_id": "103586d6-e88c-40ba-aa0e-c6ee255aaf2e"
}

Payment Reconciliation Updated

"type": "payment.reconciliation.updated"

Payload object type: Reconciliation

The Payment Reconciliation webhook

{
    "payload": {
        "payment_id": "5ca5b15c-33d5-437f-b2cb-03e48586b8f8",
        "payment_intent_id": "0ddd6590-3f7f-4c62-902f-18e6560c443c",
        "payment_description": "1b180ef839f4",
        "status": "RECONCILED",
        "reference": "ENBD/100218532",
        "amount": 1500.00,
        "currency": "AED"
    },
    "type": "payment.reconciliation.updated",
    "message": "A payment reconciliation object has been updated.",
    "timestamp": "2022-06-22T14:06:13.375317Z",
    "event_id": "2d72dfe2-8306-491c-be83-b4fe278e4081"
}