Delete earning rule
curl --request DELETE \
--url https://{cluster}.voucherify.io/v2/loyalties/earning-rules/{earningRuleId} \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "lern_133a8e898a959526c0",
"name": "Earning rule 2026-10-22-01",
"status": "DELETED",
"earnings": [
{
"id": "lernei_133a8e8988959526bf",
"tier_rules": {
"type": "NO_REQUIREMENTS"
},
"effects": [
{
"type": "POINTS",
"points": {
"value": 150,
"card_definition_id": "lcdef_1329efb2af8ba6486f"
}
}
]
}
],
"trigger": {
"event": "customer.order.paid"
},
"error": {
"message": "You don't know what's right!"
},
"validity_hours": {
"type": "ANY_TIME"
},
"start_date": null,
"end_date": null,
"trigger_limits": {
"cooldown": {
"type": "NO_COOLDOWN"
},
"frequency": {
"type": "NO_LIMIT",
"limits": []
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": []
}
},
"metadata": {},
"created_at": "2026-10-22T11:06:33.894Z",
"updated_at": null,
"object": "earning_rule"
}{
"code": 400,
"key": "resource_in_use",
"message": "Resource in use",
"details": "Resource earning_rule with id lern_133a907d1aca5d2b76 is in use by programs with ids [lprg_128f58429f4c4bf7b2]",
"request_id": "v-135b2cca60e4d56703",
"related_object_ids": [
"lprg_128f58429f4c4bf7b2"
],
"related_object_type": "program"
}{
"code": 404,
"key": "not_found",
"message": "Resource not found",
"details": "Cannot find earning_rule with id lern_133a907d1aca5d2b76",
"request_id": "v-0c8b6b35294af6f192",
"resource_id": "lern_133a907d1aca5d2b76",
"resource_type": "earning_rule"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Delete earning rule
Deletes an earning rule by setting status to DELETED and returns the deleted earning rule. Returns 400 (resource_in_use) when a program still references the earning rule.
A successful call records vl.earning_rule.deleted.
DELETE
/
v2
/
loyalties
/
earning-rules
/
{earningRuleId}
Delete earning rule
curl --request DELETE \
--url https://{cluster}.voucherify.io/v2/loyalties/earning-rules/{earningRuleId} \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>'{
"id": "lern_133a8e898a959526c0",
"name": "Earning rule 2026-10-22-01",
"status": "DELETED",
"earnings": [
{
"id": "lernei_133a8e8988959526bf",
"tier_rules": {
"type": "NO_REQUIREMENTS"
},
"effects": [
{
"type": "POINTS",
"points": {
"value": 150,
"card_definition_id": "lcdef_1329efb2af8ba6486f"
}
}
]
}
],
"trigger": {
"event": "customer.order.paid"
},
"error": {
"message": "You don't know what's right!"
},
"validity_hours": {
"type": "ANY_TIME"
},
"start_date": null,
"end_date": null,
"trigger_limits": {
"cooldown": {
"type": "NO_COOLDOWN"
},
"frequency": {
"type": "NO_LIMIT",
"limits": []
}
},
"earning_limits": {
"global": {
"type": "NO_LIMIT",
"limits": []
}
},
"metadata": {},
"created_at": "2026-10-22T11:06:33.894Z",
"updated_at": null,
"object": "earning_rule"
}{
"code": 400,
"key": "resource_in_use",
"message": "Resource in use",
"details": "Resource earning_rule with id lern_133a907d1aca5d2b76 is in use by programs with ids [lprg_128f58429f4c4bf7b2]",
"request_id": "v-135b2cca60e4d56703",
"related_object_ids": [
"lprg_128f58429f4c4bf7b2"
],
"related_object_type": "program"
}{
"code": 404,
"key": "not_found",
"message": "Resource not found",
"details": "Cannot find earning_rule with id lern_133a907d1aca5d2b76",
"request_id": "v-0c8b6b35294af6f192",
"resource_id": "lern_133a907d1aca5d2b76",
"resource_type": "earning_rule"
}{
"code": 500,
"key": "api_error",
"message": "Something went wrong. Don't worry, your campaigns are still safe and the Voucherify Team has been notified. Check out our Help Center and forums for help, or head back to home."
}Authorizations
X-App-Id & X-App-TokenbearerAuth
Path Parameters
Response
Deleted earning rule
Response body schema for DELETE /v2/loyalties/earning-rules/{earningRuleId}.

