You did everything right. You pulled out the card that earns an elevated rate on groceries, filled a cart with actual groceries, and paid. A few days later the transaction posted at the base rate, as if you'd bought a lawn chair. Nothing malfunctioned and nobody cheated you. You just met the merchant category code, the small piece of data that decides what almost every card purchase is worth. Once you understand how it works, most cashback disappointments stop being mysteries.
The store sends a code, and the code is everything
When a business sets up to accept cards, its payment processor assigns it a merchant category code, usually shortened to MCC. It's a four-digit number that describes the business as a whole: grocery store, gas station, restaurant, airline, hardware store, and so on. Every time you tap or swipe, that code travels with the transaction, and your card's rewards system uses it to decide which category the purchase belongs to.
Here's the part that catches people: the code describes the merchant, not the merchandise. Your card never sees your receipt. It doesn't know whether the bag holds bananas or batteries. It sees one store, one amount, one code. Buy a week of groceries at a merchant coded as general retail and the whole cart counts as general retail. Buy a pack of gum at a merchant coded as a grocery store and it earns grocery rewards. The shelf contents are invisible; the code is the whole story.
This is why two stores that look identical from the parking lot can pay out differently, and why the same cart of food can earn an elevated rate at one register and the base rate at another.
The usual suspects: where the code and the shelf disagree
A few situations account for most of the confusion.
Superstores that sell groceries. Big-box stores that stock food alongside clothing, electronics, and garden supplies are usually coded as discount stores or general merchandise, not as grocery stores. So a grocery card's elevated rate often doesn't apply there, no matter how much food is in the cart. Target is the classic example, which is why it gets its own entry in our directory: the right card there is often different from the right card at a supermarket.
Warehouse clubs. Wholesale clubs typically carry their own MCC, and many grocery cards exclude that code outright. Even the gas pumps at a warehouse club can run under the club's merchant setup rather than as a standalone gas station, so a card's gas category may or may not cover them. Terms vary by card, so check yours; our Costco page exists largely because of these quirks.
Pharmacies inside grocery stores. A pharmacy counter inside a supermarket usually processes payments under the supermarket's merchant account, so a prescription there often codes as groceries. Flip it around and the same is true: a gallon of milk bought at a drugstore chain typically codes as a drugstore purchase, not a grocery one.
Anything sold through someone else's register. Food courts inside big-box stores, coffee kiosks inside bookstores, and vendors running on another company's payment setup generally inherit the host's code. Where the money is processed matters more than what you bought.
How to check how a store actually coded
You don't have to guess. Your statement already tells you, if you know where to look.
Most card apps and online statements attach a category label to each transaction: something like Groceries, Gas, Dining, or Merchandise. That label is generated from the MCC. If your grocery run at a superstore shows up as Merchandise, that's the code talking, and the elevated grocery rate almost certainly didn't apply.
Some apps go further and show the rewards earned on each individual purchase. That's the most direct evidence there is. Before making a large purchase somewhere unfamiliar, it can be worth making a small one first and seeing how it posts.
Two cautions. First, coding can vary within a chain: one location, or the online store versus the physical one, may run under a different merchant account. Second, categories occasionally change when a merchant switches payment processors. What coded as grocery last year isn't guaranteed to code that way forever, so treat any single data point as strong evidence rather than a permanent rule.
Play the code, not the shelf
Once you accept that the code decides everything, your strategy gets simpler.
Buy bonus-category items where the code cooperates. If groceries are the goal, an actual supermarket usually codes as one, and that's where a grocery card earns its keep.
For stores that code as general retail, lean on a flat-rate card instead of hoping a category card comes through. If you're not sure which of those roles each card in your wallet plays, our comparison of flat-rate versus category cards walks through it.
And when a purchase posts in the wrong category despite everything, it's occasionally a genuine error. If a standalone supermarket posted as something else, a quick message to your card's support team sometimes gets it reviewed. There are no guarantees, but merchants do get miscoded, and issuers do fix real mistakes.
The store sets the code once. You choose a card every time you pay. That asymmetry is the whole game: learn how the places you shop are coded, then match the card to the code instead of the cart.