I have seen this question several times and I will address it.
What happens if your purchase is rung up, the receipt printed, your signature (or PIN) given, then ID is demanded to "complete" the transaction? What happens if the store prevents you from leaving with your merchandise?
Legally, as soon as you have signed (or entered a PIN), the transaction has been completed. When the clerk rang up the total, and requested payment of a specific amount, they have formally made an offer to sell you the specified goods for the specified total, provided acceptable payment is tendered. Although certain statutory exceptions exist in some states, none apply to retail sales of common goods; the exceptions apply to things such as real estate, conveyances, etc.
Keep in mind that displaying a good and a price is not an offer to sell, but merely an invitation to treat, and a merchant may refuse to complete the transaction for whatever reason up to the point of payment acceptance, provided it does not run afoul of advertising laws. A merchant could choose to refuse a sale based on a specific combination of goods, a pricing error, or your insistence on paying in pennies, so long as payment has not yet been made.
As soon as you provide valid payment, the title to the goods passes to the buyer. An authorized credit or debit card, followed by the appropriate signature or PIN, constitutes valid payment, and a completed transaction. What makes it valid payment? Simple. The merchant has indicated through signage that certain cards are to be accepted. The merchant has also agreed to honor those cards and abide by processor rules, as have you. Both the merchant and you are party to the rules of the processing network.
What happens if the transaction is complete, ID is required, and you fail to produce it? Legally speaking, the goods are yours and you are free to leave the store. If the merchant attempts to take the goods and void the transaction, that may constitute theft. If the merchant attempts to detain you for trying to leave the store with your lawfully purchased goods, that may constitute false imprisonment. In either case, you should contact the police immediately to report the merchant's CRIME, as the goods are yours and you have the right to leave the store. Immediately afterword, report the violation and retain counsel to pursue a claim against the merchant.
(N.B. A defense of suspicion of theft asserted by the merchant against the above possible offenses would likely be invalid, so long as you politely refused the ID requirement without becoming belligerent, as the merchant's own signed merchant agreement disallows the requirement of ID checks, negating the argument that refusing an ID check is inherently suspicious and evidence of theft or fraud.)
Disclaimer: If you choose to call a horribly behaved merchant out on violations as described above, you should retain local counsel for further advice prior to attempting such a bold assertion of your property rights in the face of a violating merchant. This post is provided without warranty or assertion of fitness for a specific purpose, and does not constitute formal legal advice, nor do I assume any risk for providing it.
