> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shopjar.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify Flow

> Every Shopjar trigger for Shopify Flow, with its complete payload reference.

The Shopify Flow integration fires a **trigger** in Shopify Flow for
each Shopjar program event, so you can build workflows in your Shopify
admin — tag customers when they become affiliates, post to Slack on big
referral sales, add payout rows to a spreadsheet, and more. *(Growth
plan)*

## Setup

<Steps>
  <Step title="Enable the integration">
    In **Settings → Integrations → Shopify Flow**, turn the toggle on.
  </Step>

  <Step title="Build a workflow">
    In **Shopify admin → Flow**, create a workflow and pick a Shopjar
    trigger — they're listed under the app's name.
  </Step>

  <Step title="Test safely">
    Back in Shopjar, click **Send test event** — it fires a sample of
    every trigger with placeholder data (safe to run), so you can watch
    your workflows execute end to end.
  </Step>
</Steps>

## Payload structure

Every trigger delivers two objects you can reference in Flow conditions
and actions.

**`shopjar profile`** — the member the event belongs to:

| Property                   | Description                 | Example                              |
| -------------------------- | --------------------------- | ------------------------------------ |
| `sj_member_first_name`     | Member's first name         | `John`                               |
| `sj_member_last_name`      | Member's last name          | `Smith`                              |
| `sj_member_email`          | Member's email address      | `john@example.com`                   |
| `sj_member_referral_link`  | Their unique referral link  | `https://yourstore.com?sjref=JOHN10` |
| `sj_member_affiliate_link` | Their unique affiliate link | `https://yourstore.com?sjram=JOHN10` |
| `sj_member_affiliate_code` | Their affiliate code        | `JOHN10`                             |

**`shopjar payload`** — the event's own data, listed per trigger below.

## Referral triggers (5)

### Referral welcome email — `shopjar-referral-welcome-email`

Fires when a member joins the referral program.

| Property                       | Description                  |
| ------------------------------ | ---------------------------- |
| `sj_event_referrer_name`       | Referrer's full name         |
| `sj_event_referrer_first_name` | Referrer's first name        |
| `sj_event_referrer_last_name`  | Referrer's last name         |
| `sj_event_referrer_email`      | Referrer's email address     |
| `sj_event_referrer_link`       | The referrer's referral link |

### Invitation email — `shopjar-invitation-email`

Fires when a referrer invites a friend.

| Property                         | Description                  |
| -------------------------------- | ---------------------------- |
| `sj_event_referrer_first_name`   | Referrer's first name        |
| `sj_event_referrer_last_name`    | Referrer's last name         |
| `sj_event_referrer_email`        | Referrer's email address     |
| `sj_event_referrer_link`         | The referrer's referral link |
| `sj_event_coupon_code`           | The friend's coupon code     |
| `sj_event_coupon_code_expiry_at` | Coupon expiry date           |

### Friend reward claim — `shopjar-friend-reward-claim`

Fires when a referred friend claims their reward.

| Property                         | Description              |
| -------------------------------- | ------------------------ |
| `sj_event_friend_name`           | Friend's full name       |
| `sj_event_friend_first_name`     | Friend's first name      |
| `sj_event_friend_last_name`      | Friend's last name       |
| `sj_event_referrer_first_name`   | Referrer's first name    |
| `sj_event_referrer_last_name`    | Referrer's last name     |
| `sj_event_referrer_email`        | Referrer's email address |
| `sj_event_coupon_code`           | The claimed coupon code  |
| `sj_event_coupon_code_expiry_at` | Coupon expiry date       |

### Referrer reward earned — `shopjar-referrer-reward-earned`

Fires when a referrer's reward is issued.

| Property                         | Description              |
| -------------------------------- | ------------------------ |
| `sj_event_referrer_name`         | Referrer's full name     |
| `sj_event_referrer_email`        | Referrer's email address |
| `sj_event_friend_name`           | Friend's full name       |
| `sj_event_friend_email`          | Friend's email address   |
| `sj_event_coupon_code`           | The reward coupon code   |
| `sj_event_coupon_code_expiry_at` | Coupon expiry date       |

### Referral sale (admin) — `shopjar-referral-sale-admin`

Fires when a referral drives an order.

| Property                       | Description              |
| ------------------------------ | ------------------------ |
| `sj_event_referrer_name`       | Referrer's full name     |
| `sj_event_referrer_first_name` | Referrer's first name    |
| `sj_event_referrer_last_name`  | Referrer's last name     |
| `sj_event_referrer_email`      | Referrer's email address |
| `sj_event_order_value`         | The order's value        |
| `sj_event_sales_url`           | Link to the sales report |

## Affiliate triggers (7)

### Affiliate applied (admin) — `shopjar-affiliate-applied-admin`

Fires when someone applies to the program.

| Property                        | Description               |
| ------------------------------- | ------------------------- |
| `sj_event_affiliate_first_name` | Affiliate's first name    |
| `sj_event_affiliate_last_name`  | Affiliate's last name     |
| `sj_event_affiliate_email`      | Affiliate's email address |

