This tool is designed to generate and manage discount codes for Shopify stores. It allows you to create new discount codes, top up existing ones, and export them for use in marketing campaigns.
- Generate unique discount codes with a specified prefix.
- Top up existing discount codes for multiple Shopify stores.
- Export discount codes to a CSV file for easy integration with marketing platforms like Klaviyo.
- Clone the repository:
git clone git@github.com:SuavecitoInc/multi-store-discount-code-generator.git cd multi-store-discount-code-generator - Install dependencies:
npm install
- Create your Shopify app in the Shopify Dev Dashboard
- Create App > Start From Dev Dashboard
- Install the app on all stores you want to generate discount codes for
- Set up your
config/shopify.jsonfile with your store handles and collection ids (used for generating discount codes):{ "stores": [ { "domain": "store-1", "collectionId": "your_store1_collection_id" } ] } - Set up your environment variables in a
.envfile:CLIENT_ID=your_app_client_id CLIENT_SECRET=your_app_client_secret
- Run the setup tool to generate the necessary config files (
admin.jsonanddiscount-config.json):If required run this command to stop the config files from being tracked.npm run setup
git update-index --skip-worktree config/admin.json config/discounts.json
- Run the tool to generate new discount codes:
npm run create
- Run the tool to top up discount codes:
npm run top-up