In this example we will review how to fetch the loan contract headerId parameter that is required for the further calls.
Searching for the contracts created for the person ID-3392.
...persons/ID-3392/contracts...
Requesting to display the search results on the first page; the page size is 10.
...?pageNumber=1&pageSize=10
To find person loan contracts, make the following call.
https://loan-api.sandbox.tuumplatform.com/api/v2/persons/{personId}/contracts
Below is the sample request of the API call for finding person contracts.
curl -L -g 'https://loan-api.{{env}}.{{domain}}/api/v2/persons/ID-3392/contracts?pageNumber=1&pageSize=10' \
-H 'x-channel-code: system' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDctMDZUMTU6MzE6MjEiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2ODg2NTc0ODF9.ZIKui9W5EmhGDUDWHVuprKcZNcWx7V_ZfqbbzLHEWx8' \
-d ''
Below you find an example response body to the API call above.
An existing contract with the number BL1000
was found. And the contract headerId ID-1664282474
was fetched.
https://loan-api.sandbox.tuumplatform.com/api/v2/persons/ID-3392/contracts?pageNumber=1&pageSize=10
{
"errors": null,
"validationErrors": null,
"data": {
"values": [
{
"headerId": "ID-1664282474",
"contractNumber": "BL1000",
"personId": "ID-3392",
"loanTypeCode": "BALLOON_LOAN",
"loanGroupCode": "UNSECURED_LOAN",
"referenceNumber": "500115",
"countryCode": "GB",
"tenantCode": "MB",
"firstVersionId": "ID-1664282484",
"activeVersionId": null,
"draftVersionId": null,
"statusCode": "WAITING_FOR_ACTIVATION",
"preparationDate": "2023-07-04",
"numberOfPayments": 12,
"limitMoney": {
"amount": 20000,
"currencyCode": "GBP"
},
"availableLimitMoney": null,
"balanceMoney": {
"amount": 0,
"currencyCode": "GBP"
},
"totalDebtMoney": null
},
{
"headerId": "ID-1664282473",
"contractNumber": "321001",
"personId": "ID-3392",
"loanTypeCode": "ANNUITY STANDARD",
"loanGroupCode": "UNSECURED_LOAN",
"referenceNumber": "500102",
"countryCode": "GB",
"tenantCode": null,
"firstVersionId": "ID-1664282483",
"activeVersionId": null,
"draftVersionId": null,
"statusCode": "ACTIVATING",
"preparationDate": "2023-07-03",
"numberOfPayments": 10,
"limitMoney": {
"amount": 10000,
"currencyCode": "EUR"
},
"availableLimitMoney": {
"amount": 10000,
"currencyCode": "EUR"
},
"balanceMoney": {
"amount": 0,
"currencyCode": "EUR"
},
"totalDebtMoney": null
}
],
"pageNumber": 1,
"pageSize": 10,
"endReached": true,
"sort": null
}
}