Discount code created
The Discount code created trigger starts a workflow when a discount code is created by you or by a third-party app in your store.
On this page
Data provided by the Discount code created trigger
The following data is provided to workflows that start with the Discount code created trigger.
| Data | Description |
|---|---|
discount code | The discount code that was created. Allows accessing data on the GraphQL Admin API DiscountCodeNode object |
Actions
This trigger provides a discount code, which lets you use any action that requires a discount code or discount information.
Because discount codes relate to orders and customers, the trigger can also be used with actions that require orders and customers, such as:
Discount codes also contain lists of data such as usage restrictions and discount applications. You can loop through these lists and perform actions on each item by using a For each action.
Testing the trigger
To test an active workflow that starts with this trigger, you can:
- Create a discount code in the Shopify admin.
- Use a third-party app to create a discount code using the Admin API.
API details
The Discount code created trigger allows actions to be taken with the DiscountCodeNode GraphQL API object. This trigger corresponds to the discounts/create webhook with filtering for discount codes.
Related triggers
For other discount-related workflows, you might also consider:
- Automatic discount created - starts when an automatic discount is created.
- Order created - starts when an order is placed (useful for discount application workflows).