# Shopify Flow triggers and actions

> Luxe's Shopify Flow triggers and actions: handles, payload fields and types, the custom types, delivery, and how an action finds its set, ladder or upsell.

Source: https://www.luxesets.com/docs/shopify-flow

> **For developers and agencies.** Merchants build workflows in Flow with no code: see the help article [Luxe and
> Shopify Flow](https://www.luxesets.com/help/shopify-flow). This page is the reference for the triggers' payloads and the actions' fields.

## How Luxe talks to Flow

- **Every Luxe plan, no new access scope.** Luxe's triggers and actions are Flow extensions of the Luxe app.
- **Triggers are sent only for shops with a Luxe workflow.** Luxe queues a trigger only while one of the shop's workflows uses it, and sends it in the background after the change it reports is recorded.
- **Handles and field keys are a contract.** They are only ever added, never renamed or removed. Field keys are letters and spaces; Flow shows them as camelCase variables (`Rung name` is `{{ rungName }}`). Every declared field is in every payload; a field with nothing to say is blank or false.
- **Never in a payload:** Luxe-built revenue, the usage fee or any billing state, and customer data. Totals are Shopify's own allocated line amounts in the shop currency, after every discount.
- **Delivery is at least once.** In rare cases a trigger can arrive twice, so prefer steps that are safe to repeat (tags, notes). Test orders fire triggers too, with `Test order` true.
- **Size.** A payload over 45,000 bytes drops item titles, then keeps at most 20 items per list (each set keeps `itemCount`), then drops the item lists, so it stays under Flow's 50,000-byte limit.

## Order triggers

Each sends an `order_reference`: Flow loads the order, and its customer, under Flow's own permissions.

| Trigger (handle)                                                    | Fires                                                                                                      |
| ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| **Luxe order placed** (`luxe-order-placed`)                         | Once per paid order with a Luxe bundle set, reward or upsell, after Luxe records it                        |
| **Luxe subscription set started** (`luxe-subscription-set-started`) | Once per set bought on a subscription plan, on its first order (never on a renewal)                        |
| **Luxe reward earned** (`luxe-reward-earned`)                       | Once per rung an order reaches, after Luxe records the paid order                                          |
| **Luxe upsell accepted** (`luxe-upsell-accepted`)                   | Once per offer whose products an order holds: an upsell offer or the checkout offer                        |
| **Luxe missed order recovered** (`luxe-order-recovered`)            | Shopify never delivered an order's webhook and Luxe recorded the order later; fires with Luxe order placed |

| Trigger                       | Field                      | Type                     | Meaning                                                                                                                                                                |
| ----------------------------- | -------------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Luxe order placed             | `Bundle sets`              | `schema.LuxeSetList`     | Every set on the order, in the order of their first line                                                                                                               |
|                               | `Set count`                | `number_decimal`         | How many sets the order holds                                                                                                                                          |
|                               | `Has subscription set`     | `boolean`                | A set's items are on a selling plan                                                                                                                                    |
|                               | `Has reward`               | `boolean`                | The order reached a rung of a rewards ladder                                                                                                                           |
|                               | `Has upsell`               | `boolean`                | The order holds products added from an upsell or the checkout offer                                                                                                    |
|                               | `Test order`               | `boolean`                | Paid with Shopify's test payments or a test gateway                                                                                                                    |
|                               | `Recovered by Luxe`        | `boolean`                | Luxe recorded the order after Shopify never delivered its webhook                                                                                                      |
|                               | `Surfaces`                 | `single_line_text_field` | Where the Luxe lines were added, comma-separated: `kit_block`, `tray`, `drawer`, `fbt`, `gift_picker` and others (the `_luxe_src` codes)                               |
| Luxe subscription set started | `Bundle set`               | `schema.LuxeSet`         | The set bought on a subscription plan                                                                                                                                  |
|                               | `Selling plan name`        | `single_line_text_field` | The plan's name when the order names it, else blank                                                                                                                    |
|                               | `Test order`               | `boolean`                | As above                                                                                                                                                               |
| Luxe reward earned            | `Ladder name`, `Ladder id` | `single_line_text_field` | The rewards ladder                                                                                                                                                     |
|                               | `Rung name`                | `single_line_text_field` | The rung's checkout label                                                                                                                                              |
|                               | `Rung id`                  | `single_line_text_field` | Luxe's id for the rung                                                                                                                                                 |
|                               | `Reward type`              | `single_line_text_field` | `GIFT`, `PERCENT_OFF`, `AMOUNT_OFF` or `FREE_SHIPPING`                                                                                                                 |
|                               | `Gift product`             | `single_line_text_field` | The gift's title on the order; blank for a money reward                                                                                                                |
|                               | `Gift variant id`          | `single_line_text_field` | The gift's variant id; blank for a money reward                                                                                                                        |
|                               | `Gift chosen by shopper`   | `boolean`                | The rung let the shopper choose among gifts                                                                                                                            |
|                               | `Test order`               | `boolean`                | As above                                                                                                                                                               |
| Luxe upsell accepted          | `Offer name`               | `single_line_text_field` | The offer's name in Luxe                                                                                                                                               |
|                               | `Offer id`                 | `single_line_text_field` | The offer's id on the order's lines (its `_luxe_addon` value), or `checkout` for the checkout offer                                                                    |
|                               | `Offer type`               | `single_line_text_field` | `FREQUENTLY_BOUGHT_TOGETHER`, `PAIRS_WELL_WITH`, `YOU_MAY_ALSO_LIKE`, `QUANTITY_BREAK`, `MAKE_SET`, `TIER_GAP`, `UPGRADE`, `GIFT_ADD_ON`, `REFILL` or `CHECKOUT_OFFER` |
|                               | `Placement`                | `single_line_text_field` | `PRODUCT_PAGE`, `CART_DRAWER`, `REWARDS_BAR`, `SET_BUILDER` or `CHECKOUT`                                                                                              |
|                               | `Items`                    | `schema.LuxeItemList`    | The products the offer added                                                                                                                                           |
|                               | `Total`                    | `number_decimal`         | What the offer's lines sold for, after every discount, in the shop currency                                                                                            |
|                               | `Test order`               | `boolean`                | As above                                                                                                                                                               |
| Luxe missed order recovered   | `Order name`               | `single_line_text_field` | The order's name, such as `#1042`                                                                                                                                      |
|                               | `Paid at`                  | `single_line_text_field` | When the order was paid (ISO 8601)                                                                                                                                     |
|                               | `Held for review`          | `boolean`                | Luxe holds the order for review before it counts                                                                                                                       |
|                               | `Minutes late`             | `number_decimal`         | Minutes between the payment and Luxe recording the order                                                                                                               |

## Custom types

Flow fields cannot be lists, so a list travels inside an object: loop over `bundleSets.list` or `items.list`.

```graphql title="schema.graphql"
"A Luxe bundle set on the order."
type LuxeSet {
  "Luxe's id for the bundle set, as in the set editor's address."
  id: ID!
  "The bundle set's name in Luxe; the order's line title if it was deleted since."
  name: String!
  "BUILD_YOUR_OWN, COLLECTION or FIXED (UNKNOWN if deleted since)."
  type: LuxeSetType!
  "How many of this set the order holds."
  quantity: Int!
  "ONE_TIME, or SUBSCRIPTION when its items are on a selling plan."
  purchaseOption: LuxePurchaseOption!
  "What the set's lines sold for, after every discount, in the shop currency."
  total: Float!
  "How many lines the set has on the order, also when items lists fewer."
  itemCount: Int!
  "The set's items, as on the order (at most 20 on a very large order)."
  items: [LuxeSetItem!]!
}

"A product on the order that Luxe added."
type LuxeSetItem {
  productId: ID
  variantId: ID
  sku: String
  title: String
  quantity: Int!
  "PICK (the shopper chose it) or FIXED (always in the set); blank outside a set."
  role: String
  "What the line sold for, after every discount, in the shop currency."
  total: Float!
}

"The bundle sets on an order."
type LuxeSetList {
  list: [LuxeSet!]!
}

"Products an offer added to an order."
type LuxeItemList {
  list: [LuxeSetItem!]!
}

enum LuxeSetType {
  BUILD_YOUR_OWN
  COLLECTION
  FIXED
  UNKNOWN
}

enum LuxePurchaseOption {
  ONE_TIME
  SUBSCRIPTION
}
```

```liquid title="Flow (Liquid)"
{% for set in bundleSets.list %}
  {{ set.name }} ({{ set.type }}) x {{ set.quantity }}: {{ set.total }}
{% endfor %}
```

## Bundle set triggers

Each sends a `product_reference` and the set's fields, so a workflow can tag, hide or collect the product with Flow's own product actions.

| Set field           | Type                     | Meaning                                                          |
| ------------------- | ------------------------ | ---------------------------------------------------------------- |
| `Set id`            | `single_line_text_field` | Luxe's id for the set, as in the set editor's address            |
| `Set name`          | `single_line_text_field` | The set's name in Luxe                                           |
| `Set type`          | `single_line_text_field` | `BUILD_YOUR_OWN`, `COLLECTION` or `FIXED`                        |
| `Set status`        | `single_line_text_field` | `ACTIVE`, `DRAFT`, `ARCHIVED` or `DELETED`, as it is now in Luxe |
| `Set product`       | `boolean`                | True when the referenced product is the set's own set product    |
| `Collection id`     | `single_line_text_field` | A Collection set's collection id; blank for other sets           |
| `Collection handle` | `single_line_text_field` | A Collection set's collection handle; blank for other sets       |
| `Admin link`        | `url`                    | The set in Luxe, in the Shopify admin                            |

**The product.** For a Build-your-own or Fixed set it is the set product (`Set product` true). A Collection set has no set product of its own, so it is the **first product of its collection** in the collection's own order (`Set product` false): a real item, so a workflow that tags or hides products checks `setProduct` first. A set with nothing to reference sends no trigger (a set whose set product or collection was deleted in Shopify, or a Collection set whose collection is empty).

| Trigger (handle)                                                 | Fires                                                                                                                     | Fields after the set fields                                                                                      |
| ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Luxe bundle set created** (`luxe-set-created`)                 | Once per set, when it is first saved with its set product (or, for a Collection set, its collection)                      | None                                                                                                             |
| **Luxe bundle set activated** (`luxe-set-activated`)             | A set goes live, from Luxe or from a Flow action                                                                          | `Changed by`                                                                                                     |
| **Luxe bundle set paused** (`luxe-set-paused`)                   | A live set stops selling: paused or archived, by a Flow action, by a plan change, or because an item it holds was deleted | `Changed by`, `Reason` (blank when paused on purpose; else a reason below or `PLAN_DOWNGRADE`), `Reason message` |
| **Luxe bundle set deleted** (`luxe-set-deleted`)                 | A set is deleted in Luxe                                                                                                  | `Changed by`                                                                                                     |
| **Luxe bundle set needs attention** (`luxe-set-needs-attention`) | A set cannot sell as built; at most once per set and reason a day                                                         | `Reason`, `Reason message`                                                                                       |

`Reason message` is what Luxe shows on the set. **`Changed by`** (`single_line_text_field`) is `MERCHANT` (the admin), `SHOPIFY_FLOW` (a Luxe action), `SCHEDULE` (a ladder's start or end date), `PLAN_DOWNGRADE` (a move to a smaller plan) or `LUXE` (Luxe itself, for example when something a set holds was deleted).

| `Reason`                   | When                                                                          |
| -------------------------- | ----------------------------------------------------------------------------- |
| `ITEM_DELETED`             | A product a live set includes was deleted in Shopify (the set moves to draft) |
| `SLOT_SOURCE_DELETED`      | A slot's source collection was deleted (the set moves to draft)               |
| `SLOT_EMPTY`               | A slot has nothing eligible to offer                                          |
| `ITEMS_SOLD_OUT`           | A live set's default picks can no longer be filled from stock                 |
| `CANNOT_COMPILE`           | Luxe cannot publish the set as it now is, for example over its size limit     |
| `SET_PRODUCT_SELLING_PLAN` | The set product now sells with a selling plan                                 |
| `SUBSCRIPTION_PLANS`       | A plan a subscription set offers can no longer be offered                     |

## Ladder and upsell triggers

No Shopify reference.

| Trigger (handle)                                            | Fires                                                                                                          |
| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **Luxe rewards ladder activated** (`luxe-ladder-activated`) | A ladder starts running at checkout: activated in Luxe or by Flow, or its start date arrived                   |
| **Luxe rewards ladder paused** (`luxe-ladder-paused`)       | A ladder stops running at checkout: paused in Luxe or by Flow, its end date passed, or a plan change paused it |
| **Luxe upsell activated** (`luxe-upsell-activated`)         | An upsell offer goes live, from Luxe or from a Flow action                                                     |
| **Luxe upsell paused** (`luxe-upsell-paused`)               | A live upsell offer is paused, archived or deleted, from Luxe or from a Flow action                            |

| Triggers        | Field                  | Type                     | Meaning                                                                                                                                              |
| --------------- | ---------------------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Ladder triggers | `Ladder id`            | `single_line_text_field` | Luxe's id for the ladder, as in the ladder editor's address                                                                                          |
|                 | `Ladder name`          | `single_line_text_field` | The ladder's name in Luxe                                                                                                                            |
|                 | `Ladder type`          | `single_line_text_field` | `STORE` (store-wide) or `SET` (one bundle set's ladder)                                                                                              |
|                 | `Ladder status`        | `single_line_text_field` | `ACTIVE`, `DRAFT`, `ARCHIVED` or `DELETED`, as it is now in Luxe                                                                                     |
|                 | `Starts at`, `Ends at` | `single_line_text_field` | The ladder's start and end (ISO 8601); blank for none                                                                                                |
|                 | `Admin link`           | `url`                    | The ladder in Luxe                                                                                                                                   |
|                 | `Changed by`           | `single_line_text_field` | As above                                                                                                                                             |
| Upsell triggers | `Offer id`             | `single_line_text_field` | Luxe's id for the offer, as in the upsell editor's address                                                                                           |
|                 | `Offer name`           | `single_line_text_field` | The offer's name in Luxe                                                                                                                             |
|                 | `Offer type`           | `single_line_text_field` | `FREQUENTLY_BOUGHT_TOGETHER`, `PAIRS_WELL_WITH`, `YOU_MAY_ALSO_LIKE`, `QUANTITY_BREAK`, `MAKE_SET`, `TIER_GAP`, `UPGRADE`, `GIFT_ADD_ON` or `REFILL` |
|                 | `Placement`            | `single_line_text_field` | `PRODUCT_PAGE`, `CART_DRAWER`, `REWARDS_BAR` or `SET_BUILDER`                                                                                        |
|                 | `Offer status`         | `single_line_text_field` | `ACTIVE`, `DRAFT`, `ARCHIVED` or `DELETED`, as it is now in Luxe                                                                                     |
|                 | `Admin link`           | `url`                    | The offer in Luxe                                                                                                                                    |
|                 | `Changed by`           | `single_line_text_field` | As above                                                                                                                                             |

## Refund triggers

Each sends an `order_reference`, after Luxe records the refund. Returns data on orders: [Line properties and order data](https://www.luxesets.com/docs/line-properties#returns).

| Trigger (handle)                                        | Fires                                                                     |
| ------------------------------------------------------- | ------------------------------------------------------------------------- |
| **Luxe set items returned** (`luxe-set-items-returned`) | A refund returns money for items of a bundle set; once per set and refund |
| **Luxe gift no longer earned** (`luxe-gift-unearned`)   | A refund takes an order below the rung of a gift it earned; once per gift |

| Trigger                    | Field                                          | Type                     | Meaning                                                                                                      |
| -------------------------- | ---------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------ |
| Luxe set items returned    | `Set id`, `Set name`, `Set type`, `Set status` | `single_line_text_field` | As in the set fields; `Set type` is `UNKNOWN` when the set was deleted since                                 |
|                            | `Refund id`                                    | `single_line_text_field` | Shopify's id for the refund                                                                                  |
|                            | `Items`                                        | `schema.LuxeItemList`    | The set's items this refund returned money for; each item's `total` is what was refunded for it (at most 20) |
|                            | `Item count`                                   | `number_decimal`         | How many units of the set's items this refund returned money for                                             |
|                            | `Whole set returned`                           | `boolean`                | True once every unit of the set's items on the order has been refunded                                       |
|                            | `Admin link`                                   | `url`                    | Where to see it in Luxe, in the Shopify admin                                                                |
| Luxe gift no longer earned | `Ladder id`, `Ladder name`                     | `single_line_text_field` | The rewards ladder                                                                                           |
|                            | `Rung id`, `Rung name`                         | `single_line_text_field` | The rung; its name is its checkout label                                                                     |
|                            | `Gift product`                                 | `single_line_text_field` | The gift's title on the order                                                                                |
|                            | `Gift value`                                   | `number_decimal`         | The gift's own price times its quantity, in the shop currency                                                |
|                            | `Refund id`                                    | `single_line_text_field` | The refund that took the order below the rung                                                                |
|                            | `Admin link`                                   | `url`                    | Where to see it in Luxe, in the Shopify admin                                                                |

## Plan limit reached

**Luxe plan limit reached** (`luxe-plan-limit-reached`), no Shopify reference: the merchant's plan held something back. Once per limit a month.

| Field         | Type                     | Meaning                                                                                              |
| ------------- | ------------------------ | ---------------------------------------------------------------------------------------------------- |
| `Limit`       | `single_line_text_field` | `SETS`, `LADDERS`, `RUNGS`, `UPSELLS` or `LUXE_ORDERS`                                               |
| `Plan`        | `single_line_text_field` | The Luxe plan, such as Luxe Starter                                                                  |
| `Limit value` | `number_decimal`         | What the plan allows: live sets, live ladders, rungs per ladder, live upsells or Luxe orders a month |
| `Item name`   | `single_line_text_field` | The set, ladder or upsell the limit held back                                                        |
| `Message`     | `single_line_text_field` | What Luxe showed in the admin                                                                        |
| `Admin link`  | `url`                    | The Plans page in Luxe                                                                               |

## Actions

Each action has one required field (`single_line_text_field`).

| Action (handle)                                      | Field (key, label)               | Does                                                                                                                           |
| ---------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| **Activate bundle set** (`luxe-activate-set`)        | `bundle_set`, Bundle set         | Takes a set live, as the set editor's save does: every plan limit applies                                                      |
| **Pause bundle set** (`luxe-pause-set`)              | `bundle_set`, Bundle set         | Moves a set to draft. Bags that already hold it keep their price                                                               |
| **Refresh bundle set** (`luxe-refresh-set`)          | `bundle_set`, Bundle set         | Rereads a live set's items, prices and stock from Shopify within a minute, as Luxe does nightly. A draft set is left unchanged |
| **Activate rewards ladder** (`luxe-activate-ladder`) | `rewards_ladder`, Rewards ladder | Turns a ladder on; its start and end dates still apply                                                                         |
| **Pause rewards ladder** (`luxe-pause-ladder`)       | `rewards_ladder`, Rewards ladder | Turns a ladder off for new bags                                                                                                |
| **Activate upsell offer** (`luxe-activate-upsell`)   | `upsell_offer`, Upsell offer     | Takes an offer live, within the plan's limits                                                                                  |
| **Pause upsell offer** (`luxe-pause-upsell`)         | `upsell_offer`, Upsell offer     | Moves an offer to draft. Bags that already hold its products keep their price                                                  |

**The field** takes the item's name exactly as in Luxe (capitals aside) or its Luxe id from its editor's address; an upsell also takes its offer id from **Luxe upsell accepted**. A Flow variable (`{{ setId }}`) is resolved when the workflow runs. A name two items share is refused, with the way out. Luxe also validates the field when the merchant saves the workflow, so an unknown item shows as a field error in Flow.

| Answer        | When                                                                                                 |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| Done          | The change was made, or the item was already so ("Holiday gift set is already live.")                |
| Still running | The action took longer than 8 seconds; Flow retries and gets the result                              |
| Refused       | Not found, ambiguous, a plan limit, or Luxe not installed. Flow shows the message and does not retry |
| Failed        | A transient failure; Flow retries, and the retry runs the action again                               |
