--- title: "Setting Up Custom Action Earning Rules on Shopify" slug: "setting-up-custom-action-earning-rules-on-shopify" tags: ["Earning Rules", "Shopify Plus", "Shopify", "Loyalty and Referrals"] updated: 2025-02-24T13:31:09Z published: 2025-02-24T13:31:09Z canonical: "support.yotpo.com/setting-up-custom-action-earning-rules-on-shopify" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.yotpo.com/llms.txt > Use this file to discover all available pages before exploring further. # Setting Up Custom Action Earning Rules on Shopify Products Loyalty & Referrals ###### Supported plans Premium, Enterprise ###### eCommerce Platform Shopify, Shopify Plus ## Goals and Outcomes The Custom Action is an [advanced earning rule](https://support.yotpo.com/docs/earning-rules-overview-for-shopify#:~:text=for%20increased%20impact.-,Advanced%20earning%20rules,-Optimize%20your%20program) that enables you to reward customers for performing specific actions. This feature allows you to design unique earning rules that align with your business goals. **Key Benefits**: - Create custom earning rules tailored to your customers, such as **weekly draws, donation-based rewards, form submissions,** and **online gaming events**. - Integrate with third-party applications to reward customers for completing actions on external platforms. Custom Action earning rules provide a creative way to engage customers and incentivize meaningful interactions with your brand. In this article, you’ll learn how to set them up on Shopify. > [!WARNING] > Important > > Custom Action earning rules require technical expertise and the use of API. > [!NOTE] > Is this article for me? > > If you’re not using Shopify or Shopify Plus, follow this [Custom Action earning rule guide](https://support.yotpo.com/docs/custom-action-earning-rule) for other e-commerce platforms. ## Creating a Custom Action Earning Rule ![](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/create-custom-action-earning-rule.png?sv=2026-02-06&spr=https&st=2026-11-08T13%3A30%3A01Z&se=2026-11-08T14%3A30%3A01Z&sr=c&sp=r&sig=ht6TPBoCRirJ4PxxUzlJ5pSp6GjROUwsNkht9KqUQcA%3D) To create a Custom Action earning rule on Shopify and Shopify Plus, follow these steps: 1. From your Yotpo admin, go to **Manage Program** > **Rewards Program**. 2. Under **Ways to earn**, click **Create earning rule**. 3. Go to the **Advanced** section and select **Custom Action**. 4. Click **Next**. ## Configuring a Custom Action Earning Rule ![](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/custom-action-general-settings.png?sv=2026-02-06&spr=https&st=2026-11-08T13%3A30%3A01Z&se=2026-11-08T14%3A30%3A01Z&sr=c&sp=r&sig=ht6TPBoCRirJ4PxxUzlJ5pSp6GjROUwsNkht9KqUQcA%3D) ### General Settings - **Custom Action settings** - use Yotpo’s API to create the earning rule setup. Keep in mind that this earning rule can only be triggered via API. - **Action name** - the name you’ll use in the API call to trigger the earning rule. - **Reward type** - choose whether to reward customers with points or a discount for meeting the rule criteria. Use the [**Advanced settings**](/v1/docs/setting-up-custom-action-earning-rules-on-shopify#advanced-settings) to customize who the rule will apply to. - **Rewards history text** - the text that will appear in the customers’ rewards history. ### Advanced Settings ![](https://cdn.document360.io/f3c2ab59-fe4c-4f93-9614-2872f40e8aa7/Images/Documentation/advanced-settings-custom-action.png?sv=2026-02-06&spr=https&st=2026-11-08T13%3A30%3A01Z&se=2026-11-08T14%3A30%3A01Z&sr=c&sp=r&sig=ht6TPBoCRirJ4PxxUzlJ5pSp6GjROUwsNkht9KqUQcA%3D) - **Target audience** - **Restrict by customer** - Configure the lists and segments to determine which customers are eligible for the earning rule or should be excluded from it. - **Minimum times completed** - The minimum number of times a customer must perform this action to receive a reward. - If you select a number higher than 1, you can set a waiting period between each action completion. For example, if you select 1 week, the customer will have to wait that long before they can do the action again. - **Maximum times completed** - The maximum number of times each customer can participate in this earning rule. - If you select a number higher than 1, you can set a waiting period between rewards, meaning the customer will have to wait this long (e.g., 2 weeks) to be able to complete the rule again and earn another reward. If they attempt to complete the rule during the waiting period, they won’t receive a reward. - **Restrict by VIP tiers** - **VIP tiers** - select which [VIP tiers](https://support.yotpo.com/v1/docs/loyalty-referrals-vip-tiers) the Custom Action earning rule will apply to. - **Schedule rule** - configure how long the rule will run for. It can be an ongoing campaign or a limited-time promotion. ## Setting up the API To reward customers for completing an action outside your Yotpo loyalty program, you need to establish a communication of action completion either by [manually sending an API call](https://loyaltyapi.yotpo.com/reference#record-a-customer-action) OR by automating the API call. > [!WARNING] > Important > > - API calls must be made **server-side** or through a **proxy server**. > - If attempted from the **client side**, a **CORS error** will occur, as this could expose sensitive data. To automate the API call, you need to use this [API endpoint](https://loyaltyapi.yotpo.com/reference/record-a-customer-action) and follow the steps below: 1. Decide on the action to be performed and assign its action name. 2. Create the automation that triggers the API call to Yotpo. This requires your developer to add a code snippet where the event fires (e.g., on a form’s "Submit" button). ****Sample code snippet format**** To adjust the code below, do the following: - Replace **CustomAction** with the desired action name (e.g., completed_form). - Replace **guid** with your unique identifier, found in Settings. - Replace **x-api-key** with your API key, also found in Settings. For complete directions, refer to [our dev documentation](http://dev.swellrewards.com/#record-a-customer-action). > [!TIP] > Need to find your API Key? > > For instructions on how to find your Merchant ID and Yotpo Loyalty & Referrals API Key, click [here](https://support.yotpo.com/v1/docs/finding-your-loyalty-referrals-api-key-and-guid). 1. Once you've set up the API, you can configure your Custom Action earning rule using the action name you created.