Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.brand.dev/llms.txt Use this file to discover all available pages before exploring further.

Overview

Raw transaction data from credit card statements and bank feeds is notoriously messy - cryptic merchant codes, truncated names, and missing context make it difficult for users to understand their spending. Brand.dev’s Transaction Enrichment endpoint transforms this chaos into clean, visually appealing transaction records complete with:
  • Company logos for instant visual recognition
  • Clean company names replacing cryptic merchant codes
  • Industry categorization for spending insights
  • Social media profiles for merchant verification
  • Brand colors for themed UI experiences
The Transaction Enrichment endpoint helps you identify brands from transaction information by using optional geographic and industry context to improve accuracy. These optional parameters work together to provide more precise brand identification, especially when dealing with ambiguous merchant names or international brands. For complete endpoint documentation, request/response schemas, and code examples, see the full API reference. We’ll walk through the system design and best practices for implementing transaction enrichment in banking apps, budgeting tools, and financial dashboards.

Prerequisites

  1. A Brand.dev API key
  2. Access to transaction data (bank feeds, credit card statements, or payment processor data)

Concept

Brand.dev’s Transaction Enrichment endpoint takes messy transaction titles like AMZN MKTP US*2X7Y8Z and identifies the underlying brand, returning structured data including logos, company name, colors, and more.

Context Parameters

The following optional parameters can be provided to improve brand identification accuracy:

MCC (Merchant Category Code)

Type: string (4-digit code)
Parameter: mcc
The Merchant Category Code provides business category context to improve brand identification accuracy. MCC codes are standardized 4-digit numbers used by credit card companies to classify businesses by type. Example: "5200" (Retail), "5814" (Fast Food), "0742" (Veterinary Services) The system maintains a comprehensive database of MCC codes with specific descriptions. If a code exists in the database, it uses the specific description; otherwise, it falls back to genre classification based on code ranges.

City

Type: string
Parameter: city
The city name helps prioritize search results for local branches or regional variations of brands. Example: "New York", "London", "Seattle" No specific formatting is required, but using standard city names will yield better results.

Country GL

