Earning Rules

Create, retrieve, update, delete, and list the rules that govern how customers earn loyalty points.

View as Markdown

An earning rule defines how customers accumulate points in response to platform events. The most common rule awards one point per unit of currency spent when a payment succeeds.

Illustrative content. Hand-authored to demonstrate the Standard/Advanced pattern; the production page will be generated from the VINR OpenAPI spec (roadmap item #1). Field names are representative.

The earning rule objectAsk

idstring

Unique identifier for the earning rule, e.g. er_2Gb7wJ.

namestring

Human-readable label for the rule, e.g. 1 point per €1 spent.

eventstring

The platform event that triggers point accrual, e.g. payment.succeeded.

points_per_unitinteger

Number of points awarded for each qualifying unit of the triggering event.

unit_valueinteger

The size of one unit in the smallest currency denomination (e.g. 100 = 100 cents = €1). Points are awarded in proportion to amount / unit_value.

activeboolean

Whether the rule is currently applied when the trigger event fires.

createdinteger

Unix timestamp of when the earning rule was created.

Create an earning ruleAsk

Define a new rule. Rules take effect immediately for subsequent trigger events once active is set to true.

Retrieve an earning ruleAsk

Fetch an earning rule by its ID.

Update an earning ruleAsk

Adjust the earning rate or pause a rule by setting active: false.

Delete an earning ruleAsk

Permanently deletes an earning rule. Existing points transactions created by this rule are not affected.

List earning rulesAsk

Returns a paginated list of earning rules. Pass active=true to return only currently live rules.

ParameterTypeDescription
activebooleanFilter by active status. Omit to return all rules.
limitintegerNumber of results to return. Default 10, max 100.

earning_rule.created, earning_rule.updated, and earning_rule.deleted. See Events.

Was this page helpful?