Create Discount
discount_createCreates a Plan Builder discount. Requires name, status, type
(percentage or fixed_amount), value, duration (forever or
limited with duration_interval_count billing cycles) and
availability (all stores or specific ones in
specific_shop_domains). A code discount needs code (unique per
app, stored uppercase): it applies when a merchant types it at
subscribe. With auto_apply: true it has no code and applies by
itself to every matching new subscription, so creating it active
REQUIRES confirm: true. Optional plan_ids restricts it to plans
(empty: every plan), max_redemptions caps its uses, description.
Subscriptions keep a discount they got after it is deactivated. Takes
the app_id returned by apps_list. Returns the same shape as
discount_get.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"app_id": "<app_id>",
"name": "<name>",
"status": "<status>",
"type": "<type>",
"value": "<value>",
"duration": "<duration>",
"availability": "<availability>"
},
"name": "discount_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | The code merchants type, stored uppercase and unique per app. Required unless `auto_apply` is true; an automatic discount has no code. | |
| name | Yes | Internal name of the discount. | |
| type | Yes | `percentage` off the plan price, or a `fixed_amount` in USD. | |
| value | Yes | The percentage (0.01 to 100) or the USD amount (min 0.01). | |
| app_id | Yes | The app uuid returned by `apps_list`. | |
| status | Yes | `active` applies it from now on; `inactive` keeps it off. Deactivate a discount with `inactive`. | |
| confirm | No | Must be `true` when the write leaves an automatic discount active (anything beyond its name or description). Ignored otherwise. | |
| duration | Yes | `forever`, or `limited` to a number of billing cycles. | |
| plan_ids | No | Plan uuids (`plan_id` from `plans_list`) the discount is restricted to. Empty or omitted: every plan. | |
| auto_apply | No | True for an automatic discount: applied to every matching new subscription without a code. Writing an active automatic discount requires `confirm: true`. | |
| description | No | Optional description. | |
| availability | Yes | `all` stores, or `specific` stores listed in `specific_shop_domains`. | |
| max_redemptions | No | How many subscriptions may use it in total (min 1). Null: no limit. | |
| organization_id | No | An organisation uuid or slug. When supplied, `app_id` is resolved within that organisation and may be a slug instead of a uuid, mirroring the Meridian web app. | |
| specific_shop_domains | No | The *.myshopify.com domains allowed when `availability` is `specific`. | |
| duration_interval_count | No | Billing cycles the discount lasts. Required when `duration` is `limited`. |