Managing discount codes in bulk
Discount codes are a great way to reward customers for their loyalty or to encourage new customers to sign up. You can create, apply, remove discounts from addresses, and permanently delete discount codes individually within the merchant portal.
This guide walks you through the template files that you can use to manage discounts in bulk.
Before you start
- There are several unsupported features for the Import Shopify discounts tool. See Unsupported Shopify discount features for an overview of limitations.
Bulk manage discount codes
Create, delete, apply, or edit your discount codes in bulk. Keep in mind that only the following values can be updated in bulk:
- The start date and time for a discount code
- The end date and time for a discount code
- The status
- The usage limits
- The channel settings
Step 1 - Prepare a CSV file
Note: Bulk management tools have a max limit of 50,000 records. If you need to process more than 50,000 records, you must split the records into multiple CSV files and complete multiple bulk updates using the import tool.
You can use the Import tool to manage discounts in bulk by preparing a CSV file to manage discounts in bulk. Note that removing a discount code removes the discount code from a customer's record. Deleting a discount code removes the code entirely from Recharge. How you access the CSV template will differ depending on the update you are making:
CSV access instructions for applying, removing, or deleting discounts
- In the merchant portal, click Data and select Exports.
- Download the export that corresponds to the task you are bulk performing:
- Apply discounts - Charges - Queued
- Remove discounts - Charges - Queued
- Delete discounts - Discounts
- When the export has finished processing, download and open the export.
- Remove any charges from the export that you do not want to update discounts for.
CSV access instructions for creating a discount code
- In the merchant portal, click Data and select Bulk Updates.
- Click Import updates.
- Select Create discounts from the update type options and click Next.
- Click upload template to download Recharge's CSV template for creating a discount code.
Alternatively, download the template file directly:
- Bulk create discount codes - CSV template for bulk creating discount codes
- Bulk edit discount codes - CSV template for bulk editing discount codes
- Bulk delete discount codes - CSV template for bulk deleting discount codes
Save and export your updated file as a CSV file. The file must be in CSV format to use the bulk management tool.
Step 2 - Fill out the template file
The template contains a number of columns you will need to populate with information for the Recharge support team to create your discount codes.
Data required to create discount codes in bulk
Column heading |
Required/Optional |
Description |
Value option (choose one or leave blank if marked n/a) |
Example |
code | Required | Unique discount code your customers will use | n/a | Discount123 |
discount_type | Required | Type of discount | percentage, fixed_amount, shipping | fixed_amount |
value | Required |
Numerical value amount of the discount, excluding any currency symbols. If it is a shipping discount, the value needs to be 100% (ie. 100) |
n/a | 10 |
duration | Required |
Number of times a discount will be automatically re-applied to a new queued charge after its first usage on a successful charge. Values can be:
|
single_use, forever, usage_limit | usage_limit |
duration_usage_limit | Required only if duration column is set to usage_limit | Specific number of times a discount will be automatically re-applied to queued charges after its first usage on a successful charge. | n/a | 2 |
starts_at | Optional |
This is where you can set a specific start date. For example if you want to create a discount for a future sale. Date cannot be in the past. If left blank the start date will be the date the discount is created. |
Format must be YYYY-MM-DD |
2020/09/20 |
ends_at | Optional | This is where you can choose to automatically deactivate a discount code on a certain date. If left blank the discount will not expire. |
Format must be YYYY-MM-DD |
2020/09/20 |
status | Optional |
The status of the discount upon creation in the Recharge system.
If left blank, the status will default to enabled. |
enabled, disabled | enabled |
usage_limit | Optional |
Indicates how many times in total that the discount code can be used across all purchases on a store by all customers.
If left blank, the usage limit will default to unlimited. |
n/a | 1 |
applies_to_resource | Optional |
Determines if the discount code should apply to a specific product or collection.
If left blank, the discount code will default to apply to all products. |
shopify_product, shopify_collection_id | shopify_product |
applies_to_id | Required only if column applies_to_resource column is filled out. |
The specific product or collection the discount code should apply to.
If left blank, the discount code will default to apply to all products. |
n/a | 4668254158953 |
applies_to_product_type | Optional |
Determines if the discount code can be applied to all products, or subscription or one-time products only.
If left blank, the discount code will apply to both one-time and subscription products. |
ALL, ONETIME, SUBSCRIPTION | SUBSCRIPTION |
once_per_customer | Optional |
Sets whether an individual customer can use the discount once or multiple times. If set to True, the discount may only be applied once to each unique customer email address. Once applied, the discount will continue based on its duration. If blank, will default to False. |
TRUE,FALSE | TRUE |
prerequisite_subtotal_min
Note: Not available for the Shopify Checkout Integration.
|
Optional |
The total amount a customer must spend to be eligible to use the discount code. This can be used with a product or collection restriction.
The following requirements must be met to set a minimum purchase amount:
If left blank there will be no limit to using the discount code by default. |
Format must be a numerical value | 9.99 |
first_time_customer_restriction | Optional |
Limits the discount code to only be used by new customers.
If left blank the discount code will be available to all customers. |
n/a | customer_must_not_exist_in_recharge |
channel_settings |
Optional | If left blank, the discount code can be applied through all channels. | {"api": {"can_apply": true/false}, "checkout_page": {"can_apply": true}, "customer_portal": {"can_apply": false}, "merchant_portal": {"can_apply": false} }} | {"api": {"can_apply": false}} |
Data required to edit discount codes in bulk
Column heading |
Required/Optional |
Description |
Value option (choose one or leave blank if marked n/a) |
Example |
discount_id | Required |
When a discount code is applied to a charge, a unique string of numbers is attributed to the code being used. The discount ID identifies a specific discount code used on a single charge. |
Required | 12345678 |
starts_at | Optional |
This is where you can set a specific start date. For example if you want to create a discount for a future sale. Date cannot be in the past.
If left blank the start date will be the date the discount is created. |
Format must be YYYY-MM-DD |
2020/09/20 |
ends_at | Optional | This is where you can choose to automatically deactivate a discount code on a certain date. If left blank the discount will not expire. |
Format must be YYYY-MM-DD |
2020/09/20 |
status | Optional |
The status of the discount upon creation in the Recharge system.
If left blank, the status will default to enabled. |
enabled, disabled | enabled |
usage_limit | Optional |
Indicates how many times in total that the discount code can be used across all purchases on a store by all customers.
If left blank, the usage limit will default to unlimited. |
n/a | 1 |
channel_settings |
Optional | If left blank, the discount code can be applied through all channels. | {"api": {"can_apply": true/false}, "checkout_page": {"can_apply": true}, "customer_portal": {"can_apply": false}, "merchant_portal": {"can_apply": false} }} | {"api": {"can_apply": false}} |
Data required to delete discount codes in bulk
Column heading |
Required/Optional |
Description |
Example |
discount_id | Required |
When a discount code is applied to a charge, a unique string of numbers is attributed to the code being used. The discount ID identifies a specific discount code used on a single charge. |
12345678 |
Step 3 - Import the CSV file
After preparing the CSV file, you must import the file into the bulk management tool.
- From the merchant portal, click Data and select Bulk updates.
- Click the Import updates button.
- Select Create discounts from the dropdown menu and click Next.
- Upload the prepared CSV file and click Next.
- Confirm the details of your update and select Validate your file. The validation process may take some time to complete, depending on the size of the file. Once the process is completed, you will receive a confirmation email.
Step 4 - Perform the bulk update
Once your file is validated, you can perform the bulk update.
- In the merchant portal, click Data and select Bulk updates to view your validated files.
- Click Process update to begin the bulk update.
- On the pop-up modal, click Update subscription(s) to confirm the bulk update.
- Once the update is done, the Processing status will be marked Complete and the Results will display the number of charges updated.
- From the merchant portal, select Customers and open a customer's profile.
- Confirm the correct discount code has been updated as expected.
Create discount codes in bulk using the Recharge API
You may want to consider using the Recharge API to create discount codes in bulk in Recharge.
Depending on your ecommerce platform, you could also automate the sync of discounts by creating a cron job that will query the API discounts endpoint and look for a specific timeframe.
If new discounts were created and the condition in the above query is satisfied, redirect key elements of those discounts and replicate them into your ecommerce platform, or Recharge.
Bulk import discounts from Shopify to Recharge
With the Shopify Discount Import feature, merchants can import supported discount codes created in Shopify to Recharge, up to a maximum of 500,000 discount codes at a time.
See Using the Shopify Discount Import feature to learn how you can opt-in to use this beta feature, unsupported discount types, and how to import your discount codes once the feature is enabled.
Bulk adding and removing discounts from subscriptions
Review Applying and removing discounts to adjust discounts on subscriber accounts.