### Application approved — `shopjar-affiliate-application-approved`

| Property                           | Description                  |
| ---------------------------------- | ---------------------------- |
| `sj_event_affiliate_first_name`    | Affiliate's first name       |
| `sj_event_affiliate_last_name`     | Affiliate's last name        |
| `sj_event_affiliate_email`         | Affiliate's email address    |
| `sj_event_affiliate_dashboard_url` | Their portal (dashboard) URL |
| `sj_event_affiliate_url`           | Their affiliate link         |
| `sj_event_affiliate_code`          | Their affiliate code         |

### Application rejected — `shopjar-affiliate-application-rejected`

| Property                        | Description               |
| ------------------------------- | ------------------------- |
| `sj_event_affiliate_first_name` | Affiliate's first name    |
| `sj_event_affiliate_last_name`  | Affiliate's last name     |
| `sj_event_affiliate_email`      | Affiliate's email address |

### Affiliate reward earned — `shopjar-affiliate-reward-earned`

Fires when a commission is earned.

| Property                            | Description                 |
| ----------------------------------- | --------------------------- |
| `sj_event_affiliate_name`           | Affiliate's full name       |
| `sj_event_affiliate_email`          | Affiliate's email address   |
| `sj_event_affiliate_url`            | Their affiliate link        |
| `sj_event_affiliate_code`           | Their affiliate/coupon code |
| `sj_event_affiliate_code_expiry_at` | Code expiry date, if set    |
| `sj_event_amount`                   | The commission amount       |
| `sj_event_affiliate_dashboard_url`  | Their portal URL            |

### Affiliate payout processed — `shopjar-affiliate-payout-processed`

| Property                           | Description                     |
| ---------------------------------- | ------------------------------- |
| `sj_event_affiliate_first_name`    | Affiliate's first name          |
| `sj_event_affiliate_last_name`     | Affiliate's last name           |
| `sj_event_paid_amount`             | The payout amount               |
| `sj_event_remaining_balance`       | Balance left after the payout   |
| `sj_event_payment_method`          | How it was paid (e.g. `Paypal`) |
| `sj_event_affiliate_dashboard_url` | Their portal URL                |

### Commission redeemed as coupon — `shopjar-commission-redeemed-coupon`

| Property                           | Description               |
| ---------------------------------- | ------------------------- |
| `sj_event_affiliate_email`         | Affiliate's email address |
| `sj_event_affiliate_first_name`    | Affiliate's first name    |
| `sj_event_affiliate_last_name`     | Affiliate's last name     |
| `sj_event_paid_amount`             | The redeemed amount       |
| `sj_event_coupon_code`             | The generated coupon code |
| `sj_event_affiliate_dashboard_url` | Their portal URL          |

### Affiliate sale (admin) — `shopjar-affiliate-sale-admin`

Fires when an affiliate drives an order.

| Property                        | Description               |
| ------------------------------- | ------------------------- |
| `sj_event_affiliate_first_name` | Affiliate's first name    |
| `sj_event_affiliate_last_name`  | Affiliate's last name     |
| `sj_event_affiliate_email`      | Affiliate's email address |
| `sj_event_order_value`          | The order's value         |
| `sj_event_sales_url`            | Link to the sales report  |

## Workflow ideas

<AccordionGroup>
  <Accordion title="Tag customers who become affiliates" icon="tags" description="Add an 'affiliate' tag on approval for segmentation everywhere.">
    Trigger **Application approved** → Flow action "Add customer tag".
    Now every Shopify surface — and every other app — knows who your
    affiliates are.
  </Accordion>

  <Accordion title="Slack alert on big referral sales" icon="bell" description="Celebrate $200+ referral orders in your team channel.">
    Trigger **Referral sale (admin)** → condition
    `sj_event_order_value` greater than 200 → "Send Slack message"
    with the referrer's name and amount.
  </Accordion>

  <Accordion title="Payout bookkeeping" icon="table" description="Append every processed payout to a Google Sheet.">
    Trigger **Affiliate payout processed** → "Add row to spreadsheet"
    with `sj_event_paid_amount`, `sj_event_payment_method`, and the
    member's email from the profile object.
  </Accordion>
</AccordionGroup>

<Note>
  Test events use placeholder data (e.g. `test@shopjar.example`,
  coupon `SHOPJAR-TEST-10`) — filter them out of production workflows
  by excluding that email domain if you test often.
</Note>

## Need help?

<CardGroup cols={3}>
  <Card title="Book a call" icon="calendar-days" href="https://cal.com/yukoteam/shopjar">
    Schedule a free call with our team for personal setup assistance.
  </Card>

  <Card title="Contact support" icon="comments" href="#crisp-chat">
    Chat with us directly — we're happy to help with any question.
  </Card>

  <Card title="Install Shopjar" icon="download" href="https://apps.shopify.com/referral-and-affiliates">
    Get [Shopjar Referral & Affiliate Marketing](https://apps.shopify.com/referral-and-affiliates) from the Shopify App Store.
  </Card>
</CardGroup>
