Loyalties
Create Earning Rule
Create earning rules for a loyalty campaign.
🚧 Maximum number of earning rules
You can create up to 100 earning rules per project. The limit can be customized for clients with a single-tenant setup.
post/v1/loyalties/{campaignId}/earning-rules
Request body
Example request
[
{
"validation_rule_id": "val_248vs7tUjlIE",
"source": {
"banner": "Order Paid - You will get 100 points"
},
"start_date": "2022-02-02T13:00:00.000Z",
"expiration_date": "2022-03-03T14:30:00.000Z",
"validity_timeframe": {
"duration": "PT1H",
"interval": "P2D"
},
"validity_hours": {
"daily": [
{
"start_time": "12:00",
"expiration_time": "14:00"
}
]
}
}
]Response
Returns an array of earning rule objects.
Example response
[
{
"event": "`order.paid`, `customer.segment.entered`, `customer.loyalty.tier.upgraded`, `customer.loyalty.tier.downgraded`, `customer.loyalty.tier.prolonged`, `customer.loyalty.tier.joined`, `customer.loyalty.tier.left`",
"loyalty_tier": {
"id": "ltr_pudTGWasuIqxdiDM0go31OV1"
},
"validity_timeframe": {
"duration": "PT1H",
"interval": "P2D"
},
"validity_hours": {
"daily": [
{
"start_time": "12:00",
"expiration_time": "14:00"
}
]
}
}
]