AMZN*MKTP US) and returns:
titleanddomain: clean company name and domainlogos: SVG/PNG variants in light, dark, and on-background modescolors: hex codes of colors from the merchant’s logoindustries.eic: industry + subindustry classificationstock: ticker and exchange for publicly traded merchants- And more:
socials,address,links,description,slogan
mcc, city, country_gl, or phone.
Integrate Context.dev's Transaction Enrichment endpoint in your app
Prerequisites
-
A Context.dev API key. Sign up at context.dev/signup, copy the key from the dashboard (prefix
ctxt_secret_), and export it: -
An SDK (optional). Install for your language, or skip the install and call directly with
curl:
Identify a transaction
GET /brand/transaction_identifier takes a raw descriptor and resolves it to a merchant brand. Pass MCC and geography hints when you have them: they collapse ambiguity sharply on small or regional merchants.
Request Parameters
| Parameter | Type | Description |
|---|---|---|
transaction_info | string | Required. Raw transaction descriptor (e.g. AMZN MKTP US*2X7Y8Z, SQ *COFFEE SHOP NYC). |
mcc | string | 4-digit Merchant Category Code. The resolver maintains an MCC database with specific descriptions; otherwise it falls back to a general category based on the code range. Examples: 5411 grocery, 5814 fast food / takeout, 5812 restaurants, 5942 book stores, 4121 taxis & limousines. |
country_gl | string (ISO 3166-1 alpha-2, lowercase) | Country hint for geographic disambiguation. Examples: us, gb, ca, au. Every alpha-2 code is supported. |
city | string | City hint to prioritize local branches or regional brand variants. Free-form; standard names work best (e.g. San Francisco, New York). |
phone | number | Phone number from the transaction descriptor, when present, to help verify the brand match. |
high_confidence_only | boolean | When true, runs additional verification and returns 400 instead of a low-confidence match. Use for spend analytics, compliance, or expense flows. Defaults to false. |
force_language | string | Force the language of the retrieved brand data. |
maxSpeed | boolean | Skip time-consuming operations for a faster, less complete response. Defaults to false. |
timeoutMS | integer | Abort with a 408 if the request exceeds this many milliseconds. Min 1000, max 300000 (5 min). |
Response
| Field | Type | Description |
|---|---|---|
status | string | "ok" on success. |
code | integer | HTTP status code, echoed for convenience. |
brand.domain | string | Canonical merchant domain. |
brand.title | string | Clean company name. |
brand.description | string | One-paragraph company description. |
brand.slogan | string | Marketing tagline, when available. |
brand.colors[] | array | Brand colors ordered by visual prominence. Each has hex and a human-readable name. |
brand.logos[] | array | Logo variants: url, mode (light / dark / has_opaque_background), type (logo / icon), colors, and resolution.{width, height, aspect_ratio}. |
brand.socials[] | array | Social profile URLs. type is one of x, facebook, instagram, linkedin, youtube, tiktok, github, and 20+ more. |
brand.address | object | HQ address: street, city, state_province, state_code, country, country_code, postal_code. |
brand.stock | object | ticker and exchange for publicly traded merchants. null for private companies. |
brand.industries.eic[] | array | EIC industry tags with industry and subindustry. For NAICS / SIC codes, call /web/naics or /web/sic. |
brand.links | object | Non-social URLs: blog, pricing, careers, contact, privacy, terms, login, signup. |
brand.primary_language | string | Detected language of the merchant’s website (e.g. english, spanish). |
brand.is_nsfw | boolean | Safe-content flag. |
Handle errors
| Status | Meaning | What to do |
|---|---|---|
| 400 | The descriptor couldn’t be identified (no confident brand match), high_confidence_only blocked a low-confidence hit, or transaction_info is missing. | Fall back to a cleaned descriptor + an MCC-based category icon. Cache the miss for at least 24 hours so retries don’t burn credits. |
| 401 | Missing or invalid API key. | Re-check the env var and the dashboard. |
| 429 | Rate limit. | Back off exponentially. |
Use cases
- Personal finance apps: show actual company logos and clean names for every merchant and subscription.
- Reconcile employee expense reports automatically: match messy expense entries to clean company names, logos, and categories.
Next steps
Prefetch for Faster Response
Hide cold-hit latency from your users.
Handle Rate Limits
Backoff strategies, client cache, and prefetch fallbacks.
Best Practices
Caching, error handling, and key hygiene.
Troubleshooting
Status codes, retry patterns, and common errors.