Need to Access Full Gift Card Codes for Physical Gift Card Fulfillment

Hey @Selim_Gawad :waving_hand:, thanks for reaching out.

At the moment, we generally redact gift card codes after issuance, so it’s not easily possible retrieve the full code later via Admin, CSV export, REST, or GraphQL; only maskedCode and lastCharacters are exposed.

The main generally supported moment to capture the full code is at creation time using the Admin GraphQL giftCardCreate mutation, which returns a giftCardCode value once in the response.

Because of this, the recommended workflow is generally to keep your “Digital Gift Card” as a gift card product (Shopify auto-issues and emails), but make the “Physical Gift Card” a normal shippable product; when an order is paid, have an app issue the actual gift card via giftCardCreate, capture giftCardCode, and save it to an order or line item metafield for printing.

For example, when “Physical Gift Card – $100” is purchased, your app issues a $100 gift card, stores the returned code on the line item (e.g., a private metafield), and uses that value to print a sticker; you can optionally suppress sending the email so the first reveal is the mailed card.

For bulk printing, you could then query those metafields via the Admin GraphQL API or Bulk Operations to generate a CSV for your print run. Shopify POS also supports physical gift cards with pre-printed codes, and the online equivalent pattern is programmatic issuance at payment time so you can securely capture the code.

Does splitting the product (digital = gift card product, physical = normal product) work for you, or do you need them to remain variants of a single product?

Just wanted to confirm the above with you so I can suggest some more workarounds/solutions, but you should be able to add the write/read_gift_cards access scopes to your app to enable a decent workflow.

Hope this helps - let me know if I can clarify anything on our end :slight_smile: