> ## 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 Okendo to reward points when customers make retail purchases.

## Create a custom earning rule in Okendo

In your Okendo admin, navigate to the Loyalty Program and create a new custom earning rule for purchases.

Set the **Action Type** to **Award a variable amount of points** and configure the **Points Earned** rate (e.g. `1` point per `1` dollar). Subtotal will pass the purchase total as the `value`, and Okendo will multiply by your configured rate to determine points awarded.

<img src="https://mintcdn.com/typecastleinc/DCqLBIGMD9FcP8hN/images/integrations/okendo/okendo-reward-purchase.png?fit=max&auto=format&n=DCqLBIGMD9FcP8hN&q=85&s=f5e60f4e9014ed13126467004f32c334" alt="okendo make a retail purchase earning rule" className="rounded-lg border border-gray-100" width="983" height="860" data-path="images/integrations/okendo/okendo-reward-purchase.png" />

Save the rule, then copy its `Action ID` — you'll need it in the next step.

<Note>
  Points are calculated by Okendo using the **Points Earned** rate configured on this rule. Subtotal sends the raw dollar amount of the purchase; the conversion to points happens on Okendo's side.
</Note>

## Add the action in Subtotal

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

Choose `purchase.created` as the event, give the action a name, optionally restrict to specific retailers, paste the Okendo earning rule's `Action ID` into the **Okendo earning rule ID** field, 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 Okendo when a customer first links their account.

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

Click `Create`. Subtotal will now trigger this earning rule for each purchase it collects on a linked account.
