v1

latestOpenAPI 3.0.1MIT2026-07-263151,3912.3 MB
Loyalties

Disable Earning Rule

Disable an earning rule.

post/v1/loyalties/{campaignId}/earning-rules/{earningRuleId}/disable

Response

Returns an earning rule object with the active parameter set to false.

idstring required

Assigned by the Voucherify API, identifies the earning rule object.

created_atstring date-time required

Timestamp representing the date and time when the earning rule was created. The value is shown in the ISO 8601 format.

eventstring
object'earning_rule' required

The type of the object represented by JSON. Default is earning_rule.

automation_idstring required

For internal use by Voucherify.

start_datestring

Start date defines when the earning rule starts to be active. Activation timestamp is presented in the ISO 8601 format. The earning rule is inactive before this date. If you do not define the start date for an earning rule, it will inherit the campaign start date by default.

expiration_datestring

Expiration date defines when the earning rule expires. Expiration timestamp is presented in the ISO 8601 format. The earning rule is inactive after this date. If you do not define the expiration date for an earning rule, it will inherit the campaign expiration date by default.

validity_day_of_weekinteger[]

Integer array corresponding to the particular days of the week in which the voucher is valid.

  • 0 Sunday
  • 1 Monday
  • 2 Tuesday
  • 3 Wednesday
  • 4 Thursday
  • 5 Friday
  • 6 Saturday
metadataobject required

The metadata object stores all custom attributes assigned to the earning rule. A set of key/value pairs that you can attach to an earning rule object. It can be useful for storing additional information about the earning rule in a structured format.

updated_atstring date-time nullable required

Timestamp representing the date and time when the earning rule was last updated in ISO 8601 format.

activeboolean required

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.

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"
      }
    ]
  }
}