Skip to main content
Glama
PaddleHQ
by PaddleHQ

create_discount

Create discounts in Paddle to reduce transaction totals using flat amounts, percentages, or per-unit pricing. Generate codes for customer checkout or apply manually during sales.

Instructions

This tool will create a new discount in Paddle.

Discounts reduce a transaction total. They're sometimes called coupons or promo codes.

Use discount codes to let customers apply discounts themselves at checkout, or apply discounts manually to transactions as part of the sales process.

Discounts can be added to a discount group to organize them. Only one discount group can be added at a time. List discounts by discount groups with the list_discount_groups tool to see which discounts are in which groups.

When selecting type, choose the one that best describes how to apply the discount to the total:

  • flat: Discounts a checkout or transaction by a flat amount, for example -$100. Requires currencyCode.

  • flat_per_seat: Discounts a checkout or transaction by a flat amount per unit, for example -$100 per user. Requires currencyCode.

  • percentage: Discounts a checkout or transaction by a percentage of the total, for example -10%. Maximum 100%.

When selecting mode, choose the one that best describes the use case:

  • standard: Standard discount. Can be considered part of the listed catalog and reused across transactions and subscriptions easily.

  • custom: Non-catalog discount. Custom, one-off discounts. Includes checkout recovery discounts. Not returned when listing or shown in the Paddle dashboard.

Ensure you have all the information needed before making the call. Don't fabricate, imagine, or infer details and parameter values unless explicitly asked to. If anything is ambiguous, unknown, or unclear, ask the user for clarification or details before you proceed.

If successful, the response includes a copy of the new discount entity. Discounts can be applied to transactions, subscriptions, or passed to checkout through Paddle.js.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYesShort description for this discount. Not shown to customers.
enabledForCheckoutNoWhether this discount can be redeemed by customers at checkout (`true`) or not (`false`).
codeNoUnique code that customers can use to redeem this discount at checkout. Use letters and numbers only, up to 32 characters. Not case-sensitive. If omitted and `enabledForCheckout` is `true`, Paddle generates a random 10-character code.
typeYesType of discount. Determines how this discount impacts the checkout or transaction total.
modeNoDiscount mode. Standard discounts are considered part of the listed catalog and are shown in the Paddle dashboard.
amountYesAmount to discount by. For `percentage` discounts, must be an amount between `0.01` and `100`. For `flat` and `flat_per_seat` discounts, amount in the lowest denomination for a currency.
currencyCodeNoSupported three-letter ISO 4217 currency code. Required where discount type is `flat` or `flat_per_seat`.
recurNoWhether this discount applies for multiple subscription billing periods (`true`) or not (`false`). If omitted, defaults to `false`.
maximumRecurringIntervalsNoNumber of subscription billing periods that this discount recurs for. Requires `recur`. `null` if this discount recurs forever. Subscription renewals, mid-cycle changes, and one-time charges billed to a subscription aren't considered a redemption. `timesUsed` is not incremented in these cases.
usageLimitNoMaximum number of times this discount can be redeemed. This is an overall limit for this discount, rather than a per-customer limit. `null` if this discount can be redeemed an unlimited amount of times. Paddle counts a usage as a redemption on a checkout, transaction, or the initial application against a subscription. Transactions created for subscription renewals, mid-cycle changes, and one-time charges aren't considered a redemption.
restrictToNoProduct or price IDs that this discount is for. When including a product ID, all prices for that product can be discounted. `null` if this discount applies to all products and prices.
expiresAtNoRFC 3339 datetime string of when this discount expires. Discount can no longer be redeemed after this date has elapsed. `null` if this discount can be redeemed forever. Expired discounts can't be redeemed against transactions or checkouts, but can be applied when updating subscriptions.
customDataNoAny structured custom key-value data needed outside of Paddle's standard fields. Occasionally used by third-parties.

Implementation Reference

  • The handler function that implements the core logic of the 'create_discount' tool by calling the Paddle SDK's discounts.create method with the provided parameters.
    export const createDiscount = async (paddle: Paddle, params: z.infer<typeof Parameters.createDiscountParameters>) => { try { const discount = await paddle.discounts.create(params); return discount; } catch (error) { return error; } };
  • src/api.ts:67-67 (registration)
    Registration of the 'create_discount' tool method to its handler function (createDiscount) in the toolMap used by the PaddleAPI.
    [TOOL_METHODS.CREATE_DISCOUNT]: funcs.createDiscount,
  • Tool definition including schema (parameters), description, name, and required actions for 'create_discount'.
    { method: "create_discount", name: "Create a discount", description: prompts.createDiscountPrompt, parameters: params.createDiscountParameters, actions: { discounts: { write: true, create: true, }, },
  • src/constants.ts:59-59 (registration)
    Constant definition for the 'create_discount' tool method name.
    CREATE_DISCOUNT: "create_discount",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PaddleHQ/paddle-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server