---
title: "Discount triggers, step by step"
description: "Step-by-step Shopify Flow tutorials for the discount lifecycle: created, updated, deleted, expired, code added and code removed."
canonical: "https://docs.workflow-trigger-extensions.app/discount-trigger-tutorials"
---

# Discount triggers, step by step

Six triggers for the whole life of a discount: created, updated, deleted, a code added, a code removed, and **expired** - which Shopify never reports at all.

**On this page:** [Discount Created](#discount-created), [Discount Updated](#discount-updated), [Discount Deleted](#discount-deleted), [Discount Expired](#discount-expired), [Discount Code Added](#discount-code-added), [Discount Code Removed](#discount-code-removed)

> [!TIP]
> **New to Shopify Flow?**
> Every example follows the same five moves: pick the trigger, add a condition, add an action, turn the workflow on, check Event History. [Your first workflow, step by step](https://docs.workflow-trigger-extensions.app/first-workflow-tutorial.md) shows each of them with screenshots.

![Shopify Flow's trigger picker inside Workflow Trigger Extensions, searched for Discount](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/021f62ae742afdba.png)
*Where you find them: in Shopify Flow choose Select a trigger, open Workflow Trigger Extensions and search for "Discount".*

## Discount Created

Fires when a discount is created, automatic or code based, by staff or by an app.

| | |
| --- | --- |
| **Fires from** | Shopify webhook |
| **Permission** | **Discount Data Access** |
| **Switched on** | Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's **Triggers** page |

**Use it for**

- Announce new promotions to support, so nobody is surprised by a code.
- Audit discounts created by apps or by staff without approval.

### What Discount Created sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discount` | Object | The created discount |
| `discount.id` | ID | The Shopify GID of the discount |
| `discount.title` | Text | The title of the discount |
| `discount.status` | Text | The status of the discount (ACTIVE, EXPIRED, SCHEDULED) |
| `discount.createdAt` | Text | When the discount was created |
| `discount.updatedAt` | Text | When the discount was last updated |
| `discount.startsAt` | Text | When the discount becomes active |
| `discount.endsAt` | Text | When the discount expires |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Announce every new discount in Slack

1. Pick **Discount Created** as the trigger.
2. Add **Send HTTP request** to a Slack webhook: `New discount "{{discount.title}}" ({{discount.status}}), runs {{discount.startsAt}} to {{discount.endsAt}}`.
3. Turn the workflow on.

> [!NOTE]
> **Good to know**
> `endsAt` is empty for a discount with no end date.

## Discount Updated

Fires when a discount is edited: title, value, dates, eligibility, status.

| | |
| --- | --- |
| **Fires from** | Shopify webhook |
| **Permission** | **Discount Data Access** |
| **Switched on** | Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's **Triggers** page |

**Use it for**

- Review changes to running promotions.
- Re-sync promotion data to a storefront banner or an email tool.

### What Discount Updated sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discount` | Object | The updated discount |
| `discount.id` | ID | The Shopify GID of the discount |
| `discount.title` | Text | The title of the discount |
| `discount.status` | Text | The status of the discount (ACTIVE, EXPIRED, SCHEDULED) |
| `discount.createdAt` | Text | When the discount was created |
| `discount.updatedAt` | Text | When the discount was last updated |
| `discount.startsAt` | Text | When the discount becomes active |
| `discount.endsAt` | Text | When the discount expires |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Review edits to active discounts

1. Pick **Discount Updated** as the trigger.
2. Add a **Condition**: `discount.status` **Equal to** `ACTIVE`.
3. Add **Send internal email** with `{{discount.title}}` and the discount's admin link.
4. Turn the workflow on.

> [!NOTE]
> **Good to know**
> Apps that manage promotions can edit a discount often. If the volume surprises you, switch this one off on the Triggers page and rely on the more specific ones.

## Discount Deleted

Fires when a discount is deleted. Only the id and the time are left to report.

| | |
| --- | --- |
| **Fires from** | Shopify webhook |
| **Permission** | **Discount Data Access** |
| **Switched on** | Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's **Triggers** page |

**Use it for**

- Remove a deleted promotion from banners, feeds or an email tool.

### What Discount Deleted sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discountId` | Text | The Shopify GID of the discount |
| `deletedAt` | Text | The timestamp when the discount was deleted |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Clean up after a deleted discount

1. Pick **Discount Deleted** as the trigger.
2. Add **Send HTTP request** to the system that mirrors your promotions, with `{{discountId}}` and `{{deletedAt}}`.
3. Turn the workflow on.

> [!NOTE]
> **Good to know**
> A deleted discount cannot be looked up any more, so store the title on your side when it is created if you need it later.

## Discount Expired

Fires when a discount passes its end date. Shopify sends nothing at that moment, so the app checks on a schedule and fires once per expired discount.

| | |
| --- | --- |
| **Fires from** | Checked on a schedule, because Shopify sends no webhook for it |
| **Permission** | **Discount Data Access** |
| **Switched on** | Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's **Triggers** page |

**Use it for**

- Take a promotion banner down when its code stops working.
- Tell support that a campaign ended.
- Start the follow-up campaign.

### What Discount Expired sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discount` | Object | The expired discount |
| `discount.id` | ID | The Shopify GID of the discount |
| `discount.title` | Text | The title of the discount |
| `discount.status` | Text | The status of the discount |
| `discount.endsAt` | Text | When the discount expired |
| `discount.startsAt` | Text | When the discount became active |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Take the promo banner down when the code expires

1. Pick **Discount Expired** as the trigger.
2. Add **Update shop metafield** (or **Send Admin API request**) that clears the metafield your theme reads the banner from.
3. Add **Send internal email**: `{{discount.title}} expired at {{discount.endsAt}}`.
4. Turn the workflow on. To test, create a discount whose end time is a few minutes away.

> [!NOTE]
> **Good to know**
> - It is a polling trigger: expect the event shortly after the end time, not to the second.
> - A discount that is deactivated by hand is an update, not an expiry.

## Discount Code Added

Fires when a redeem code is added to a code discount, including codes generated in bulk.

| | |
| --- | --- |
| **Fires from** | Shopify webhook |
| **Permission** | **Discount Data Access** |
| **Switched on** | Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's **Triggers** page |

**Use it for**

- Register new codes with an affiliate or influencer tool.
- Audit who adds codes to a running campaign.

### What Discount Code Added sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discount` | Object | The discount the code was added to |
| `discount.id` | ID | The Shopify GID of the discount |
| `discount.updatedAt` | Text | When the discount was last updated |
| `redeemCode` | Object | The redeem code that was added |
| `redeemCode.id` | ID | The Shopify GID of the redeem code |
| `redeemCode.code` | Text | The redeem code string |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Register a new code with your affiliate tool

1. Pick **Discount Code Added** as the trigger.
2. Add **Send HTTP request** with `{{redeemCode.code}}` and `{{discount.id}}`.
3. Turn the workflow on.

> [!NOTE]
> **Good to know**
> A bulk generation of 1,000 codes fires 1,000 events. Switch the trigger off on the Triggers page before a large import if you do not need them.

## Discount Code Removed

Fires when a redeem code is removed from a discount. It carries the code, how often it was used, and whether it was part of a bulk removal.

| | |
| --- | --- |
| **Fires from** | Shopify webhook |
| **Permission** | **Discount Data Access** |
| **Switched on** | Turning on a Flow workflow that uses it switches it on. Its own switch is on the app's **Triggers** page |

**Use it for**

- Notice when a code that is still in circulation is removed.
- Keep partner systems from advertising dead codes.

### What Discount Code Removed sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discount` | Object | The discount the code was removed from |
| `discount.id` | ID | The Shopify GID of the discount |
| `discount.updatedAt` | Text | When the discount was last updated |
| `discount.totalUsageCount` | Number | Total number of times the whole discount has been used across all of its codes. |
| `redeemCode` | Object | The redeem code that was removed |
| `redeemCode.id` | ID | The Shopify GID of the redeem code |
| `redeemCode.code` | Text | The redeem code string |
| `redeemCode.usageCount` | Number | How many times this code was used before it was removed. Null when it was part of a bulk removal (per-code usage can't be split) or could not be determined. |
| `redeemCode.bulkRemoval` | True / false | True when the code was removed as part of a bulk deletion, where per-code usage is unavailable. |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Warn when a used code is removed

1. Pick **Discount Code Removed** as the trigger.
2. Add a **Condition**: `redeemCode.usageCount` **Greater than** `0` and `redeemCode.bulkRemoval` **Equal to** `false`.
3. Add **Send internal email**: `Code {{redeemCode.code}} was removed after {{redeemCode.usageCount}} uses`.
4. Turn the workflow on.

## Next steps

Longer walkthroughs with a Slack setup: [Send new discounts to Slack](https://docs.workflow-trigger-extensions.app/send-new-discounts-to-slack.md), [Trigger a Shopify Flow when a discount expires](https://docs.workflow-trigger-extensions.app/discount-expired-alerts.md) and [Discount code removed alerts](https://docs.workflow-trigger-extensions.app/discount-code-removed-alerts.md).

- [Complete trigger reference](https://docs.workflow-trigger-extensions.app/trigger-reference.md) - every trigger on one page.
- [Choosing the right trigger](https://docs.workflow-trigger-extensions.app/choosing-the-right-trigger.md) - which one fits your case.
- [Custom triggers](https://docs.workflow-trigger-extensions.app/custom-triggers.md) - when no built-in trigger fits, write your own.
- [Event history and troubleshooting](https://docs.workflow-trigger-extensions.app/event-history-and-troubleshooting.md) - see what fired and what it carried.
