> ## Documentation Index
> Fetch the complete documentation index at: https://voucherify-rc-lv2-guides.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Earning rules: Overview

> Understand how earning rules define when and how Loyalty v2 members earn points or receive benefits

An earning rule defines when a member earns points or receives another configured result for something they did. Each earning rule combines a trigger, optional conditions, and one or more earnings. Voucherify evaluates a member's earning rules and applies the first matching earning configuration for the triggering event.

## Triggers

An earning rule reacts to one of three triggers:

* **Order paid**: Triggered after an order is successfully paid and can calculate points proportionally to the order or item amounts.
* **Custom event**: Triggered when a selected custom event is sent to Voucherify.
* **Segment entered**: Triggered when a member enters a selected customer segment.

## Conditions and earnings

Beyond the trigger itself, a rule can require that the member belongs to a specific loyalty tier, or that the triggering event meets additional criteria (for example, a minimum order amount). Each earning inside the rule then defines its effect, typically adding points to a point wallet, but an earning can also grant a benefit instead of points. A single rule can hold multiple earnings, evaluated in order, with the first matching one applied.

Additionally, you can override the general point expiration settings set for a card definition by setting a custom expiration rules for the points earned by an earning rule.

## Trigger limits

Trigger limits control how often a rule is allowed to fire for the same member: A cooldown period between triggers, and/or a frequency cap over a time window. When omitted, a rule defaults to no cooldown and no frequency limit, meaning it can fire every time its trigger occurs.

## Lifecycle

An earning rule is created in `DRAFT` status unless `status` is specified explicitly. From there:

* `DRAFT` or `INACTIVE` > `ACTIVE` with the [activate endpoint](/api-reference/earning-rules/activate-earning-rule).
* `ACTIVE` > `INACTIVE` with the [deactivate endpoint](/api-reference/earning-rules/deactivate-earning-rule).
* `ACTIVE` > `DRAFT` with the [draft endpoint](/api-reference/earning-rules/move-earning-rule-to-draft).

Once a rule leaves `DRAFT`, only a some of its properties can still be changed, like name, earnings, error handling, validity hours, start/end dates, trigger limits, and metadata. However, trigger and condition definitions can't be edited. Deleting a rule performs a soft delete and keeps its last state for reference. You can delete only an earning rule that's not currently assigned to a program.

## Assigning earning rules to a program

Earning rules are created independently of any program and connected through the [Programs](/api-reference/loyalty-v2-programs-overview) batch assignment endpoint. Unlike card definitions, earning rules can be assigned or unassigned while the program is `ACTIVE`, as long as the program keeps at least one active earning rule.

## Related resources

* [Loyalty v2 API: Overview](/api-reference/loyalty-v2-api-overview) for the full Loyalty v2 API map.
* [Programs overview](/api-reference/loyalty-v2-programs-overview) for overall program management.
* [Benefits overview](/api-reference/loyalty-v2-benefits-overview) for the benefit effect an earning can grant.
* [Examine overview](/api-reference/loyalty-v2-examine-overview) to simulate what an earning rule would grant before it fires.
* [Reports overview](/api-reference/loyalty-v2-reports-overview) for program and member earning-rule usage statistics.
* [Create earning rules](/build/create-earning-rules) for the dashboard perspective on earning rules.
