In Mexico, an invoice only exists once a certified provider (PAC) has stamped it and sent it to the SAT. That means the SAT holds every CFDI, and the issuer and the receiver can both get the XML back from it. That is what Mexicans call the descarga masiva.
From the SAT portal
On the SAT's Consulta y recuperación de comprobantes page, sign in with your e.firma or your contraseña and choose received invoices. Search by date range or by folio fiscal and download the XML files of the results. The SAT's documentation sets limits: up to 2,000 XML files a day, up to 1,000,000 metadata records per query, and up to five years of history plus the current year.
With the web service
For volume, accounting software uses the mass download web service. It needs a valid e.firma, and only the issuer or the receiver of a CFDI can request it. The flow has four steps: authenticate, submit a request for a period, check its status, and download the packages. The SAT can take up to 48 hours to prepare them, and repeating a request with the same parameters is limited.
Checking one CFDI
To confirm a single invoice is valid, the SAT's CFDI verification page takes the folio fiscal (UUID), the issuer's and receiver's RFC and the total, and returns whether the invoice is active or cancelled.
Why store tickets are not in the list
A ticket from a store or restaurant is not a CFDI issued to you. The seller adds it to a global invoice to the general public (RFC XAXX010101000), which you cannot download. To deduct the purchase, request the invoice on the seller's invoicing portal with the ticket's data, within the period it allows. From then on it is a CFDI in your name, and the mass download picks it up.
Keeping the tickets too
Until a ticket is invoiced, the paper is all you have. Photograph it in the Smartbills app, or forward the email from an online store, and it is kept with its items, taxes and total, so nothing is lost before it is invoiced.