If you're looking for a solution to generate bulk coupon codes, this article will help you get there!
In this article:
Generate Bulk Coupons Using Postman
Step 2: Create a Coupon in Thinkific
Step 3: Find Your Coupon ID Using Postman
Step 4: Create Bulk Coupon Codes Using Postman
Important Considerations
- A coupon with your desired settings needs to be created before you can run bulk coupons
- Bulk coupons are randomly generated with a unique combination of letters and numbers; this cannot be customized to a preferred format
- While we're able to provide basic guidance with the public API, we're not able to provide support in terms of working with your API directly or Postman support as it is a third party application. We recommend reaching out to a developer if you are looking for creating custom solutions using the API. We have some wonderful freelance web developers on our Thinkific Experts page who you can reach out to if you need! There's also the Thinkific Store on Fiverr, for smaller, quicker jobs.
You can also learn more about our public API here: API (Application Programming Interface)
Creating coupons to sell your products in bulk? Check out our TCommerce: Group Orders feature that allows you to sell multiple seats for the same product using our built-in checkout!
Generate Bulk Coupons Using Postman
Step 1: Download Postman
Postman is a 3rd party app that will allow you to make calls to the Thinkific API. Download and Open Postman here: https://www.getpostman.com/
Step 2: Create a Coupon in Thinkific
In Thinkific, Create a Coupon with your desired settings. Your bulk coupons will eventually be added to and available in these coupon's settings.
Step 3: Find Your Coupon ID Using Postman
In order to create bulk coupons using Postman, we'll need to copy the coupon ID (also known as promotion ID). This step will walk you through that.
- In Postman, create a new Request, using the plus icon near the top of the screen:
- In the Request box at the top of the screen, select GET and paste the following: https://api.thinkific.com/api/public/v1/promotions
-
Then click the Headers menu and input X-Auth-API-Key and X-Auth-Subdomain under the Key column:
-
Go into your Thinkific site and make note of your Thinkific API key & subdomain:
1. See What is my API key?
2. See What is my Thinkific subdomain? -
In Postman, you'll input the following information in the Value column:
1. Thinkific API key for X-Auth-API-Key
2. Thinkific subdomain for X-Auth-Subdomain
- Click Send
- This API call will return a list of all coupons you have along with the IDs. You'll see this under Body.
- Scroll down to locate the name of your coupon and copy the promotion ID number that appears right above the coupon name. Copy and paste this in a separate text or document file that you can refer to in the next step.
What if I don't see my new coupon?
If you have created a lot of coupons and have more than 1 page in Thinkific, you might not see your newly created coupon in the list. If you need to view more results, add the following to the Params menu and Send again:
- In the Key column, add page in the first row and add limit in the second row
- In the Value column, add 1 in the first row and add 100 in the second row. "100" can be increased if needed.
What if I get an Authentication Error?
Make sure to double check the values you have added for your API key and subdomain. They should appear exactly as they appear within your Thinkific account.
Step 4: Create Bulk Coupon Codes Using Postman
- In Postman, create a new Request, using the plus icon near the top of the screen:
-
Select POST and Enter in the following in the Request URL: https://api.thinkific.com/api/public/v1/coupons/bulk_create?promotion_id=XXXXX
-
In the POST request, replace “XXXXX” with your promotion ID you copied in Step 3 above
-
Then click the Headers menu and input X-Auth-API-Key and X-Auth-Subdomain under the Key column:
-
Go into your Thinkific site and make note of your Thinkific API key & subdomain:
1. See What is my API key?
2. See What is my Thinkific subdomain? -
In Postman, you'll input the following information in the Value column:
1. Thinkific API key for X-Auth-API-Key
2. Thinkific subdomain for X-Auth-Subdomain
- In the POST request, click on Body and ensure you are in the form-data section
-
Input bulk_quantity_per_coupon & bulk_quantity under the Key column
-
Input desired coupon values:
-
bulk_quantity_per_coupon should be 1 if you want unique codes that can only be used once
-
bulk_quantity should be the number of coupons you want to create for this coupon ID
Note: bulk quantity has a maximum of 1000 at a time -
Here is an example for 300 unique coupons:
-
-
Then click Send
All Coupon codes will now appear in Thinkific under the original Coupon created!
Save Your Codes in a CSV
If you have a large quantity and you would like to create a CSV record of all codes, you can do the following:
- Copy the returned info from Postman (You can simply select all in the Response field)
- Go to http://jsonformatter.org/
- Paste your data into the left field
- Select Convert JSON to CSV
- Download the file. It will download as a .TXT file by default, but you may find it easier to change the extension to .CSV at this point
- Once your file is downloaded, open the CSV file in Excel, and convert the text to columns (Data -> Text to Columns)
- Grab the code column and you are all set!