-- Owner-scoped checkout idempotency needs a stable comparison even when the -- caller has already cleared their cart between requests. The full request -- hash covers the cart snapshot, which differs on an empty cart; the header -- hash is the same input minus the cart so a legitimate replay (cart cleared) -- still matches while a different currency/address/group intent is rejected -- as 409. Existing rows default to an empty header hash and continue to -- allow legacy replay until upgraded. ALTER TABLE checkout_requests ADD COLUMN header_hash TEXT NOT NULL DEFAULT '';