This action creates a new discount code under an existing Shopify price rule.
| Name | Type | Description |
|---|
| Shopify Token | Credentials | A token with permissions to manage price rules and discount codes. |
| Shopify Domain | String | The store’s myshopify.com subdomain (e.g., your-store). |
| Price Rule ID | String | Identifier of the price rule in which to create the discount code. |
| Discount Code Name | String | The code value to assign to the new discount (e.g., WELCOME10). |
| Name | Type | Description |
|---|
| Success? | Boolean | true if the discount code was successfully created. |
| Discount Code | Object | The newly created discount code object returned by Shopify. |
- Uses Shopify Admin REST API version
2025-04 at /admin/api/2025-04/price_rules/{price_rule_id}/discount_codes.json.
- Ensure the access token includes
write_price_rules and write_discounts scopes.