Skip to main content
POST
Create Earning Rule

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

X-App-Id
string
header
required
X-App-Token
string
header
required

Body

application/json
name
string
required

Human-readable name for the earning rule.

Required string length: 1 - 200
trigger
object
required
earnings
object[]
required

Array of earning definitions, each with optional rules and required effects.

Minimum array length: 1
status
enum<string>
default:DRAFT

Initial status. Defaults to DRAFT.

Available options:
DRAFT,
ACTIVE
error
object | null

Custom error message shown when earning rule conditions are not met.

validity_hours
object | null

Time-of-day restrictions for when the rule is active.

start_date
string<date-time> | null

Start date for rule validity (ISO 8601).

end_date
string<date-time> | null

End date for rule validity (ISO 8601).

trigger_limits
object | null

Cooldown and frequency limits for how often the rule can trigger per customer.

metadata
object | null

Custom key-value metadata.

Response

Earning rule created successfully.

id
string
required

Unique earning rule identifier.

name
string
required
status
enum<string>
required
Available options:
DRAFT,
ACTIVE,
INACTIVE,
DELETED
earnings
object[]
required
trigger
object
required
metadata
object
required
created_at
string<date-time>
required
object
string
required
Allowed value: "earning_rule"
error
object | null
validity_hours
object | null
start_date
string<date-time> | null
end_date
string<date-time> | null
trigger_limits
object | null
updated_at
string<date-time> | null
Last modified on May 19, 2026