discounts-and-promotions

Implement discount codes and promotional pricing with the Dodo Payments API.

6|1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/dodopayments/dodo-agent-plugin --skill discounts-and-promotions-dodopayments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: discounts-and-promotions
Source: https://github.com/dodopayments/dodo-agent-plugin/tree/main/plugins/dodopayments/skills/discounts-and-promotions
Command: npx skills add https://github.com/dodopayments/dodo-agent-plugin --skill discounts-and-promotions-dodopayments

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires dodopayments.

What problem does it solve? Managing discount codes, coupons, and promotional pricing in a payment integration involves subtle rules around eligibility, stacking, usage limits, and subscription plan changes that are easy to get wrong. This Skill provides correct, tested patterns for the full discount lifecycle in Dodo Payments so you avoid common pitfalls like accidentally clearing discounts during plan upgrades. ## Core Features & Use Cases - Discount CRUD Operations: Create, list, retrieve, update, and delete percentage or flat-amount discounts using the Dodo Payments SDK, including retrieval by human-readable code. - Eligibility and Restrictions: Configure product restrictions, customer-specific eligibility, date ranges, usage limits, and subscription-cycle limits. - Checkout and Plan-Change Handling: Apply and stack up to 20 codes at checkout, validate codes server-side before showing prices, and control discount preservation during subscription upgrades and downgrades. - Use Case: A SaaS team launching a summer campaign creates a 15% code restricted to premium plans, validates it server-side at checkout, and ensures it carries forward when customers upgrade their subscription. ## Quick Start Ask your agent to create a 15% discount code in Dodo Payments and apply it to a checkout session for a specific product.

Frequently Asked Questions about discounts-and-promotions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a discount code with the Dodo Payments API?

Call client.discounts.create with a type (percentage or flat), amount, and code. Percentage amounts use integers where 1500 means 15%, and flat amounts use the smallest currency unit such as cents for USD.

How do I apply multiple discount codes at checkout?

Pass an array of codes in the discount_codes parameter when creating a checkout session. Codes stack in the order specified, up to a maximum of 20 codes, though eligibility rules still apply to each code individually.

Does Dodo Payments support flat-amount discounts?

The OpenAPI schema defines both flat and percentage types with currency_options for flat amounts. However, feature documentation states only percentage discounts are currently supported, so verify flat discount availability with Dodo support for your account.

Why did my discount disappear after a subscription plan change?

Passing discount_codes as an empty array in subscriptions.changePlan explicitly removes all discounts. To preserve existing discounts, omit the parameter entirely and set preserve_on_plan_change to true on the discount itself.

How do I validate a discount code before showing adjusted prices?

Retrieve the code server-side with client.discounts.retrieveByCode, then check its expiration date, usage limit against times_used, and product restrictions. Never rely on client-side validation since users can modify codes in the browser.

What is the difference between subscription_cycles and expires_at for discounts?

subscription_cycles limits how many billing cycles a discount applies to on subscriptions, such as the first 3 months. expires_at is a hard calendar cutoff that applies to all uses of the code regardless of billing cycles.