Skip to main content
POST
/
v1
/
loyalties
/
{campaignId}
/
tiers
Create loyalty tiers
curl --request POST \
  --url https://{cluster}.voucherify.io/v1/loyalties/{campaignId}/tiers \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '[
  {
    "name": "<string>",
    "earning_rules": {},
    "rewards": {},
    "points": {
      "from": 123,
      "to": 123
    },
    "metadata": {}
  }
]'
[
  {
    "name": "<string>",
    "earning_rules": {},
    "rewards": {},
    "points": {
      "from": 123,
      "to": 123
    },
    "id": "<string>",
    "campaign_id": "<string>",
    "metadata": {},
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "config": {
      "points": {
        "from": 123,
        "to": 123
      }
    },
    "expiration": {
      "customer_id": "cust_7iUa6ICKyU6gH40dBU25kQU1",
      "campaign_id": "camp_rRsfatlwN7unSeUIJDCYedal",
      "tier_id": "<string>",
      "start_date": "<string>",
      "expiration_date": "<string>",
      "created_at": "2021-12-22T10:13:06.487Z",
      "updated_at": "2021-12-22T10:13:06.487Z"
    },
    "object": "loyalty_tier"
  }
]

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 loyalty campaign ID or name.

Example:

"camp_rRsfatlwN7unSeUIJDCYedal"

Body

application/json · Loyalty Tier Base · object[]

Provide tier definitions you want to add to existing loyalty campaign.

Request body schema for POST v1/loyalties/{campaignId}/tiers

name
string
required

Loyalty Tier name.

points
object
required

Defines range of loyalty tier in points.

earning_rules
object

Contains a list of earning rule IDs and their points mapping for the given earning rule.

rewards
object

Contains a list of reward IDs and their points mapping for the given reward.

metadata
object

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

Response

200 - application/json

Returns created loyalty tiers.

Response body schema for POST v1/loyalties/{campaignId}/tiers.

name
string
required

Loyalty Tier name.

points
object
required

Defines range of loyalty tier in points.

id
string
required

Unique loyalty tier ID.

campaign_id
string
required

Unique parent campaign ID.

metadata
object | null
required

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

created_at
string<date-time>
required

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

config
object
required

Defines loyalty tier range in points.

object
enum<string>
default:loyalty_tier
required

The type of the object represented by JSON. This object stores information about the loyalty.

Available options:
loyalty_tier
earning_rules
object

Contains a list of earning rule IDs and their points mapping for the given earning rule.

rewards
object

Contains a list of reward IDs and their points mapping for the given reward.

updated_at
string<date-time> | null

Timestamp representing the date and time when the loyalty tier was updated. The value is shown in the ISO 8601 format.

expiration
object

Defines loyalty tier expiration date.

I