Type: string (ISO 3166-1 alpha-2 country code)
Parameter: country_gl
The country code specifies the geographic location for search results, helping prioritize brands operating in the specified country. Example: us, gb, ca, au All ISO 3166-1 alpha-2 country codes are supported (e.g., us for United States, gb for United Kingdom).
CountryCode
Afghanistanaf
Albaniaal
Algeriadz
American Samoaas
Andorraad
Angolaao
Anguillaai
Antarcticaaq
Antigua and Barbudaag
Argentinaar
Armeniaam
Arubaaw
Australiaau
Austriaat
Azerbaijanaz
Bahamasbs
Bahrainbh
Bangladeshbd
Barbadosbb
Belarusby
Belgiumbe
Belizebz
Beninbj
Bermudabm
Bhutanbt
Boliviabo
Bosnia and Herzegovinaba
Botswanabw
Bouvet Islandbv
Brazilbr
British Indian Ocean Territoryio
Brunei Darussalambn
Bulgariabg
Burkina Fasobf
Burundibi
Cambodiakh
Camerooncm
Canadaca
Cape Verdecv
Cayman Islandsky
Central African Republiccf
Chadtd
Chilecl
Chinacn
Christmas Islandcx
Cocos (Keeling) Islandscc
Colombiaco
Comoroskm
Congocg
Congo, The Democratic Republic of thecd
Cook Islandsck
Costa Ricacr
Côte d’Ivoireci
Croatiahr
Cubacu
Cypruscy
Czech Republiccz
Denmarkdk
Djiboutidj
Dominicadm
Dominican Republicdo
Ecuadorec
Egypteg
El Salvadorsv
Equatorial Guineagq
Eritreaer
Estoniaee
Ethiopiaet
Falkland Islands (Malvinas)fk
Faroe Islandsfo
Fijifj
Finlandfi
Francefr
French Guianagf
French Polynesiapf
French Southern Territoriestf
Gabonga
Gambiagm
Georgiage
Germanyde
Ghanagh
Gibraltargi
Greecegr
Greenlandgl
Grenadagd
Guadeloupegp
Guamgu
Guatemalagt
Guineagn
Guinea-Bissaugw
Guyanagy
Haitiht
Heard Island and McDonald Islandshm
Holy See (Vatican City State)va
Hondurashn
Hong Konghk
Hungaryhu
Icelandis
Indiain
Indonesiaid
Iran, Islamic Republic ofir
Iraqiq
Irelandie
Israelil
Italyit
Jamaicajm
Japanjp
Jordanjo
Kazakhstankz
Kenyake
Kiribatiki
Korea, Democratic People’s Republic ofkp
Korea, Republic ofkr
Kuwaitkw
Kyrgyzstankg
Lao People’s Democratic Republicla
Latvialv
Lebanonlb
Lesothols
Liberialr
Libyan Arab Jamahiriyaly
Liechtensteinli
Lithuanialt
Luxembourglu
Macaomo
Macedonia, The Former Yugoslav Republic ofmk
Madagascarmg
Malawimw
Malaysiamy
Maldivesmv
Maliml
Maltamt
Marshall Islandsmh
Martiniquemq
Mauritaniamr
Mauritiusmu
Mayotteyt
Mexicomx
Micronesia, Federated States offm
Moldova, Republic ofmd
Monacomc
Mongoliamn
Montserratms
Moroccoma
Mozambiquemz
Myanmarmm
Namibiana
Naurunr
Nepalnp
Netherlandsnl
Netherlands Antillesan
New Caledonianc
New Zealandnz
Nicaraguani
Nigerne
Nigeriang
Niuenu
Norfolk Islandnf
Northern Mariana Islandsmp
Norwayno
Omanom
Pakistanpk
Palaupw
Palestinian Territory, Occupiedps
Panamapa
Papua New Guineapg
Paraguaypy
Perupe
Philippinesph
Pitcairnpn
Polandpl
Portugalpt
Puerto Ricopr
Qatarqa
Réunionre
Romaniaro
Russian Federationru
Rwandarw
Saint Helenash
Saint Kitts and Neviskn
Saint Lucialc
Saint Pierre and Miquelonpm
Saint Vincent and the Grenadinesvc
Samoaws
San Marinosm
Sao Tome and Principest
Saudi Arabiasa
Senegalsn
Serbia and Montenegrors
Seychellessc
Sierra Leonesl
Singaporesg
Slovakiask
Sloveniasi
Solomon Islandssb
Somaliaso
South Africaza
South Georgia and the South Sandwich Islandsgs
Spaines
Sri Lankalk
Sudansd
Surinamesr
Svalbard and Jan Mayensj
Swazilandsz
Swedense
Switzerlandch
Syrian Arab Republicsy
Taiwan, Province of Chinatw
Tajikistantj
Tanzania, United Republic oftz
Thailandth
Timor-Lestetl
Togotg
Tokelautk
Tongato
Trinidad and Tobagott
Tunisiatn
Turkeytr
Turkmenistantm
Turks and Caicos Islandstc
Tuvalutv
Ugandaug
Ukraineua
United Arab Emiratesae
United Kingdomgb
United Statesus
United States Minor Outlying Islandsum
Uruguayuy
Uzbekistanuz
Vanuatuvu
Venezuelave
Viet Namvn
Virgin Islands, Britishvg
Virgin Islands, U.S.vi
Wallis and Futunawf
Western Saharaeh
Yemenye
Zambiazm
Zimbabwezw

Architecture

1. Parsing Raw Transaction Data

Transaction data from banks and credit card processors typically includes:
  • Transaction title/description - Often truncated or encoded (e.g., SQ *COFFEE SHOP NYC)
  • Amount - The transaction value
  • MCC code - Merchant Category Code (4-digit industry classifier)
  • Location data - City, country (when available)
The Transaction Enrichment endpoint accepts all of these as inputs to improve identification accuracy:
const { brand } = await client.brand.identifyTransaction({
  transaction: "AMZN MKTP US*2X7Y8Z",
  mcc: "5942",           // Optional: Book stores
  city: "Seattle",       // Optional: Geographic context
  country_gl: "us"       // Optional: Country code
});
The more context you provide (MCC code, city, country), the more accurate the brand identification will be - especially for common names or regional businesses.

