Use case
In this example, we will review how to create a currency account (account application) with an external service provider.
Use case data
API parameters with values
Creating a currency account.
The external provider is LHV.
The name of the account holder is Trevor Harry Tuum.
Trevor is assigned to the GROUP_A customer group.
The standard price list is assigned to the account.
The account currency is EUR.
The account interest rate is set to 10.
The account holder is a private person.
Sample API call
To create an account application, make the following API call.
https://account-api.sandbox.tuumplatform.com/api/v2/persons/{personId}/applications
Sample request
Below is an example request body of the API call for creating an account application.
{
"accountTypeCode": "CURRENCY",
"accountTypeSetupCode": "EXTERNAL_VIRTUAL",
"serviceProviderCode": "LHV",
"accountName": "My business account",
"personName": "Trevor Harry Tuum",
"residencyCountryCode": "GB",
"customerGroupCode": "GROUP_A",
"priceListTypeCode": "STANDARD",
"currencyCode": "EUR",
"accountInterestRate": 10,
"personTypeCode": "P"
}
curl -L 'https://account-api.sandbox.tuumplatform.com/api/v2/persons/ID-3392/applications' \
-H 'x-channel-code: SYSTEM' \
-H 'x-auth-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHBpcnlEVGltZSI6IjIwMjMtMDctMDVUMTg6MjI6MjEiLCJyb2xlcyI6WyJBRE1JTiJdLCJuYW1lIjoiSm9obiBPZmZpY2VyIiwiZW1wbG95ZWVJZCI6IjEiLCJ0ZW5hbnRDb2RlIjoiTUIiLCJleHAiOjE2ODg1ODEzNDF9.LFWDXWOCWurR4ywAhL-idPSQIVexdUXHad6h7p4mXJ0' \
-H 'Content-Type: application/json' \
-d '{
"accountTypeCode": "CURRENCY",
"accountTypeSetupCode": "EXTERNAL_VIRTUAL",
"serviceProviderCode": "LHV",
"accountName": "My business account",
"personName": "Trevor Harry Tuum",
"residencyCountryCode": "GB",
"customerGroupCode": "GROUP_A",
"priceListTypeCode": "STANDARD",
"currencyCode": "EUR",
"accountInterestRate": 10,
"personTypeCode": "P"
}'
Sample response
Below you find an example response body to the API call above.
Response
{
"errors": null,
"validationErrors": null,
"data": {
"accountApplicationId": "ID-1007",
"personId": "ID-3392",
"applicationStatusCode": "INSERTED",
"accountTypeSetupCode": "EXTERNAL_VIRTUAL",
"accountTypeCode": "CURRENCY",
"accountClassCode": null,
"serviceProviderCode": "LHV",
"tenantCode": "MB",
"applicationDate": "2023-07-05",
"accountNumber": null,
"statusNote": null
}
}
Result
A new account application ID-1007
is created.