# Configure your store to use vouchers

Source: https://support.storeconnect.com/articles/configure-your-store-to-use-vouchers · Last modified 21 August 2026

To configure voucher settings in your store, you need:

-   Salesforce administrator or StoreConnect administrator access
-   Active StoreConnect store configuration
-   Voucher fields pre-configured for your store record layout

## Set up the voucher email template

You can have different email templates for different voucher products. Just set the relevant template on each different voucher product.

1.  Navigate to **Setup** > **Email Templates** in Salesforce.
2.  Locate your voucher email template or create a new one.
3.  Edit the template to include merge fields:
    -   -   {!Voucher\_\_c.Code\_\_c} for the voucher code
        -   {!Voucher\_\_c.Opening\_Balance\_\_c} for the value
        -   {!Voucher\_\_c.Expires\_At\_\_c} for expiry date
4.  We recommend also including instructions for voucher use, and a link to a page for checking the voucher balance, e.g. [https://your-store-domain.com/check-voucher](https://your-store-domain.com/check-voucher).
5.  Save and test the template.

## Configure store-level voucher settings

1.  Navigate to your **Store** record.
2.  Locate the voucher configuration section.
3.  Set **Voucher Expiry Unit** to either Month or Week.
4.  Enter a numeric value in **Voucher Expiry Length** (e.g. 12 for 12 months)
    **Note:** If both fields are set, automatically created vouchers will expire based on the configured timeframe from the creation date. Leave these fields blank if you don't want vouchers to expire.
5.  In the **Deliver Vouchers At Order Status** field, enter the API name of the Order Status that should trigger voucher creation (e.g. Activated).
6.  Click **Save.**

**Caution:** Ensure voucher orders are fully paid before changing them to the status that triggers voucher delivery.

## Advanced configuration for vouchers

The following are optional advanced tasks for customizing how vouchers work in your business. 

### Customize voucher codes

By default, StoreConnect generates 16-character alphanumeric codes (case-insensitive) providing 7.96 × 10²⁴ possible combinations. This provides strong protection against brute-force attempts to guess voucher codes.

**Voucher code security:** If you want to customize voucher codes, ensure you maintain a large code space to prevent voucher codes from being guessed. We recommend you only customize to achieve stronger code generation.

1.  Create an Apex class that implements the global interface IVoucherCodeGenerator.
2.  Implement the required method: String generate(Voucher\_\_c voucher).
3.  Ensure your code generates unique strings of 80 characters or less.
4.  Navigate to **Setup** > **Custom Metadata Types.**
5.  Open **StoreConnect Settings.**
6.  Enter your class name in the **Voucher Code Generator Class** field.
7.  Save and test voucher creation.

**Example code structure**

```apex

global class CustomVoucherCodeGenerator implements IVoucherCodeGenerator {

    global String generate(Voucher__c voucher) {

        // Your custom code generation logic

        // Must return a unique string <= 80 characters

    }

}
```

---

## Follow StoreConnect

- [Email Newsletter](https://getstoreconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://getstoreconnect.com/partners)
- [News](https://getstoreconnect.com/articles/news)
- [Events](https://getstoreconnect.com/articles/events)
- [Feature Comparison](https://getstoreconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://getstoreconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

---

StoreConnect Support — https://support.storeconnect.com/articles/configure-your-store-to-use-vouchers