69be73b5cff0

latestOpenAPI 3.1.0raw.githubusercontent.com2026-08-101025471.3 MB
Earning Rules

Create earning rule

<Info>

<Badge color="gray">Documentation in progress</Badge>

This documentation is in progress. The parameters, fields, request and response bodies, and other data may be subject to change. If you need more information or you want to share feedback, contact Voucherify support or your Technical Account Manager.

</Info>

Creates a new earning rule. When status is omitted the rule is created as DRAFT. When validity_hours is omitted it defaults to { "type": "ANY_TIME" }. When trigger_limits is omitted it defaults to { "cooldown": { "type": "NO_COOLDOWN" }, "frequency": { "type": "NO_LIMIT" } }.

post/v2/loyalties/earning-rules

Request body

namestring required

Earning rule name.

status'DRAFT' | 'ACTIVE'

Initial status. Only DRAFT and ACTIVE are allowed at creation. Defaults to DRAFT.

start_datestring date-time nullable

Date-time from which the rule is active. Can be null.

end_datestring date-time nullable

Date-time until which the rule is active. Can be null.

metadataMetadata

Arbitrary key-value metadata; any JSON object is accepted.

Response

Earning rule created

idstring

Earning rule ID (lern_...).

namestring

Earning rule name.

status'DRAFT' | 'ACTIVE' | 'INACTIVE'

Current status. DELETED also exists internally but deleted rules are excluded from API reads.

start_datestring date-time nullable

Date-time from which the rule is active. Can be null.

end_datestring date-time nullable

Date-time until which the rule is active. Can be null.

metadataMetadata

Arbitrary key-value metadata; any JSON object is accepted.

created_atstring date-time

Creation timestamp (ISO 8601).

updated_atstring date-time nullable

Last update timestamp (ISO 8601). null when never updated.

object'earning_rule'

Object type marker. Always earning_rule.