The Global Coupon Number or GCN is a unique identification key to identify a coupon worldwide. That number is encoded in a barcode, and printed on the discount voucher.
Coupon issuers register the coupon information in "My Coupon Manager". This includes, among others, the products to which the discount applies and how many of them must be purchased, but all other conditions too.
The coupon information is delivered to the supermarket by My Coupon Manager, who then forward this to their cash registers.
Products and coupons are scanned at the cash register. If the cash register also has the coupon information, it can autonomously check whether all conditions are met to automatically grant the discount.