projects.apps.loans
Overview
The Loans API allows you to:
View, create and manage loan accounts.
Make loan repayments.
Make loan disbursements.
Fields
Field | Data Type | Description |
accountId | string | Required A string that uniquely identifies the loan account within the lending app. Read-only after creation |
accountNo | number | Required. Used in responses only. A globally unique numeric identifier for the loan account. Read-only after creation |
loanType | string | Required The loan type. It is synonymous with the lending product type for the loan. Read-only |
borrowerId | string | Id of the borrower that holds the loan account. Read-only after creation |
lenderId | string | null | Required Id of the lender that owns the account. Read-only after creation |
category | string ( 'individual', 'company' ) | Required Loan account category. It is synonymous with the borrower account category. Read-only after creation |
sequenceNo | number | Required. Used in responses only. Indicates the account's position in the list of ordered loans for a borrower. It is equal to the number of loan accounts attached to the current borrower plus 1. Read-only after creation |
productId | string | Required
The Read-only after creation |
contract | object ( LendingContract ) | Required The lending contract used to create the loan. Read-only after creation |
loanAmount | number | Required The loan principal amount. Read-only after creation |
balances | object ( LoanBalances ) | Required The loan account's balances. These will change whenever an adjustment is done on the account. Read-write |
startDate | string ( Timestamp format ) | Required. The loan account's start date as per the contract. It is expressed in ISO format. Read-write |
maturityDate | string ( Timestamp format ) | The date that the loan account is expected to be fully settled as per the contract. It is expressed in ISO format. Read-write |
status | number | Loan account status. Read-write |
schedule | object ( LoanSchedule ) | Loan schedule information. Read-write |
settlementDate | string ( Timestamp format ) | null | The date that the loan account was fully settled as per the contract. It is expressed in ISO format. Read-write |
requestId | string |
The GetOffers Read-only |
assessmentId | string | null | The credit assessment id that was used to create the loan. Read-only |
appVersionId | string | null | The lending app Example: Read-only |
performanceStatus | number | Used in responses only. Indicates an open loan account's current performance as per the contract. Read-only |
settings | object ( LoanSettings ) | null | Loan settings. Read-write |
result | object ( LoanOutcome ) | null | Used in responses only. The loan outcome. It’s set to null on creation of the account and is populated with the outcome after the account is closed. Read-only |
labels | object ( Labels ) | null | Custom loan account labels. Read-write |
List
GET
https://lending.wezaapis.com/v1/projects/:projectId/apps/:appId/loans
List all loan accounts for a lending app.
Path Parameters
Name | Type | Description |
---|---|---|
projectId | string | Id of the weza.io project |
appId | string | Id of the lending app |
Query Parameters
Name | Type | Description |
---|---|---|
order | string | Describes how to order the results.
The value can be either |
filter | string | An expression to filter the results of the request.
The following fields can be used to filter loans.
- |
pageToken | string | The |
pageSize | string | Maximum results per page. Defaults to 1000. |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token |
Request Body
The request body should be empty.
Response Body
If successful, the response will contain data with the following structure.
Fields
Field | Data Type | Description |
loans[] | object(Loan) | A list of loan instances. |
nextPageToken | string | Token to use to fetch the next page of data if any. |
Authorization
Requires one of the following OAuth scopes:
platform.lending
platform.lending:read
The authenticated user must have the lending.loans.list
permission.
Create
POST
https://lending.wezaapis.com/v1/projects/:projectId/apps/:appId/loans
Create a loan account if one doesn't exist.
Path Parameters
Name | Type | Description |
---|---|---|
appId | string | Id of the lending app |
projectId | string | Id of the weza.io project |
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token |
Request Body
The request body contains an instance of Loan.
Response Body
The response body contains a new instance of Loan.
Authorization
Requires one of the following OAuth scopes:
platform.lending
platform.lending:write
The authenticated user must have the lending.loans.create
permission.
Get
GET
https://lending.wezaapis.com/v1/projects/:projectId/apps/:appId/loans/:accountId
Retrieve a loan by id.
Path Parameters
Name | Type | Description |
---|---|---|
projectId | string | Id of the weza.io project |
appId | string | Id of the lending app |
accountId | string |
|
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token |
Response Body
The response body contains an instance of Loan.
Authorization
Requires one of the following OAuth scopes:
platform.lending
platform.lending:read
The authenticated user must have the lending.loans.get
permission.
Delete
DELETE
https://lending.wezaapis.com/v1/projects/:projectId/apps/:appId/loans/:accountId
Delete a loan account by id. You cannot delete an account whose state is either open or closed.
Path Parameters
Name | Type | Description |
---|---|---|
projectId | string | Id of the weza.io project |
appId | string | Id of the lending app |
accountId | string |
|
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token |
Response Body
The response body is empty.
Authorization
Requires one of the following OAuth scopes:
platform.lending
platform.lending:write
The authenticated user must have the lending.loans.delete
permission.
MakeRepayment
POST
https://lending.wezaapis.com/v1/projects/{projectId}/apps/{appId}/loans/{accountId}:makeRepayment
Make a loan repayment. You cannot only make a repayment for an account whose state is open.
Path Parameters
Name | Type | Description |
---|---|---|
projectId | string | Id of the weza.io project |
appId | string | Id of the lending app |
accountId | string |
|
Headers
Name | Type | Description |
---|---|---|
Authorization | string | Bearer token |
Request Body
The request body should contain the following parameters.
Parameter | Data Type | Description |
externalId | string | The id of the repayment transaction from the payments network. |
amount | number | Repayment amount. |
transactionDate | string ( Timestamp format ) | The real world date of the repayment transaction in ISO format. |
valueDate | string ( Timestamp format ) | The actual date that the payment will take effect on the account in ISO format. It defaults to the |
channel | string ( 'web', 'mobile', 'physical' ) | null | The payment channel type. |
network | string | null | The name of the payment network. |
currencyCode | string | null | The currency code. |
notes | string | null | Transaction notes. |
Response Body
The response body contains an instance of Loan.
Authorization
Requires one of the following OAuth scopes:
platform.lending
platform.lending:write
The authenticated user must have the lending.loans.makeRepayment
permission.
Last updated