Using Custom Code Prefixes
By the end of this guide, you'll know how to add custom prefixes to your gift card codes for branding and organization.
What code prefixes are
A code prefix is a custom string added to the beginning of every gift card code in a batch. For example, if you set the prefix SPRING, your codes might look like SPRING7K2M9QX4RB.
Prefixes help you:
- Brand your codes — recipients see a recognizable name when they use the code
- Organize batches — quickly identify which campaign or event a code belongs to
- Track sources — filter and search gift cards by prefix in your Shopify admin
Set a prefix during batch creation
- Open BatchCard. In the Create gift cards card, click Create batch under Manual.
- Fill in the batch details (name, quantity, value).
- Enter your code prefix in the prefix field.
- Click Create.
Every gift card in the batch will use this prefix.
Set a prefix via spreadsheet import
If you're importing from a spreadsheet, add a code_prefix column to your file. Each row can have a different prefix.
| value | quantity | code_prefix |
|---|---|---|
| 25.00 | 10 | SPRING |
| 50.00 | 5 | VIP |
Prefix format rules
| Rule | Detail |
|---|---|
| Length | No minimum. A one-character prefix is accepted, and so is no prefix at all |
| Room in the code | The prefix and suffix together must leave at least 8 random characters |
| Characters | Letters (A-Z) and numbers (0-9) only |
| Case | Prefixes are converted to uppercase |
| Uniqueness | Multiple batches can use the same prefix |
There is no maximum prefix length on its own. Every code keeps at least 8 random characters so codes stay unique, and the prefix and suffix share whatever room is left.
On the manual form, codes are 16 characters by default, so the prefix and suffix can take up to 8 characters between them. Set Total Code Length to 20, the longest code Shopify accepts, and that budget grows to 12.
On a spreadsheet import you do not set a code length. BatchCard grows the code to fit the prefix and suffix in the row, up to 20 characters, so a combined prefix and suffix of up to 12 characters is accepted there. See the Code Prefix column reference.
Keep prefixes short and meaningful. Good examples: SPRING, VIP2026, REWARD, HOLIDAY. Avoid using special characters or spaces.
Examples of good prefixes
| Use case | Prefix | Why it works |
|---|---|---|
| Seasonal promotion | SPRING | Short, clear, identifies the campaign |
| Employee rewards | REWARD | Easy to filter when reviewing gift cards |
| VIP customers | VIP2026 | Includes the year for easy tracking |
| Partner campaign | ACME | Identifies the partner company |
What happens without a prefix
If you don't set a prefix, Shopify generates codes with its default format. The codes still work the same way. Prefixes are purely organizational.
Learn more
- Custom code features — full overview of code customization
- Creating gift cards — complete batch creation walkthrough
Ready to try this? Install BatchCard free.
Create bulk gift cards from a CSV or form. Set up your first batch in minutes.
Install Free on Shopify