create_code_discount_basic
Create a percentage or fixed amount discount code for customers at checkout. Target specific products or collections, set minimum subtotal or quantity, and define combination rules.
Instructions
Create an amount-off code discount (percentage or fixed) that customers apply at checkout. Supports product/collection targeting, minimum requirements, and combination rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Internal name shown in admin. | |
| code | Yes | Code customers enter at checkout (e.g. 'SAVE10'). | |
| startsAt | Yes | Activation date (ISO 8601). | |
| endsAt | No | Expiry date (ISO 8601). | |
| usageLimit | No | Max total redemptions. Omit for unlimited. | |
| appliesOncePerCustomer | No | Limit one use per customer. Default: false. | |
| discountType | Yes | Type of discount. | |
| discountValue | Yes | Percentage (0–100, e.g. 10 for 10%) or fixed dollar amount (e.g. 10). | |
| appliesOnEachItem | No | For fixed_amount: apply to each eligible item. Default: false. | |
| appliesToAll | No | Apply to all products. Default: true. | |
| productIds | No | GIDs of products to target (e.g. 'gid://shopify/Product/123'). | |
| collectionIds | No | GIDs of collections to target. | |
| variantIds | No | GIDs of product variants to target. | |
| minimumSubtotal | No | Minimum order subtotal required (e.g. 50 for $50). | |
| minimumQuantity | No | Minimum quantity of items required. | |
| combinesWith | No | Discount classes this discount can combine with. |