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

# Rewarding purchases

> Set up Yotpo to reward points when customers make retail purchases.

## Create a Custom Action in Yotpo

In your Yotpo admin, navigate to [*Manage Program → Rewards Program → Manage earning rules*](https://loyalty-app.yotpo.com/rewards-program/earning-rules) and click `Create earning rule`. Choose `Custom Action`.

<img src="https://mintcdn.com/typecastleinc/rWC4pMP5Mv_G5OWc/images/integrations/yotpo/yotpo-custom-action.png?fit=max&auto=format&n=rWC4pMP5Mv_G5OWc&q=85&s=03bd9264bb31951dd4a846e171c0a121" alt="yotpo custom action" className="rounded-lg border border-gray-100" width="1994" height="1330" data-path="images/integrations/yotpo/yotpo-custom-action.png" />

Set the **Action name** (e.g. `Made a Purchase`). Save the rule.

<img src="https://mintcdn.com/typecastleinc/rWC4pMP5Mv_G5OWc/images/integrations/yotpo/made-a-purchase.png?fit=max&auto=format&n=rWC4pMP5Mv_G5OWc&q=85&s=ea21fc862981ba95431a834337cb4cb3" alt="yotpo made a purchase earning rule" className="rounded-lg border border-gray-100" width="1556" height="926" data-path="images/integrations/yotpo/made-a-purchase.png" />

Keep the **Action name** value handy — you'll use the exact same string in the matching Subtotal action.

<Note>
  Subtotal pre-computes the points for each purchase and sends the value to Yotpo, so the points configured on this Yotpo rule are always overridden. You can leave the rule's points at a placeholder value (e.g. `1`) — the actual reward is calculated in Subtotal.
</Note>

## Add the action in Subtotal

In the Subtotal Dashboard, navigate to your [Yotpo integration](https://dashboard.subtotal.com/integrations/yotpo) and click `Add action`.

Choose `purchase.created` as the event, and set **Action name** to the same value you used on your Yotpo Custom Action. Optionally restrict to specific retailers, set **Points per dollar**, and set a **Start date**. Subtotal will only reward purchases made on or after the start date — this controls how much historical purchase data gets sent to Yotpo when a customer first links their account.

<img src="https://mintcdn.com/typecastleinc/ghrkNc71FS27YDpM/images/integrations/yotpo/yotpo-purchase-action.png?fit=max&auto=format&n=ghrkNc71FS27YDpM&q=85&s=ef3b2dce1604a065fea91d402cea5ca9" alt="add purchase.created action in subtotal" className="rounded-lg border border-gray-100" width="576" height="552" data-path="images/integrations/yotpo/yotpo-purchase-action.png" />

Click `Create`. Subtotal will now trigger the matching Custom Action in Yotpo for each qualifying purchase it collects.

<Warning>
  Subtotal computes the point value for each purchase as `ceil(items_subtotal × points_per_dollar)` — where `items_subtotal` is the sum of `price × quantity` for each item Subtotal collects from the receipt — and sends the resulting integer to Yotpo as `reward_points`. Taxes, shipping, and other fees are not included. One Yotpo custom action event is posted per qualifying purchase.
</Warning>
