Merchant Category Codes (MCC) and Why a Purchase Did Not Earn Your Bonus
What an MCC is
Every merchant is assigned a four-digit merchant category code by its payment processor, describing the type of business (5411 for grocery stores, 5812 for restaurants, and so on). Your card reads that code to decide which rewards rate applies, so a card bonus on dining pays out only where the merchant codes as a restaurant.
Why a bonus sometimes misses
Surprises happen when the code does not match what you bought. A cafe inside a bookstore may code as the bookstore; a restaurant inside a hotel or casino may code as lodging; warehouse clubs and superstores like Walmart and Target code as discount stores, not supermarkets, so a grocery bonus does not apply. The reward always follows the MCC, not the item.
What you can do about it
You cannot change a merchant code, but you can plan around it: use a flat-rate card where category cards will not get the bonus, and learn which of your regular spots code unexpectedly. If a purchase clearly should have earned a bonus and did not, you can ask the issuer to review it. See warehouse clubs and how points work.