ls_create_discount
Create discount codes for your Lemon Squeezy store. Supports percentage or fixed discounts, with duration, usage limits, and optional product restrictions.
Instructions
Create a new discount code. Supports percentage or fixed amount discounts with optional duration and usage limits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| storeId | Yes | The store ID to create the discount in | |
| name | Yes | Internal name for the discount | |
| code | Yes | The discount code customers will enter (e.g. 'SAVE20') | |
| amount | Yes | Discount amount — in cents for 'fixed' type (e.g. 1000 = $10.00), or percentage for 'percent' type (e.g. 20 = 20%) | |
| amountType | Yes | Discount type: 'percent' or 'fixed' | |
| duration | No | How long the discount applies: 'once' (first payment only), 'repeating' (for N months), or 'forever' (default) | |
| durationInMonths | No | Number of months the discount applies (required when duration is 'repeating') | |
| maxRedemptions | No | Maximum number of times this discount can be redeemed (0 = unlimited) | |
| startsAt | No | When the discount becomes active (ISO 8601 format) | |
| expiresAt | No | When the discount expires (ISO 8601 format) | |
| isLimitedToProducts | No | If true, the discount only applies to specific variants (set via variantIds) | |
| variantIds | No | Array of variant IDs this discount applies to (requires isLimitedToProducts: true) |