In this example, we will review how to terminate an active contract prematurely (before the contract reaches its end date). We will use the deposit contract that was previously created.
The contract header is ID-1696407222.
See the page for more details.
...contracts/ID-1696407222/...
The active contract version is ID-1696407267.
See the page for more details.
.../versions/ID-1696407267/...
The deposit contract is terminated without any of the interest it has accrued during the term period.
To terminate an active contract prematurely, make the following API call.
deposit-api.sandbox.tuumplatform.com/api/v2/contracts/{headerId}/versions/{versionId}/prepare-for-termination
Below is an example request body of the API call for changing deposit contract payout details.
{
"terminationType": "WITHOUT_INTEREST",
"comment": "Closing contract"
}
curl --location 'https://deposit-api.sandbox.tuumplatform.com/api/v1/contracts/ID-1696407222/versions/ID-1696407267/prepare-for-termination' \
--header 'x-channel-code: SYSTEM' \
--header 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjQtMDMtMTVUMTg6MzM6MzYiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIuRVUiLCJleHAiOjE3MTA1Mjc2MTZ9.v5803cMEIrcXdTAnbWPEzODtlb0_YKspKRosMtjNyRg' \
--header 'Content-Type: application/json' \
--data '{
"terminationType": "WITHOUT_INTEREST",
"comment": "Closing contract"
}'
Below you will find an example response body to the API call above
As a result, the deposit contract is set to the TERMINATING
status.
"terminationType": "WITHOUT_INTEREST"