Skip to main content
GET
/
v1
/
loyalties
/
{campaignId}
/
tiers
/
{loyaltyTierId}
/
earning-rules
List Loyalty Tier Earning Rules
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
  "object": "list",
  "data_ref": "data",
  "data": [
    {
      "id": "ern_95aq3JaE5A8xzHjoJPYNRqXZ",
      "created_at": "2022-11-09T06:26:54.332Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOMER_METADATA",
        "customer": {
          "metadata": {
            "every": 1,
            "points": 300,
            "property": "customer_life_time_value"
          }
        }
      },
      "event": "customer.loyalty.tier.joined",
      "loyalty_tier": {
        "id": "__ANY__"
      },
      "source": {
        "banner": "Tier Joined",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_bfi69WIbztany4iX6prkKbGN",
      "metadata": {
        "Type": "Joined Any"
      }
    },
    {
      "id": "ern_HnRXyJHoj3E79r3KUWhgMgtD",
      "created_at": "2022-11-10T12:25:12.927Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "points": 300,
        "type": "FIXED"
      },
      "segment": {
        "id": "seg_n3vVcU5t0m3rs4rEPr3C1oU5"
      },
      "event": "customer.segment.entered",
      "source": {
        "banner": "New Customers",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_0gv3v7jQG5U6TtVC8bMEdIap",
      "metadata": {}
    },
    {
      "id": "ern_raVUcdXruvXGuzm682ESrAzt",
      "created_at": "2022-11-24T09:03:14.534Z",
      "updated_at": "2022-11-25T09:48:26.284Z",
      "validation_rule_id": "val_7SxpdhPeBngA",
      "loyalty": {
        "points": 20,
        "type": "FIXED"
      },
      "event": "order.paid",
      "source": {
        "banner": "Order has been paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "start_date": "2022-11-23T00:00:00.000Z",
      "expiration_date": "2022-11-30T00:00:00.000Z",
      "validity_day_of_week": [
        1,
        2,
        3,
        4,
        5
      ],
      "object": "earning_rule",
      "automation_id": "auto_MbEIyLbn7pHyba5Qw5eeb35L",
      "metadata": {
        "Type": "Order has been paid - Fixed"
      }
    },
    {
      "id": "ern_BmDiQs7T3UHfJQqtI2RfJHFR",
      "created_at": "2022-11-24T14:48:36.567Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "ORDER_AMOUNT",
        "order": {
          "amount": {
            "every": 1000,
            "points": 1
          }
        }
      },
      "event": "order.paid",
      "source": {
        "banner": "Order paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_IKanVw37J6oFuRrdnryXw8Lz",
      "metadata": {
        "Type": "Order has been paid - Proportional - 1"
      }
    },
    {
      "id": "ern_jwtacKdEEHoc85QbouRw3CR8",
      "created_at": "2022-11-24T15:17:11.539Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "ORDER_TOTAL_AMOUNT",
        "order": {
          "total_amount": {
            "every": 1100,
            "points": 1
          }
        }
      },
      "event": "order.paid",
      "source": {
        "banner": "Order has been paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_Y6IWqhz0cHGkKcteU9PS5nmK",
      "metadata": {
        "Type": "Order has been paid - Proportional - 2"
      }
    },
    {
      "id": "ern_fxVdmtJ4u4rlyoH2hIq7m1PQ",
      "created_at": "2022-11-24T15:20:04.392Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "ORDER_METADATA",
        "order": {
          "metadata": {
            "every": 10,
            "points": 2,
            "property": "number_of_store_visits"
          }
        }
      },
      "event": "order.paid",
      "source": {
        "banner": "Order paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_HyowcdKQ0lsQ1rSxV5tyYr2z",
      "metadata": {
        "Type": "Order has been paid - Proportional - 3 - Metadata"
      }
    },
    {
      "id": "ern_Aop1wTrmPv4yBntDcvXNTCWR",
      "created_at": "2022-11-24T15:23:44.514Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "ORDER_ITEMS_AMOUNT",
        "order_items": {
          "amount": {
            "every": 1000,
            "points": 3,
            "object": "products_collection",
            "id": "pc_75U0dHlr7u75BJodrW1AE3t6"
          }
        }
      },
      "event": "order.paid",
      "source": {
        "banner": "Order paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_EXRyQ0z0rgtF54PKDGGAF1qg",
      "metadata": {
        "Type": "Order has been paid - Proportional - 4"
      }
    },
    {
      "id": "ern_4qSQVjfGEH7OmXKMzotS0juY",
      "created_at": "2022-11-24T15:44:45.301Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "ORDER_ITEMS_SUBTOTAL_AMOUNT",
        "order_items": {
          "subtotal_amount": {
            "every": 1000,
            "points": 4,
            "object": "sku",
            "id": "sku_0b7d7dfb090be5c619"
          }
        }
      },
      "event": "order.paid",
      "source": {
        "banner": "Order paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_ID3xLPXCdnOaveJYWiulcNFW",
      "metadata": {
        "Type": "Order has been paid - Proportional - 5 - Items"
      }
    },
    {
      "id": "ern_aJyt4wIrXhmfMxvrLoZjBYrP",
      "created_at": "2022-11-24T15:56:58.710Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "ORDER_ITEMS_AMOUNT",
        "order_items": {
          "amount": {
            "every": 10000,
            "points": 1,
            "object": "product",
            "id": "prod_0bae32322150fd0546"
          }
        }
      },
      "event": "order.paid",
      "source": {
        "banner": "Order paid",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_EbBqD1SNW70vgDp5icGbWl3e",
      "metadata": {}
    },
    {
      "id": "ern_v4Blmh9hA3gpnjo93cMAgvHr",
      "created_at": "2022-11-24T16:19:20.571Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOMER_METADATA",
        "customer": {
          "metadata": {
            "every": 1,
            "points": 5,
            "property": "customer_life_time_value"
          }
        }
      },
      "segment": {
        "id": "seg_OlE7DmfzMI5pHyD5VAv512r1"
      },
      "event": "customer.segment.entered",
      "source": {
        "banner": "Entered Segment",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_wMMDJ86iHKkznz9x0506e30E",
      "metadata": {}
    },
    {
      "id": "ern_L8dFanPxJzhw0f5voTwPurGP",
      "created_at": "2022-11-24T16:27:13.917Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "points": 3,
        "type": "FIXED"
      },
      "custom_event": {
        "schema_id": "ms_gn4Qe4xsFPf7orCArCiNVY13"
      },
      "event": "page_view",
      "source": {
        "banner": "Custom Event",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_9N69OJzGKGhp2mo7SNsnsF5b",
      "metadata": {
        "Type": "Fixed"
      }
    },
    {
      "id": "ern_ngdugZ2hzg35hGASFF8nDjUO",
      "created_at": "2022-11-24T16:41:48.830Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOM_EVENT_METADATA",
        "custom_event": {
          "metadata": {
            "every": 2,
            "points": 2,
            "property": "volume_number"
          }
        }
      },
      "custom_event": {
        "schema_id": "ms_qpRZ3EmRQyszNH6Z52Gkq8au"
      },
      "event": "user_subscribed",
      "source": {
        "banner": "Custom Event",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_v1eTxL7X63B5IkYgRWHK4leh",
      "metadata": {
        "Type": "Event"
      }
    },
    {
      "id": "ern_afo3Ea760hAKv07JYpycnhiE",
      "created_at": "2022-11-24T16:50:12.945Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOMER_METADATA",
        "customer": {
          "metadata": {
            "every": 3,
            "points": 3,
            "property": "customer_life_time_value"
          }
        }
      },
      "custom_event": {
        "schema_id": "ms_f0r4hcu5T0m3v3nT5ch3ma"
      },
      "event": "cart_abandoned",
      "source": {
        "banner": "Custom Event",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_7ovoKiXx49fe3nnhEbDlp9FP",
      "metadata": {}
    },
    {
      "id": "ern_chdlG14W8Sdcq3d6jJQQgRMT",
      "created_at": "2022-11-24T16:51:31.595Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "points": 1,
        "type": "FIXED"
      },
      "event": "customer.loyalty.tier.joined",
      "loyalty_tier": {
        "id": "__ANY__"
      },
      "source": {
        "banner": "Tier joined - Any",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_W9yMQTz5fgQTgmuu6pTVraBW",
      "metadata": {
        "Type": "Tier joined  - any - fixed"
      }
    },
    {
      "id": "ern_gVo6CHBduFPoh1hctASfXHLT",
      "created_at": "2022-11-24T17:01:42.809Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOMER_METADATA",
        "customer": {
          "metadata": {
            "every": 4,
            "points": 4,
            "property": "customer_life_time_value"
          }
        }
      },
      "event": "customer.loyalty.tier.joined",
      "loyalty_tier": {
        "id": "ltr_pudTGWasuIqxdiDM0go31OV1"
      },
      "source": {
        "banner": "Tier joined",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_wdlEo17wmoqYHGfilbayEUj7",
      "metadata": {
        "Type": "Tier joined - customer metadata - proportional"
      }
    },
    {
      "id": "ern_66OdCyLADv5IGFoQe18vGUwa",
      "created_at": "2022-11-24T17:03:59.414Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOMER_METADATA",
        "customer": {
          "metadata": {
            "every": 2,
            "points": 2,
            "property": "customer_life_time_value"
          }
        }
      },
      "event": "customer.loyalty.tier.left",
      "loyalty_tier": {
        "id": "ltr_7rVIPlPzdSFwpnbCcUXgwzH2"
      },
      "source": {
        "banner": "Tier left",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_czm5el1Uz1jeGaO97AYoDNAq",
      "metadata": {
        "Type": "Tier left"
      }
    },
    {
      "id": "ern_YR3fDfCjAmz9a5D68nk0i4dm",
      "created_at": "2022-11-25T07:29:38.961Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "type": "PROPORTIONAL",
        "calculation_type": "CUSTOMER_METADATA",
        "customer": {
          "metadata": {
            "every": 3,
            "points": 4,
            "property": "customer_life_time_value"
          }
        }
      },
      "event": "customer.loyalty.tier.upgraded",
      "loyalty_tier": {
        "id": "ltr_30KHciA0UG8B71Fo51GZqwgN"
      },
      "source": {
        "banner": "Tier upgraded",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_M1OdRH8spk6Fs7yTuPLN2LAv",
      "metadata": {
        "Type": "Upgraded"
      }
    },
    {
      "id": "ern_A2RArBE30Tkt56utVLrRv7rZ",
      "created_at": "2022-11-25T07:31:05.866Z",
      "updated_at": "2022-11-25T09:48:26.506Z",
      "validation_rule_id": "val_kfmWpfXMI9P1",
      "loyalty": {
        "points": 1,
        "type": "FIXED"
      },
      "event": "customer.loyalty.tier.downgraded",
      "loyalty_tier": {
        "id": "__ANY__"
      },
      "source": {
        "banner": "Tier Downgraded",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_TMVZtCNMBgZm0KcPJ7otiHZW",
      "metadata": {
        "Type": "Tier"
      }
    },
    {
      "id": "ern_AdlWO2yt6b6llWsibIdiRXVE",
      "created_at": "2022-11-25T07:31:42.767Z",
      "updated_at": null,
      "validation_rule_id": null,
      "loyalty": {
        "points": 25,
        "type": "FIXED"
      },
      "event": "customer.loyalty.tier.prolonged",
      "loyalty_tier": {
        "id": "__ANY__"
      },
      "source": {
        "banner": "Prolonged",
        "object_id": "camp_fkZ28pe7DUAEmmabofkxHI8N",
        "object_type": "campaign"
      },
      "active": true,
      "object": "earning_rule",
      "automation_id": "auto_4jH1yq9WJS0oJ8suagCrltyb",
      "metadata": {}
    }
  ],
  "total": 19
}

Authorizations

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

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

campaignId
string
required

Unique campaign ID or name.

Example:

"camp_rRsfatlwN7unSeUIJDCYedal"

loyaltyTierId
string
required

Unique loyalty tier ID.

Example:

"promo_2EnAik6Jt7dKTOMkRTIgEjZH"

Query Parameters

limit
integer

Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

Required range: 1 <= x <= 100
page
integer

Which page of results to return. The lowest value is 1.

Required range: 1 <= x <= 100

Response

200 - application/json

Returns a list of earning rules for a given tier. The object for each earning rule also contains information about how the points are calculated; this includes mapping. If a specific multiplier was used to calculate points for a given tier, then the loyalty.points parameter will account for this calculation.

Response body schema for GET v1/loyalties/{campaignId}/tiers/{loyaltyTierId}/earning-rules.

object
enum<string>
default:list
required

The type of the object represented by JSON. This object stores information about earning rules in a dictionary.

Available options:
list
data_ref
enum<string>
default:data
required

Identifies the name of the attribute that contains the array of earning rule objects.

Available options:
data
data
Earning Rule · object[]
required

Contains array of earning rule objects.

total
integer
required

Total number of earning rule objects.

I