Skip to content
On this page

Transaction Enrichment

foo

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.

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.

ParameterDescriptionRequired
entity_idThe individual or business' entity idTrue

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

json
{
    "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.

ParameterDescriptionRequired
entity_idA linked entity id stringTrue
amountThe amount of the transaction. This can not be a negative balue. floatTrue
directionThe direction of the transaction. credit or debit enumTrue
dateThe date of the transaction. objectTrue
descriptionThe original transaction description. stringTrue
currencyThe transaction currency in ISO-4217 format. Defaults to USD stringFalse
countryThe country where the transaction was made in ISO-3166-2 format. Defaults to US stringFalse
transaction_idAn internal identifier for the transaction. stringFalse

date object

ParameterDescriptionRequired
daydate.day intTrue
monthdate.month intTrue
yeardate.year intTrue

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

json
{
  "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.

ParameterDescriptionRequired
entity_idA linked entity id stringTrue
pageThe current page to be displayed. Defaults to 0 intFalse

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

json
{
  "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.

ParameterDescriptionRequired
entity_idA linked entity id stringTrue

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.

ParameterDescriptionRequired
entity_idA linked entity id stringTrue

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.

countrycountry codecurrency
ArgentinaARARS
AustriaATEUR
AustraliaAUAUD
BelgiumBEEUR
BrazilBRBRL
CanadaCACAD
ChileCLCLF
ColombiaCOCOP
DenmarkDKDKK
EstoniaEEEUR
FinlandFIEUR
FranceFREUR
GermanyDEEUR
Hong KongHKHKD
IrelandIEEUR
IndiaININR
IndonesiaIDIDR
ItalyITEUR
JapanJPJPY
KenyaKEKES
KoreaKOKRW
MalaysiaMYMYR
MexicoMXMXN
NetherlandsNLEUR
New ZealandNZNZD
NigeriaNGNGN
NorwayNONOK
People's Republic of ChinaCNCNY
PolandPLPLN
Republic of the PhilippinesPHPHP
PortugalPTEUR
RomaniaRORON
RussiaRURUB
South AfricaZAZAR
SpainESEUR
SwedenSESEK
SwitzerlandCHCHF
TaiwanTWTWD
TurkeyTRTRY
United KingdomGBGBP
United StatesUSUSD