Code generators
Last updated: February 1, 2024
Code generator custom fields can be used for a variety of purposes, most commonly gift certificates, memberships, and passes.
When tied to a campaign, a code generator will create one or more unique codes that will be sent to customers in their confirmation email. Customers can then enter their code when creating a booking, automatically applying a discount to their booking total.

See also:
Setup overview
This process may vary slightly depending on whether you’re setting up a gift certificate, season pass, etc. But generally, the setup process follows these steps:
Create customer type(s). For example, “Surf Lesson Gift Certificate” or “Season Pass”.
Create retail item with the above customer type(s). When a customer purchases this item, they will receive the generated code in their confirmation email.
Create campaign. The campaign is what tells the code generator what codes to create. See Automatically generated vs. pre-existing codes for more information about different code options. You can also add valid or blackout dates if needed.
Set up code generator:
Create code generator custom field. Create a new code generator custom field and enter an internal name (for example, “Bike Rental Gift Certificate” or “2019 Season Pass”). Don’t enter a title or description. You can leave the two checkboxes (“If priced…” and “Private”) unchecked.
Add campaign to code generator. Once you’ve created a code generator field, add the campaign you created in Step 1. See Options for generated codes for more details.
Set up code redemption field:
Create code redemption custom field. Create a new campaign code custom field and enter an internal name, title, and/or description. Even if the company already has a promo code redemption field, you may still need to create a new one using language specific to your code generator (for example, “Enter your Season Pass code below”).
Add campaign to code redemption field. Add the campaign you created in Step 1. This is what allows the redemption field to accept codes from that campaign.
Edit the pricing column as needed by selecting Adjust total by. Choose whether to adjust the total by a percentage or dollar amount, then enter the amount below (Note: discounts should always be entered as negative numbers).
Create retail item with the customer type(s) made above . When a customer purchases this item, they will receive the generated code in their confirmation email.
- Add code generator to retail item. Add the code generator field to each customer type on your retail item. This will create the generated code for the customer to redeem.
- The customer will then be able to enter their promo code to redeem their gift certificate, pass, discount, etc.
After these steps are completed, double check your work by going through the company’s online booking flow and ensuring that your code generator works as expected.
Automatically generated vs. pre-existing codes
When creating the campaign, choose whether the system should automatically generate unique codes or use a set of pre-existing codes. If the campaign runs indefinitely, you do not need to set an amount of generated codes. Instead, the system will automatically generate them as the gift certificate, pass, or discount is bought.
Automatically generated codes
If you want FareHarbor to automatically generate a unique code for every customer, you can choose to add a prefix (for example, “GC” for “Gift Certificate”) to help identify the campaign when looking at bookings and Custom Field Answers reports. Once you’ve created the campaign, proceed to Step 2.

Pre-existing codes
Once the campaign has been created, click Import or generate codes and paste in the list of codes, or enter them manually.
Important: When adding pre-existing codes, be sure to set each code’s maximum uses to 0. Codes must have 0 maximum uses in order for the code generator to recognize and properly generate them.

Options for generated codes
When adding your campaign to the code generator field, take note of the following options:
Number of times each generated code can be used: For gift certificates, this is usually 1. For season passes or memberships, you can either enter a limit or use valid and blackout dates instead.
Generate a code for each customer if on whole booking: If the code generator is added at the whole-booking level, it will create one code for the entire booking by default. Check this box if you want the code generator to create one code for each customer instead.
Use existing codes: Check this box if you want the code generator to use pre-existing codes instead of randomly-generated codes.
Instructions: If needed, add instructions for the end customer explaining how to use or redeem their code.

Additional notes
To view or edit a code generator field that has already been created, go to Settings > Custom Fields, view All custom fields, and
command+fto search for the field. Because they are less common, there’s no “code generator” section like there is for other custom field types.If an existing code is generated on a booking and that booking is cancelled, the code cannot be generated again.
Code generators do not generate new codes when rebooking.