Partners an surface repayment information within their UI, we have multiple webhooks to allow for this use-case.
YouLend have a SettlementProcessed
webhook that triggers whenever we process a settlement sent by a partner into a Virtual IBAN.
Settlement Processed webhookLOA10055
example payload
LOA10055
example payload{
"EventCode": "LOA10055",
"Message": "A settlement from a partner has been processed - payments towards the loan have been initiated",
"EventProperties": {
"EventId": "874b3183-640a-4fa5-bf49-2e2f063f5e34",
"LoanId": "a3c3279c-d84a-4ec7-9191-b2b371515bd9",
"TotalSettlementAmount": "600",
"SettlementReference": "test repayment",
"PaymentsToLenders": [
{
"Amount": "400",
"PaymentCorrelationId": "a61e16ef-e63a-4cda-b755-95b22ddfae3a"
},
{
"Amount": "200",
"PaymentCorrelationId": "a5ee16ef-e443a-4cda-b6665-55b12ddfae3a"
}
],
"LeadId": "d8c38d41-6256-44b2-8bd2-3d0219f04b4e"
}
}
Parameter | Description |
---|---|
TotalSettlementAmount | The amount sent to the virtual/settlement account by the partner |
SettlementReference | The reference included in the transfer made to the virtual/settlement account, you can use this reference to reconcile the PaymentCorrelationId to the transfer |
Amount | The amount sent to each individual lender |
PaymentCorrelationId | A unique Id correlated with the Id sent in the Repayment webhook |
With this webhook (LOA10055
), the partner will receive confirmation that:
- YouLend has received £600 in the Virtual Account linked to loanId:
a3c3279c-d84a-4ec7-9191-b2b371515bd9
, with the referencetest repayment
- YouLend has processed the settlement and initiated the necessary loan repayments to the lenders.
After this, YouLend then create a transaction that triggers the next webhook LOA10040
once the money has been used as a repayment against the loan.
Repayment webhook LOA10040
example payload
LOA10040
example payload{
"EventCode": "LOA10040",
"EventProperties": {
"CorrelationId": "cf08c5de-ef80-460c-aedd-76a49c2ca388",
"LeadId": "113222a1-1a89-4ef0-bda3-bad07224fe11",
"LoanId": "d90c9fc1-cdd0-4dfc-810a-e2bab1f76199",
"PaymentAmount": "10.00",
"PaymentDate": "2023-10-20T00:00:00Z",
"PrincipalRemaining": "9880.40",
"PaymentTypeDetails": {
"PaymentType": "Settlement",
"SettlementReference": "test ",
"SettlementAmount": "10.00"
},
"Message": "A repayment was made towards the loan"
}
Parameter | Description |
---|---|
CorrelationId | The LOA10040 webhook also contains the CorrelationId to allow the partner to accurately reconcile the repayments YouLend processes |
PaymentType | This is a string with two possible values, settlement or other . YouLend are able to distinguish whether a repayment was created as a consequence of a transaction settling into the settlement virtual account (where settlement is returned), or if the repayment was a consequence of a manual repayment (where other is returned). An example of a manual repayment could be when a Direct Debit is established with the merchant to help them catch up with their repayments |
SettlementReference | This is the reference of the settlement transaction that settled on the virtual account. A partner can use this field to match against the reference they sent, and therefore differentiate their own payments from any potential external one. Important to note that references can be truncated whilst going through banks and APIs, therefore a hard match is not advised. This value will be empty / null if the PaymentType is other |
SettlementAmount | This is the amount of the settlement transaction that settled on the virtual account. This field can be used as an extra check alongside the transaction reference. Note that any settlement will be linked to multiple repayment webhooks, so expect this amount to be bigger than the paymentAmount (as the repayments are "per lender") |
Best practiceIf the partner doesn't have access to the SettlementReference for matching, they can reasonably assume that all payments with the type
settlement
originate from their own transfers