All pages
Powered by GitBook
1 of 1

Loading...

Find person contracts

Use case

In this example we will review how to fetch the loan contract headerId parameter that is required for the further calls.

Use case data
API parameters with values

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

Sample API call

To find person loan contracts, make the following call.

Sample request

Below is the sample request of the API call for finding person contracts.

https://loan-api.sandbox.tuumplatform.com/api/v2/persons/ID-3392/contracts?pageNumber=1&pageSize=10
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 ''

Sample response

Below you find an example response body to the API call above.

Response
{
    "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
    }
}

Result

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/{personId}/contracts

See more information about the endpoint in the Tuum developer portal.

find person loan contracts