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, edit, and delete discount codes individually within the merchant portal.
Discount codes can also be managed in bulk, with the help of the Recharge support team. This guide walks you through the template files that you can use to create, edit or delete discounts in bulk.
Before you start
- Recharge performs bulk updates as a courtesy. If your business model requires frequent bulk discount imports, it is recommended that you use the Recharge API.
- The minimum number of discount codes required for a bulk update is 100.
- There are several unsupported features for the Import Shopify discounts tool. See Unsupported Shopify discount features for an overview of limitations.
Managing discount codes in bulk CSV Walkthrough
Bulk upload discount codes
The Recharge Support team can help you create, delete, 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 - Download the template file
If a copy of the template has not been sent to you by Recharge support, you can 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
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 |
code | Required | Unique discount code your customers will use | n/a | TEST10 |
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 - Send the file to Recharge
Once you have finished filling out the template file, send it to the Recharge support team to complete the bulk import.
Make sure to confirm the number of rows/discount codes contained in the file with the Recharge support agent.
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.
Remove a discount in bulk
For removal of a discount in bulk, you will need help from the Recharge Support team. Review the steps below to prepare your CSV file before submitting it for a bulk update. This action will delete the requested discount codes.
If you have 50 or more subscription products to update, the Recharge support team can facilitate a bulk update for you. You will need to prepare a CSV file with updated information and send it to the support team. Accommodate 5 business days to complete the update.
- In the merchant portal, go to Data and select Exports.
- Click Create export and select the Charges - Queued export from the drop-down.
- In the CSV, you can identify the discount by the discount_id column. Delete any rows of orders from the CSV which will not require the discount code to be removed. Rows not requiring an update should be also removed from the file.
- When finished, send the formatted CSV to the Recharge support team.
List of templates: