When a card transaction appears in an app already sorted into a category, the sorting usually came from a code assigned to the merchant rather than from analysis of the purchase.
Where the code comes from
A merchant category code is a four-digit number assigned when a business is onboarded by its acquiring bank, describing the type of business it operates.
The codes are defined by card network standards and are intended to be consistent across networks, though assignment practice varies between acquirers.
Once assigned, the code travels with every transaction the merchant submits, which is why it shapes so much downstream processing.
Why budgeting categories look wrong
Budgeting tools categorize transactions largely from this code, so a purchase is classified by what the merchant sells generally rather than by what was bought.
A large retailer selling groceries, clothing and electronics carries one code, so every purchase there lands in the same category regardless of contents.
Payment facilitators complicate it further, since transactions processed through an aggregator may carry the aggregator's code rather than the underlying seller's.
How rewards programs use it
Card rewards offering elevated earning on specific spending types determine eligibility from the code, not from the merchant's name or the items purchased.
This is why a purchase at a store that seems obviously to fit a category sometimes does not earn the bonus. The code assigned does not match the category definition.
Issuers publish which codes qualify, and disputes about missing bonus rewards usually resolve into a question about what code the merchant transmitted.
Where codes carry regulatory weight
Certain codes identify transaction types subject to restrictions, and issuers can block or treat differently transactions carrying those codes.
Cash advance treatment on some transactions is triggered this way, which is why particular purchases can carry a fee and immediate interest accrual.
Codes also feed reporting obligations for some payment types, giving them a role beyond commercial classification.
Why merchants sometimes dispute their code
The assigned code affects interchange rates, so a merchant coded into an expensive category pays more on every transaction than a correctly coded competitor.
Merchants can request review by their acquirer, though reassignment depends on the actual nature of the business rather than on preference.
The result is a classification system serving pricing, compliance and rewards simultaneously, none of which were designed with personal budgeting in mind.