# Apply Voucher Form - Liquid Form Reference

Source: https://support.storeconnect.com/articles/apply-voucher-form-reference · Last modified 21 August 2026

## Usage


```liquid

{% form "apply-voucher" %}
  <!-- Form fields here -->
{% endform %}
```


| Property | Value |
|----------|-------|
| **Form Name** | `apply-voucher` |
| **Category** | Checkout |

## Form fields

| Field name | Type | Required | Description |
|------------|------|----------|-------------|
| `code` | Text input | Yes | The voucher code to apply. |
| `pin` | Text input | No | The PIN for a PIN-protected voucher. If the voucher has a PIN and this field is omitted or incorrect, the form will return a validation error and the voucher will not be applied. |

## Form Object

Inside the form block, you can access the `form` object which provides:

- `form.errors` — Any validation errors after submission

## PIN-protected vouchers

If a customer submits a voucher code that requires a PIN, the `applied_voucher.state` will be `requires_pin`. Re-render the form with a `pin` input to let the customer complete the redemption. If the wrong PIN is entered, `state` will be `invalid_pin`.


```liquid

{% form "apply-voucher" %}
  <input type="text" name="code" value="{{ applied_voucher.code }}">
  {% if applied_voucher.state == "requires_pin" or applied_voucher.state == "invalid_pin" %}
    <input type="text" name="pin" placeholder="Enter PIN">
    {% if applied_voucher.state == "invalid_pin" %}
      <p>Incorrect PIN. Please try again.</p>
    {% endif %}
  {% endif %}
  <button type="submit">Apply</button>
{% endform %}
```

---

## 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/apply-voucher-form-reference