Skip to main content
PUT
/
v1
/
promotions
/
tiers
/
{promotionTierId}
Update Promotion Tier
curl --request PUT \
  --url https://{cluster}.voucherify.io/v1/promotions/tiers/{promotionTierId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>' \
  --data '{
  "name": "Order more than $100 USD",
  "banner": "Order more than $100 USD",
  "action": {
    "discount": {
      "type": "PERCENT",
      "percent_off": 25,
      "effect": "APPLY_TO_ORDER"
    }
  },
  "metadata": {
    "level": "A-21"
  },
  "hierarchy": 1,
  "start_date": "2022-09-22T00:00:00.000Z",
  "expiration_date": "2022-09-29T00:00:00.000Z",
  "validity_timeframe": {
    "interval": "P3D",
    "duration": "P2D"
  },
  "validity_day_of_week": [
    1,
    2,
    3
  ]
}'
{
  "id": "promo_hINAfBAVhmFuSAzi3vptfyxW",
  "created_at": "2022-09-22T12:40:23.286Z",
  "updated_at": "2022-09-22T12:40:58.626Z",
  "name": "Order more than $100 USD",
  "banner": "Order more than $100 USD",
  "action": {
    "discount": {
      "type": "PERCENT",
      "percent_off": 25,
      "effect": "APPLY_TO_ORDER"
    }
  },
  "metadata": {
    "level": "A-21"
  },
  "hierarchy": 1,
  "campaign": {
    "id": "camp_VEL7UX0jZjrvLx3hfNZBVzpq",
    "start_date": "2022-09-21T00:00:00.000Z",
    "expiration_date": "2022-09-30T00:00:00.000Z",
    "validity_day_of_week": [
      1,
      2,
      3,
      4,
      5
    ],
    "active": true,
    "object": "campaign"
  },
  "campaign_id": null,
  "active": false,
  "start_date": "2022-09-22T00:00:00.000Z",
  "expiration_date": "2022-09-29T00:00:00.000Z",
  "validity_timeframe": {
    "interval": "P3D",
    "duration": "P2D"
  },
  "validity_day_of_week": [
    1,
    2,
    3
  ],
  "summary": {
    "redemptions": {
      "total_redeemed": 0
    },
    "orders": {
      "total_amount": 0,
      "total_discount_amount": 0
    }
  },
  "object": "promotion_tier",
  "validation_rule_assignments": {
    "object": "list",
    "data_ref": "data",
    "data": [
      {
        "id": "asgm_8e3e53ZgDNcoRGAI",
        "rule_id": "val_q8qUBMOh5qIQ",
        "related_object_id": "promo_hINAfBAVhmFuSAzi3vptfyxW",
        "related_object_type": "promotion_tier",
        "created_at": "2022-09-22T12:40:23.286Z",
        "object": "validation_rules_assignment"
      }
    ],
    "total": 1
  }
}

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

promotionTierId
string
required

Unique promotion tier ID.

Example:

"promo_2EnAik6Jt7dKTOMkRTIgEjZH"

Body

application/json

Specify the promotion tier parameters that you would like to update.

Request body schema for PUT v1/promotions/tiers/{promotionTierId}. This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.

name
string

Name of the promotion tier.

banner
string

Text to be displayed to your customers on your website.

action
object

Contains details about the discount applied by the promotion tier.

metadata
object

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

hierarchy
integer

The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy.

start_date
string<date-time>

Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is inactive before this date.

Example:

"2022-09-23T00:00:00.000Z"

expiration_date
string<date-time>

Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is inactive after this date.

Example:

"2022-09-26T00:00:00.000Z"

validity_timeframe
object

Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

validity_day_of_week
enum<integer>[]

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
validity_hours
object

Determines the hours of validity, e.g. to create a happy hours scenario.

validation_rule_assignments
object

Validation Rule Assignments List

category
string

Assign a new or update the promotion tier's category using name.

Example:

"cat_0c9da30e7116ba6bba"

category_id
string

Assign a new or update the promotion tier's category using id

Example:

"cat_0c9da30e7116ba6bba"

Response

200 - application/json

Returns a promotion tier object if the update was successful.

Response body schema for PUT v1/promotions/tiers/{promotionTierId}. This is an object representing a promotion tier. Promotion tiers are always assigned to a campaign and cannot be used standalone.

id
string

Unique promotion tier ID.

Example:

"promo_63fYCt81Aw0h7lzyRkrGZh9p"

created_at
string<date-time>

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

Example:

"2021-12-15T11:34:01.333Z"

updated_at
string<date-time>

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

Example:

"2022-02-09T09:20:05.603Z"

name
string

Name of the promotion tier.

banner
string

Text to be displayed to your customers on your website.

action
object

Contains details about the discount applied by the promotion tier.

metadata
object

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

hierarchy
integer

The promotions hierarchy defines the order in which the discounts from different tiers will be applied to a customer's order. If a customer qualifies for discounts from more than one tier, discounts will be applied in the order defined in the hierarchy.

promotion_id
string

Promotion unique ID.

campaign
object

Contains details about promotion tier's parent campaign.

campaign_id
string

Promotion tier's parent campaign's unique ID.

active
boolean

A flag to toggle the promotion tier on or off. You can disable a promotion tier even though it's within the active period defined by the start_date and expiration_date.

  • true indicates an active promotion tier
  • false indicates an inactive promotion tier
start_date
string<date-time>

Activation timestamp defines when the promotion tier starts to be active in ISO 8601 format. Promotion tier is inactive before this date.

Example:

"2022-09-23T00:00:00.000Z"

expiration_date
string<date-time>

Activation timestamp defines when the promotion tier expires in ISO 8601 format. Promotion tier is inactive after this date.

Example:

"2022-09-26T00:00:00.000Z"

validity_timeframe
object

Set recurrent time periods when the earning rule is valid. For example, valid for 1 hour every other day.start_date required when including the validity_timeframe.

validity_day_of_week
enum<integer>[]

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
validity_hours
object

Determines the hours of validity, e.g. to create a happy hours scenario.

summary
object

Contains statistics about promotion tier redemptions and orders.

object
string
default:promotion_tier

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

validation_rule_assignments
object

Validation Rule Assignments List

category_id
string

Promotion tier category ID.

Example:

"cat_0c9da30e7116ba6bba"

categories
Category · object[]
I