Transaction Enrichment
Stack Partners with leading technology providers to offer transaction enrichment in a clean, standard and reliable API. To use the Transaction Enrichment service, you can either link an existing entity, and attach each enriched transaction to that entity or create a new entity with basic information and link the entity id. The minimum access_level
for an entity to use this service is 1
.
Link an entity
Before you link an entity, ensure that you have already created either an individual entity or a business entity
Endpoint
{BASE_URL}/transactions/enrichment/entity
Method: POST.
Parameter | Description | Required |
---|---|---|
entity_id | The individual or business' entity id | True |
Sample Request
curl --location --request POST 'https://api.stack-ft.com/transactions/enrichment/entity' \
--header 'Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"entity_id": "i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36"
}'
Sample Response
{
"status": "success",
"entity": {
"entity_id": "i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36"
},
"request_id": "d755456b-954e-48c3-8328-15a22e3ee27d"
}
INFO
In order to avoid duplicate records of the same entity, when we identify that an entity id has already been linked, we simply respond with that linked entity id and skip the link request.
Enrich a transaction
When enriching a transaction, you also have to provide the linked entity_id
. When you pass the entity_id
, the transaction is automatically linked to that entity. This also allows us do things like determine subscription, personas, bills and expenses, income.
Endpoint
{BASE_URL}/transactions/enrichment/enrich
Method: POST.
Parameter | Description | Required |
---|---|---|
entity_id | A linked entity id string | True |
amount | The amount of the transaction. This can not be a negative balue. float | True |
direction | The direction of the transaction. credit or debit enum | True |
date | The date of the transaction. object | True |
description | The original transaction description. string | True |
currency | The transaction currency in ISO-4217 format. Defaults to USD string | False |
country | The country where the transaction was made in ISO-3166-2 format. Defaults to US string | False |
transaction_id | An internal identifier for the transaction. string | False |
date object
Parameter | Description | Required |
---|---|---|
day | date.day int | True |
month | date.month int | True |
year | date.year int | True |
Sample Request
curl --location --request POST 'https://api.stack-ft.com/transactions/enrichment/enrich' \
--header 'Authorization: API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"entity_id": "i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36",
"amount": 59.03,
"direction": "debit",
"description": "AMZN Mktp US*N87AP5UI3 Amzn.com/bi WA",
"currency": "USD",
"country": "US",
"date": {
"day": 4,
"month": 1,
"year": 2023
}
}'
Sample Response
{
"status": "success",
"transaction": {
"entity_id": "i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36",
"transaction_id": "5d2cff61-2b55-4de5-bdbf-ae191f3433f7",
"merchant_name": "Amazon",
"mcc": [
5942
],
"merchant_website": "amazon.com",
"merchant_location": "us, wa",
"transaction_category": [
"goods",
"ecommerce"
],
"transaction_direction": "debit"
}
}
Get entity transactions
This allows you to get a list of all transactions associated with an entity. This API returns a maximum of 100 items per page.
Endpoint
{BASE_URL}/transactions/enrichment/entity/transactions
Method: GET.
Parameter | Description | Required |
---|---|---|
entity_id | A linked entity id string | True |
page | The current page to be displayed. Defaults to 0 int | False |
Sample Request
curl --location --request GET 'https://api.stack-ft.com/transactions/enrichment/entity/transactions?entity_id=i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36' \
--header 'Authorization: API_KEY' \
--data-raw ''
Sample Response
{
"status": "success",
"total_pages": 1,
"transactions": [
{
"entity_id": "i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36",
"transaction_id": "5d2cff61-2b55-4de5-bdbf-ae191f3433f7",
"merchant_name": "Amazon",
"mcc": [
5942
],
"merchant_website": "amazon.com",
"merchant_location": "us, wa",
"transaction_category": [
"goods",
"ecommerce"
],
"transaction_direction": "debit"
}
]
}
Get entity subscriptions
This allows you to get a list of all subscriptions associated with an entity.
Endpoint
{BASE_URL}/transactions/enrichment/entity/subscriptions
Method: GET.
Parameter | Description | Required |
---|---|---|
entity_id | A linked entity id string | True |
Sample Request
curl --location --request GET 'https://api.stack-ft.com/transactions/enrichment/entity/subscriptions?entity_id=i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36' \
--header 'Authorization: API_KEY' \
--data-raw ''
Get entity income
This allows you to get an entity's assumed income based on reported transactions.
Endpoint
{BASE_URL}/transactions/enrichment/entity/income
Method: GET.
Parameter | Description | Required |
---|---|---|
entity_id | A linked entity id string | True |
Sample Request
curl --location --request GET 'https://api.stack-ft.com/transactions/enrichment/entity/income?entity_id=i_uuid_5b240456-ff05-4d9c-908c-241525a6ca36' \
--header 'Authorization: API_KEY' \
--data-raw ''
DANGER
If an entity does not have enough transactions to determine the income, the api will return a 400
error status code and you will not be charged.
Currency-Country Pair
WARNING
If you provide an invalid currency-country pair, the request will fail with an invalid_pair
error.
country | country code | currency |
---|---|---|
Argentina | AR | ARS |
Austria | AT | EUR |
Australia | AU | AUD |
Belgium | BE | EUR |
Brazil | BR | BRL |
Canada | CA | CAD |
Chile | CL | CLF |
Colombia | CO | COP |
Denmark | DK | DKK |
Estonia | EE | EUR |
Finland | FI | EUR |
France | FR | EUR |
Germany | DE | EUR |
Hong Kong | HK | HKD |
Ireland | IE | EUR |
India | IN | INR |
Indonesia | ID | IDR |
Italy | IT | EUR |
Japan | JP | JPY |
Kenya | KE | KES |
Korea | KO | KRW |
Malaysia | MY | MYR |
Mexico | MX | MXN |
Netherlands | NL | EUR |
New Zealand | NZ | NZD |
Nigeria | NG | NGN |
Norway | NO | NOK |
People's Republic of China | CN | CNY |
Poland | PL | PLN |
Republic of the Philippines | PH | PHP |
Portugal | PT | EUR |
Romania | RO | RON |
Russia | RU | RUB |
South Africa | ZA | ZAR |
Spain | ES | EUR |
Sweden | SE | SEK |
Switzerland | CH | CHF |
Taiwan | TW | TWD |
Turkey | TR | TRY |
United Kingdom | GB | GBP |
United States | US | USD |