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

# Spend in Shopify Store

> Shopify purchase loyalty rule. Reward users for spending in your Shopify store.

<head>
  <script type="application/ld+json">
    {JSON.stringify({
            "@context": "https://schema.org",
            "@type": "TechArticle",
            "headline": "Spend in Shopify Store",
            "description": "Shopify purchase loyalty rule. Reward users for spending in your Shopify store.",
            "author": {"@type": "Organization", "name": "Snag Solutions", "url": "https://www.snagsolutions.io/"},
            "publisher": {"@type": "Organization", "name": "Snag Solutions", "url": "https://www.snagsolutions.io/", "logo": {"@type": "ImageObject", "url": "https://assets.snagsolutions.io/public/docs/snag-logo-dark-no-bg.svg"}},
            "mainEntityOfPage": "https://docs.snagsolutions.io/loyalty/rules/spend-in-shopify-store"
          })}
  </script>
</head>

## Overview

Reward users based on how much they have spent in your Shopify store. On claim, we match the user’s connected email to a Shopify customer and evaluate their lifetime spend against your configured ranges to award points or a multiplier.

## Prerequisites

* Shopify must be connected in Snag with a Shopify Admin API access token.
  * Required scopes: `read_customers` and `read_orders` (needed to look up customers and read lifetime spend).
* The user must have connected an email address in Snag (used to find the Shopify customer).
* You must provide your Shopify store URL in the rule configuration.

<Warning>
  Store your Shopify Admin API access token securely and grant only the minimum
  required scopes.
</Warning>

## Rule Configuration Fields

### **Reward**

* **Type of Reward**: Choose between "Points" or "Multiplier".

* **Points**: Users will receive the defined number of points based on their activity or achievement.

* **Multiplier**: Users will receive the multiplier of the defined range based on their qualification level.

* **Required Range**: Define a numerical range for eligibility (tokens, actions, followers, messages count, etc.).

* **Points to Reward**: Define the number of points assigned for the specified qualification range.

* **Add New Range**: Allows defining multiple qualification ranges with corresponding rewards.

### Basic Settings

* **Claim type**: Manual — users click "Claim" to trigger evaluation and rewards.
* **Frequency**: Immediately — the rule evaluates and awards at the time of claim.
* **Interval**: Once — users can claim once (unless otherwise configured globally).
* **Reward lifetime**: Permanent — awarded points remain unless explicitly removed.

### Custom Settings

* **Shopify Store URL**: Your store domain (for example, `your-store.myshopify.com`).
* **Skip the multiplier for this rule**: If enabled, only fixed point rewards are used for matching ranges.

## How it works

1. When a user clicks "Claim", Snag queries the [Shopify Admin GraphQL API](https://shopify.dev/docs/api/admin-graphql) for the customer by the user’s connected email.
2. We read the customer’s lifetime `amountSpent` and compare it to your configured spend ranges.
3. The user is awarded the points or multiplier defined for the first matching range.

<Tip>
  If the email doesn’t match a Shopify customer, `amountSpent` is treated as 0 —
  ensure users connect the same email they use at checkout.
</Tip>

## Troubleshooting

* **Shopify not connected**: Ensure you’ve connected Shopify in Snag and selected the integration when creating this rule.
* **Email not connected**: Users must connect an email address in their Snag profile before claiming.
* **No reward given**: Confirm your ranges include 0 or the user’s actual spend, and that your store URL is correct.

## Data captured

For auditing, the reward stores the Shopify `customerId` and the evaluated `amountSpent` at claim time.
