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

Hi everyone,

I’m working with a client who wants to sell two types of gift cards:

  1. Electronic Gift Cards – standard Shopify gift cards, sent via email with the usual gift card number, optional message, and the ability to schedule delivery for a future date.
  2. Physical Gift Cards – for an additional $10, customers can provide their shipping address, and we’ll mail them a plastic gift card with the same code printed on it so they can gift it in person.

We’ve set this up using product variants — one for the digital version, and one for the physical version (with the added cost and shipping). The online sales flow works fine.

The problem:

Once the order is placed, we need to print the actual gift card number on the physical card before shipping it. However, in Shopify Admin, we can only see the last 4 digits of the code, the rest is hidden for security. Exporting gift card data also shows only the last 4 digits.

Our goal is to be able to:

  • Generate the codes via Shopify’s normal purchase flow
  • Access the full codes after purchase
  • Export them in bulk so we can print them on stickers and attach them to pre-designed plastic gift cards for shipping
  • Avoid manually writing codes or maintaining a separate code file outside Shopify

My questions:

  • Is there any way to retrieve the full gift card codes from Shopify after they are issued?
  • Can this be done through the Shopify API (Admin API / GraphQL / REST)?
  • Is there an approved workflow for businesses that need to issue physical cards tied to Shopify’s gift card system?

I’ve searched the forum but haven’t found any discussion that addresses this exact use case. Any guidance from the Shopify team or other developers would be greatly appreciated.

Thanks in advance!

1 Like

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: