Get Earning Rule
curl --request GET \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/earning-rules/{earningRuleId} \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "ern_abvbD0d7Wv4hgr3fTElLb38G",
"created_at": "2022-02-07T08:19:41.810Z",
"updated_at": null,
"validation_rule_id": null,
"loyalty": {
"points": 2,
"type": "FIXED"
},
"custom_event": {
"schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R"
},
"event": "saw_on_facebook",
"source": {
"banner": "Saw on Facebook Timeframe",
"object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3",
"object_type": "campaign"
},
"active": true,
"start_date": "2022-02-07T08:30:00.000Z",
"validity_timeframe": {
"duration": "PT1H",
"interval": "P1D"
},
"object": "earning_rule",
"automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA"
}Get Earning Rule
deprecated
Legacy loyalty API
This endpoint belongs to the legacy loyalty API (/v1/loyalties).
Voucherify will not develop new features for this API. However, critical issues may still receive fixes.
For new integrations, use Loyalty v2.
If you have questions, contact Voucherify support.
Retrieves an earning rule assigned to a campaign.
GET
/
v1
/
loyalties
/
{campaignId}
/
earning-rules
/
{earningRuleId}
Get Earning Rule
curl --request GET \
--url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/earning-rules/{earningRuleId} \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "ern_abvbD0d7Wv4hgr3fTElLb38G",
"created_at": "2022-02-07T08:19:41.810Z",
"updated_at": null,
"validation_rule_id": null,
"loyalty": {
"points": 2,
"type": "FIXED"
},
"custom_event": {
"schema_id": "ms_7JRYC8jXbezBV8AvGYGA0b5R"
},
"event": "saw_on_facebook",
"source": {
"banner": "Saw on Facebook Timeframe",
"object_id": "camp_Pfja7X91b1GoyH5wnpzCwlP3",
"object_type": "campaign"
},
"active": true,
"start_date": "2022-02-07T08:30:00.000Z",
"validity_timeframe": {
"duration": "PT1H",
"interval": "P1D"
},
"object": "earning_rule",
"automation_id": "auto_WTxNMXGJMS5ZdU9oZip3AzuA"
}Authorizations
X-App-Id & X-App-TokenX-Voucherify-OAuth
Scopes
Path Parameters
Response
200 - application/json
Returns an earning rule object with the earning rule details.
Response body schema for GET v1/loyalties/{campaignId}/earning-rules/{earningRuleId}.
- Define fixed amount of points
- Order Amount
- Order Total Amount
- Order Metadata
- Order Items Quantity
- Order Items Amount
- Order Items Subtotal Amount
- Define amount of points proportional to customer metadata
- Earning Rule Proportional Custom Event
Show child attributes
Show child attributes
A flag to toggle the earning rule on or off. You can disable an earning rule even though it's within the active period defined by the start_date and expiration_date of the campaign or the earning rule's own start_date and expiration_date.
trueindicates an active earning rulefalseindicates an inactive earning rule

