Gift cards guide
How to export gift card codes from Shopify
Shopify hides gift card codes after creation and only shows the last four digits. Here is what that means, and how to keep a full, exportable list of every code you issue.
The one-way door
Gift card codes on Shopify are a one-way door. The full code exists in the API response at creation and nowhere else afterwards. Shopify admin shows ••••4821. The Admin API returns lastCharacters: "4821". There is no flag, no permission, and no support escalation that returns the rest.
Most merchants discover this the first time a customer emails saying they deleted the gift card email.
What that means in practice
For single cards created by hand, it is survivable. You created one card, you emailed it, the customer has it.
For batches it is a real operational problem. If you created 400 codes for a print run and never exported them, you now have 400 cards with money on them and no way to know which code goes with which physical card.
What to do about it
Create with something that keeps the codes. Bulk Gift Cards stores every code at the moment it creates the card, then gives you three ways to get at them:
- Search by partial code, customer email, or the note you set on the batch. Search is dash and case tolerant, so
4K2Pfindswnwn-4k2p-9911. - Reveal an individual full code from history when a customer asks you to resend.
- Export the whole batch as CSV: code, amount, currency, email, note.
Do the export the day you create the batch. The cost is thirty seconds and the alternative is unrecoverable.
The reissue procedure, for when it is already too late
- Find the card by its last four characters in Shopify admin.
- Note the remaining balance.
- Disable the card so the old code cannot be spent.
- Create a replacement card for the remaining balance and send it to the customer.
That works for one customer. It does not scale to a batch, which is the whole argument for exporting up front.
Frequently asked questions
Can I export gift card codes from Shopify admin?
No. Shopify admin has no gift card code export and shows only the last four characters of each code after creation. The gift card export available in some contexts contains balances and metadata, not full codes.
Can Shopify support recover a lost gift card code?
No. Shopify does not store the code in a retrievable form. If neither you nor your customer has the code, the practical fix is to check the card's remaining balance by last four characters, disable it, and issue a replacement card for the same amount.
Why does Shopify hide gift card codes?
A gift card code is a bearer instrument. Anyone holding the code can spend the balance. Masking codes after creation limits the damage from a compromised admin account or a leaked export, which is the same reason payment processors mask card numbers.
What if I already created cards without capturing the codes?
Those codes are not recoverable. If the cards were emailed to customers, the customers have them. If they were not, disable the cards and reissue, capturing codes this time.
Keep reading
More guides you might need.
6 min read
How to create gift cards in bulk on Shopify
Shopify admin creates gift cards one at a time. Here is how to create hundreds at once from a CSV, keep every code, and avoid the mistakes that make codes unrecoverable.
5 min read
How to fulfil a corporate bulk gift card order on Shopify
A company wants 500 gift cards at $50 each. Here is the whole workflow on Shopify, from quote to code delivery, without creating 500 cards by hand.
6 min read
How to import existing gift cards into Shopify
Moving to Shopify from Square, Toast, Lightspeed or Clover? Here is how to import existing gift card codes and balances so your customers' old cards still work on day one.
5 min read
How to issue Shopify gift cards in multiple currencies
Shopify gift cards default to your store currency, which quietly punishes international customers. Here is how to issue cards denominated in the currency each customer actually shops in.
Need help with this on your store?
We build free Shopify apps for the simple stuff. Browse the full set.