2. Batch Processing vs. Real-time

Choose your processing strategy based on your use case: Real-time enrichment - Enrich transactions as they stream in from your banking provider. Best for:
  • Live transaction notifications
  • Real-time spending alerts
  • Interactive transaction feeds
Batch processing - Process transactions in bulk during off-peak hours. Best for:
  • Historical transaction import
  • Daily/weekly statement processing
  • Cost optimization (process after user engagement is confirmed)
For high-volume batch processing, implement rate limiting and exponential backoff to stay within API limits.

3. Handling Identification Confidence

Not all transactions can be definitively matched to a brand. Your implementation should handle varying confidence levels:
ScenarioRecommendation
Strong matchDisplay enriched data with logo and clean name
Weak/no matchFall back to cleaned transaction title and generic category icon
Personal transfersDisplay as peer-to-peer with appropriate icon and service
function displayTransaction(transaction, brandData) {
  if (brandData?.brand) {
    return {
      name: brandData.brand.title,
      logo: brandData.brand.logos[0]?.url,
      color: brandData.brand.colors[0]?.hex
    };
  }
  // Fallback to original transaction data
  return {
    name: cleanTransactionTitle(transaction.description),
    logo: getCategoryIcon(transaction.mcc),
    color: "#6B7280" // Neutral gray
  };
}

4. Caching for Performance

Transaction enrichment benefits significantly from caching since users often transact with the same merchants repeatedly:
const enrichmentCache = new Map();

async function enrichTransaction(transaction) {
  const cacheKey = normalizeTransactionKey(transaction.description);
  
  if (enrichmentCache.has(cacheKey)) {
    return enrichmentCache.get(cacheKey);
  }
  
  const brandData = await client.brand.identifyTransaction({
    transaction: transaction.description,
    mcc: transaction.mcc,
    country_gl: transaction.country
  });
  
  enrichmentCache.set(cacheKey, brandData);
  return brandData;
}
Cache by normalized merchant name rather than exact transaction string—STARBUCKS #12345 and STARBUCKS #67890 should share the same cache entry.

5. Displaying Enriched Transactions

Transform your transaction list from plain text to a rich, branded experience: Before enrichment:
AMZN MKTP US*2X7Y8Z         -$47.99
SQ *COFFEE SHOP NYC          -$5.50
UBER   *TRIP HELP.UBER.      -$23.45
After enrichment:
  • Display the merchant’s logo alongside the transaction
  • Show the clean company name (e.g., “Amazon Marketplace”)
  • Use brand colors for visual accents or category theming
  • Link to merchant website or social profiles when helpful

Best Practices

1. Use MCC Codes When Available

MCC (Merchant Category Codes) significantly improve identification accuracy. These 4-digit codes are standard in credit card processing and help disambiguate common names. For example, “Apple” with MCC 5732 (Electronics Stores) identifies Apple Inc., while MCC 5411 (Grocery Stores) might indicate a local fruit market.

2. Implement Graceful Fallbacks

Always have a fallback display for unidentified transactions. Show a cleaned version of the original transaction title with a category-appropriate icon based on the MCC code. Never show raw, encoded transaction strings to users.

3. Respect User Corrections

Allow users to manually categorize or rename transactions that weren’t identified correctly. Store these corrections and use them as overrides for future transactions from the same merchant pattern.

4. Handle Edge Cases

Some transactions will never match a brand (peer-to-peer transfers, ATM withdrawals, generic payment processors). Detect these patterns and apply appropriate generic categorization rather than attempting brand identification.

Example Use Cases

Personal Finance Apps

Display spending breakdowns with merchant logos, making it easy for users to recognize where their money goes at a glance.

Business Expense Management

Automatically categorize and enrich employee expenses for cleaner reports and easier reconciliation.

Banking Applications

Transform plain statement views into modern, visual transaction feeds that improve user engagement.

Subscription Tracking

Identify recurring merchant charges and display them with brand logos for easy subscription management.