Find transactions using GIft Card

Hello, is there a way to find order transaction that were paid in whole or in part using a gift card? That is, a specific gift card GAN, not just with a payment type of SQUARE_GIFT_CARD. I want to give my users an audit trail of their issued GCs - so I want to show a list of orders where a GAN was used.

In the payment response there is the card in card_details.

"card": {
                    "card_brand": "SQUARE_GIFT_CARD",
                    "last_4": "3231",
                    "exp_month": 12,
                    "exp_year": 2099,
                    "fingerprint": "sq-1-KdMZ4i3S3SAobUMyUEW1ltygrm7bK7VDe4qIyo_z7zfJOC45_vt1T-oAVjxnv7g-SA",
                    "card_type": "DEBIT",
                    "prepaid_type": "PREPAID",
                    "bin": "778332"

In the card object theirs details about the card like last_4. You can use that to identify the card and then pull all the order_ids from the payment to get the order details with the Orders API. :slightly_smiling_face: