---
title: "Checkout triggers, step by step"
description: "Step-by-step Shopify Flow tutorials for checkout errors, rejected discount codes and first-time customer orders."
canonical: "https://docs.workflow-trigger-extensions.app/checkout-trigger-tutorials"
---

# Checkout triggers, step by step

Three triggers around the moment of purchase. Two come from the shopper's browser during checkout and tell you that checkout is failing **before** a support ticket does. The third is an ordinary order trigger for a customer's very first order.

**On this page:** [Checkout Error Shown](#checkout-error-shown), [Checkout Discount Code Rejected](#checkout-discount-code-rejected), [First-Time Customer Order](#first-time-customer-order)

> [!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 Checkout](https://cdn-dev.eu.codecreationlabs.cloud/crm-tool/uploads/SjJ78gKLnLlocopCui3Cs62dJbGZ7F1n/ce530405722d16e9.png)
*Where you find them: in Shopify Flow choose Select a trigger, open Workflow Trigger Extensions and search for "Checkout".*

## Checkout Error Shown

Fires when checkout shows an error or a warning to a shopper: an address that does not validate, a declined payment, a field that rejects its input. It carries the message, its type and the field it belongs to.

| | |
| --- | --- |
| **Fires from** | The app's storefront pixel, in the shopper's browser |
| **Permission** | **Storefront Behaviour 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**

- Find out that checkout is failing without waiting for complaints.
- Spot a broken shipping or payment rule after a change.

### What Checkout Error Shown sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `checkoutAlert` | Object | The message shown and where it appeared |
| `checkoutAlert.message` | Text | What the shopper was told, in their language. |
| `checkoutAlert.type` | Text | The kind of alert, e.g. INPUT_INVALID. |
| `checkoutAlert.target` | Text | The field that failed, e.g. cart.discountCode. |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Collect checkout errors in a channel

1. Pick **Checkout Error Shown** as the trigger.
2. Add a **Condition** to skip the noise: `checkoutAlert.target` **Not equal to** `cart.discountCode` (rejected codes have their own trigger).
3. Add **Send HTTP request** to Slack: `{{checkoutAlert.type}} on {{checkoutAlert.target}}: {{checkoutAlert.message}}`.
4. Turn the workflow on and watch for a sudden rise rather than for single events.

> [!NOTE]
> **Good to know**
> - The message is the one the shopper saw, in the shopper's language.
> - Collected in the shopper's browser and only with analytics consent, so it under-reports by design and can miss events (ad blockers, closed tabs). Use it for signals, never where a missed event would be a correctness problem. See [Storefront triggers](https://docs.workflow-trigger-extensions.app/storefront-triggers.md).

## Checkout Discount Code Rejected

Fires when checkout refuses a discount code. Shopify does **not** tell apps which code was typed, so the event carries the reason and nothing else.

| | |
| --- | --- |
| **Fires from** | The app's storefront pixel, in the shopper's browser |
| **Permission** | **Storefront Behaviour 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 an expired or mistyped campaign code within minutes of an email going out.

### What Checkout Discount Code Rejected sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `discountAttempt` | Object | Why the code was not applied, in the shopper's language |
| `discountAttempt.reason` | Text |  |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Warn marketing about a rise in rejected codes

1. Pick **Checkout Discount Code Rejected** as the trigger.
2. Add **Send HTTP request** to a channel or a counter: `A discount code was rejected: {{discountAttempt.reason}}`.
3. Turn the workflow on. Right after sending a campaign, a burst of these means the code in the email does not work.

> [!NOTE]
> **Good to know**
> - Clicking apply with an empty field produces the same event, so use it to see a trend, not to identify one campaign.
> - Collected in the shopper's browser and only with analytics consent, so it under-reports by design and can miss events (ad blockers, closed tabs). Use it for signals, never where a missed event would be a correctness problem. See [Storefront triggers](https://docs.workflow-trigger-extensions.app/storefront-triggers.md).

## First-Time Customer Order

Fires when an order is placed by a customer who has never ordered before. It is an order trigger, not a browser one: it arrives reliably and carries the order and the customer as references.

| | |
| --- | --- |
| **Fires from** | Shopify webhook |
| **Permission** | **Order Data Access** + **Customer 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**

- Welcome series, a thank-you note or a small gift for first orders.
- Tag first-time buyers for later segmentation.

### What First-Time Customer Order sends to your workflow

| Variable in Flow | Type | What it holds |
| --- | --- | --- |
| `order` | Order (Shopify) | The customer's first order. A full Shopify order, so all of its fields and Flow's own order actions are available. |
| `customer` | Customer (Shopify) | The first-time customer. A full Shopify customer, so all of its fields and Flow's own customer actions are available. |
| `eventId` | Text | The id of this event. Search for it in the app's Event History to see exactly what was sent. |

### Example: Tag and welcome first-time buyers

1. Pick **First-Time Customer Order** as the trigger.
2. Add **Add customer tags** `first-order` and **Add order tags** `first-order`.
3. Add **Send internal email** to the packing team: `{{order.name}} is {{customer.displayName}}'s first order - add the welcome card`.
4. Turn the workflow on.

> [!NOTE]
> **Good to know**
> - Needs **Order** and **Customer Data Access**.
> - Guest checkouts without a customer record do not fire it.

## Next steps

- [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.
