> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.omegatheme.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Create or update discount offers with Shopify Flow

# Create or update discount offers with Shopify Flow

Use the **Pareto: Create or Update Discount Offer** action to automatically create and update discount offers from Shopify Flow,  no manual setup in the Pareto app needed.

## In this article
* [How it works](#2-how-it-works)
* [Before you begin](#2-before-you-begin)
* [Add the action to a Flow](#2-add-the-action-to-a-flow)
* [Configure the action](#2-configure-the-action)
* [Field reference](#2-field-reference)
* [Update an existing offer](#2-update-an-existing-offer)
* [Limitations](#2-limitations)
* [Tips](#2-tips)

## How it works

Pareto registers a custom action inside Shopify Flow. Any trigger that Shopify Flow supports — a webhook from your PIM, a product tag change, an inventory update, a scheduled run — can fire the action and create or update a Pareto discount offer. Each offer is keyed by an **External ID** you provide, so the same trigger can create the offer the first time and update it on every run after.

## Before you begin

* Install the **Shopify Flow** app from the Shopify App Store.
* Have Pareto installed on your store.
* Decide what External ID you'll use for each offer (a PIM record ID, SKU group, or any unique string from your source system).

## Add the action to a Flow

1. Open the **Shopify Flow** app.
2. Click **Create workflow**.
3. Choose a trigger, for example, **Webhook Trigger** if you're sending data from a PIM.
4. Click the **+** below the trigger and choose **Action**.
5. Search for **Pareto** and select **Create or Update Discount Offer**.
6. Fill in the action fields (see Field reference below).
7. Click **Turn on workflow**.

## Configure the action

The action upserts a Pareto discount offer. If the **External ID** is new, a new offer is created. If it already exists, the offer is updated in place.

## Field reference

| Field | Required | Description |
| ---- |
| **External ID** | Yes | Unique identifier from your system (e.g. PIM record ID). Used as the upsert key. Send the same value to update the offer later. |
| **Campaign name** | No | Display name shown to merchants and inside the Pareto app. |
| **Campaign type** | No | One of: `buy_x_discount_y`, `quantity_break_amount`, `tiered_discount`, `one_discount`. See campaign types below. |
| **Status** | No | `1` = Active, `0` = Draft. |
| **Discount rule** | No | JSON array of tier objects. See discount rule format below. |
| **Product list** | No | JSON array of Shopify product IDs as strings. Example: `["6897738252417"]` |

|| Note: If you want the product ID to be dynamic, please use [{{ product.id | remove: "gid://shopify/Product/" | strip }}]

![Pareto Shopify Flow integration screenshot](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/shopify-flow_1iffo0r.png)

### Campaign types

| Type | Behavior | Example |
| ---- |
| `buy_x_discount_y` | Buy a quantity, get a discount | Buy 10, get `5%` off |
| `quantity_break_amount` | Spend an amount, get a discount | Spend `$100`, get `5%` off |
| `tiered_discount` | Different discount per tier on the same purchase | First 5 units `6%` off, next 5 units `10%` off |
| `one_discount` | Same as `buy_x_discount_y`, but supports free gift, free shipping, and cross-sell rules. **Recommended for richer offers.** |

### Discount rule format

The **Discount rule** field accepts a JSON array of tier objects. Each tier supports four keys:

| Key | Description |
| ---- |
| `buy_from` | Minimum quantity or value to trigger this tier |
| `discount_type` | `per_item` or `total_value` |
| `discount_unit` | `percent` or `amount` |
| `discount_value` | The discount amount, e.g. `30` |

**Example:**
```json
[{"buy_from":3,"discount_type":"per_item","discount_unit":"percent","discount_value":30}]
```

This creates a tier where buying 3 or more units gets `30%` off each item.

## Update an existing offer

To update an offer, send the action again with the **same External ID**. Any fields you include will overwrite the existing values. Fields you leave empty stay unchanged.

## Limitations

* Only the four keys listed above (`buy_from`, `discount_type`, `discount_unit`, `discount_value`) are supported in the **Discount rule** field. Advanced rule keys like `buy_to`, `multiples`, and `max_discount` are not yet available via Flow.
* Plan limits apply to active offers created via Flow:
* **Free plan**: up to `1` active offer
* **Basic plan**: up to `5` active offers
* **Pro** and **Advanced** plans: unlimited
* If an action would push you over your plan limit, the offer is created as a **Draft** instead of failing.
* The action only creates or updates discount offers. Other Pareto features (bundles, checkout upsell, banner widgets) are not configurable through Flow.

## Tips

You don't have to build the Flow by hand. Shopify Sidekick can scaffold the entire workflow for you, including the trigger, the Pareto action, and the JSON for the discount rule. Open Sidekick from your Shopify admin and try prompts like the ones below.

**Start with a plain-language description of the offer.** Tell Sidekick what you want to happen and let it pick the trigger and action. The more specific you are about *when* the offer should fire and *what* the discount looks like, the less you'll need to edit afterwards.