{"id":15673933,"url":"https://github.com/cassidoo/generate-stripe-coupons","last_synced_at":"2026-03-04T14:31:28.676Z","repository":{"id":189815062,"uuid":"681360246","full_name":"cassidoo/generate-stripe-coupons","owner":"cassidoo","description":"A Python script for bulk-generating Stripe coupons and promotion codes","archived":false,"fork":false,"pushed_at":"2024-08-14T18:54:46.000Z","size":6,"stargazers_count":24,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-13T14:10:46.679Z","etag":null,"topics":["coupon","promotion","python","script","stripe"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cassidoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-21T21:02:06.000Z","updated_at":"2025-04-18T05:41:42.000Z","dependencies_parsed_at":"2023-08-21T22:26:38.411Z","dependency_job_id":"32dcf7ce-c219-493a-9822-5b43fb5f5487","html_url":"https://github.com/cassidoo/generate-stripe-coupons","commit_stats":null,"previous_names":["cassidoo/generate-stripe-coupons"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cassidoo/generate-stripe-coupons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassidoo%2Fgenerate-stripe-coupons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassidoo%2Fgenerate-stripe-coupons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassidoo%2Fgenerate-stripe-coupons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassidoo%2Fgenerate-stripe-coupons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cassidoo","download_url":"https://codeload.github.com/cassidoo/generate-stripe-coupons/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cassidoo%2Fgenerate-stripe-coupons/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30083741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coupon","promotion","python","script","stripe"],"created_at":"2024-10-03T15:43:07.807Z","updated_at":"2026-03-04T14:31:28.648Z","avatar_url":"https://github.com/cassidoo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate Stripe coupons + promo codes\n\nA small script to generate a Stripe coupon and promotion codes, and save them to a CSV file.\n\n**Thing I learned while making this that might be worth you knowing:**\nStripe coupons and promotion codes are _different things_. A coupon is what you see on _your_ end as a seller of a product, and a promotion code is what your users see. So, you can have a bunch of different promotion codes attached to one coupon, and each of those promotion codes gives you whatever value the coupon has.\n\nWhen I first made this repo, I just had it generate 1000 coupons and save it to a CSV, and now I know that I actually needed to make one coupon, with 1000 promo codes. If you actually want to bulk-generate coupons, you could go to the git history and find that script version. Good luck!\n\n## Running it\n\nTo run the script, follow these steps:\n\n1. Run `pip install stripe` in your terminal to install the Stripe library.\n2. Replace `\u003cYOUR_STRIPE_SECRET_KEY\u003e` in the script with your actual Stripe secret key. You can find your Stripe secret key in the Stripe dashboard. This is not your public-facing key!\n3. Replace `Unique Coupon` with the name of the coupon you want for each coupon. You can also edit the `amount_off` variable to however much off you want to offer (currently it's $20 off).\n4. Open a terminal or command prompt and navigate to the directory where this repo is cloned.\n5. Execute the script by running the command `python generate_coupons.py` in the terminal.\n6. Wait for the script to complete. It will create a coupon with 1000 unique promo codes and save them to a CSV file named `promotion_codes.csv` in the same directory as the script.\n7. After the script finishes running, you will see the output message `A total of X promo codes have been generated and saved to promotion_codes.csv`.\n\nMake sure you have appropriate permissions to read and write files in the directory where the script is located.\n\n_Note: Ensure that the Python version you are using is compatible with the `stripe` library._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcassidoo%2Fgenerate-stripe-coupons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcassidoo%2Fgenerate-stripe-coupons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcassidoo%2Fgenerate-stripe-coupons/lists"}