Re is out: see what's new Lifetime updates on every purchase Support replies within 24 hours Secure checkout via Gumroad 8,500+ sales since 2016

Purchase code

Updated 4 min read 2 views

The Purchase code field checks a purchase code with the store it was bought in before the form is sent. Use it on a support form: only buyers get through, and the mail shows what they bought and how long their support lasts.

The field comes with a store add-on: ThemeForest, Gumroad, Lemon Squeezy, Paddle or Freemius. With several, one field takes codes of each, and asks only the stores that are set up. Without a store add-on the field isn’t there.

Add it to a form

  1. Set up the store in Contact Form → Settings → Purchase codes.
  2. Open a form and pick Purchase code in the More menu after the field buttons.
  3. Click the chip and choose its settings in the sidebar.

The code is checked when the form is sent. A code that looks like no store’s, or that the store doesn’t know, is turned away with a message under the field.

Settings

SettingWhat it does
PlaceholderA hint shown in the empty field, such as xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Codes fromAny store set up, or one store. With any store, a code is checked with each store it could be from.
ThemeForest itemsWith the ThemeForest add-on: pick the items whose codes get through. Empty: any of your items.
Gumroad productsWith the Gumroad add-on: the product IDs to check a key with, separated by commas.
Lemon Squeezy productsWith the Lemon Squeezy add-on: pick the products whose keys get through. Empty: any of your products.
Paddle productsWith the Paddle add-on: pick the products whose orders get through. Empty: any of your products.
Freemius plansWith the Freemius add-on: pick the plans whose licenses get through. Empty: any plan.
Support overA real purchase whose support has ended: Turn it away (default) or Let it through, with the mail saying so.
Store can’t be reachedWhen the store doesn’t answer: Let it through (default), with the mail saying the code wasn’t checked, or Turn it away.

Required, style, class, ID and custom attributes work as on any field.

In the mail

[your-field] prints the code. These tags print what the store said about it:

TagPrints
[_purchase_status]valid, support expired, invalid or not verified
[_purchase_store]ThemeForest, Gumroad, Lemon Squeezy, Paddle or Freemius
[_purchase_item]The item’s name
[_purchase_item_id]Its ID in the store
[_purchase_license]Regular License, a Gumroad tier and so on
[_purchase_buyer]The buyer’s username (ThemeForest) or email (the others)
[_purchase_bought]The purchase date, such as 2026-05-01
[_purchase_supported_until]The last day of support, such as 2027-05-01; empty when it has no end
[_purchase_support]The same in words: support until May 1, 2027 (174 days left)
[_purchase_summary]All of it on one line

The tags read the form’s first Purchase code field that was filled in. The entry gets the same on one line, and webhooks get it as JSON under purchase.

Messages

The form’s Messages tab lists four messages for this field, ready to change: not a code, not found, support over, and store can’t be reached.

Good to know

  • A store’s answer is kept for an hour, so a visitor sending twice doesn’t ask the store twice. “Can’t be reached” isn’t kept.
  • The code goes to the store’s API only, from your server. Mention it in your privacy policy.

For developers

  • remaily_purchase_code_stores adds a store: a class that extends VLT\RemailyPurchaseCodes\Store.
  • remaily_purchase_code_field ( $field, $code, $submission ) changes the field’s settings for one code, such as the Gumroad product picked in another field.
  • remaily_purchase_code_result ( $result, $code, $field, $submission ) changes the answer, such as for keys you gave by hand. Its status is valid, expired, invalid, unverified or format.
Was this article helpful?