Skip to main content
POST
/
v1
/
promotions
/
tiers
/
{tierId}
/
validation
curl --request POST \
--url https://{cluster}.voucherify.io/v1/promotions/tiers/{tierId}/validation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '{
"customer": {
"source_id": "test-user@email.io"
},
"order": {
"id": "ord_71uW6qnB5CFZlLHCeCNC4qtS"
}
}'
{
"valid": true,
"applicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"inapplicable_to": {
"data": [],
"total": 0,
"data_ref": "data",
"object": "list"
},
"tracking_id": "track_OWyBVb1mg1qnieLLNygh19A0Ia7FsJck",
"order": {
"id": "ord_71uW6qnB5CFZlLHCeCNC4qtS",
"source_id": null,
"created_at": "2022-11-17T12:17:55.096Z",
"updated_at": null,
"status": "CREATED",
"amount": 9918200,
"initial_amount": 468200,
"items_discount_amount": 9450000,
"total_discount_amount": 9450000,
"total_amount": 468200,
"items_applied_discount_amount": 9450000,
"total_applied_discount_amount": 9450000,
"items": [
{
"object": "order_item",
"source_id": "webinar_BF_sweater_pink_sweater",
"related_object": "product",
"quantity": 1,
"amount": 6500,
"price": 6500,
"subtotal_amount": 6500
},
{
"object": "order_item",
"source_id": "webinar_BF_pants_navy_sweat_pants",
"related_object": "product",
"quantity": 1,
"amount": 6000,
"price": 6000,
"subtotal_amount": 6000
},
{
"object": "order_item",
"source_id": "5h1pp1ng",
"related_object": "product",
"quantity": 1,
"amount": 2000,
"price": 2000,
"subtotal_amount": 2000,
"product": {
"id": "prod_5h1pp1ng",
"source_id": "5h1pp1ng",
"name": "Shipping"
}
},
{
"object": "order_item",
"source_id": "webinar_BF_pants_gray_sweat_pants",
"related_object": "product",
"quantity": 2,
"amount": 10000,
"price": 5000,
"subtotal_amount": 10000
},
{
"object": "order_item",
"source_id": "webinar_BF_sweater_pearl",
"related_object": "product",
"quantity": 2,
"amount": 22000,
"price": 11000,
"subtotal_amount": 22000
},
{
"object": "order_item",
"product_id": "prod_0b7d7dfb05cbe5c616",
"sku_id": "sku_0b7d7dfb090be5c619",
"quantity": 1,
"amount": 1700,
"price": 1700,
"subtotal_amount": 1700,
"product": {
"id": "prod_0b7d7dfb05cbe5c616",
"source_id": "Books",
"name": "Comic Books1",
"price": 2100
},
"sku": {
"id": "sku_0b7d7dfb090be5c619",
"source_id": "ComicBook_1",
"sku": "Comics1",
"price": 1700
}
},
{
"object": "order_item",
"product_id": "prod_0bae32322150fd0546",
"quantity": 2,
"amount": 420000,
"price": 210000,
"subtotal_amount": 420000,
"product": {
"id": "prod_0bae32322150fd0546",
"name": "Samsung Phone",
"price": 210000
}
},
{
"object": "order_item",
"product_id": "prod_0bae2dc5a090fd0184",
"sku_id": "sku_0bae3b28f610fd0da1",
"quantity": 45,
"discount_quantity": 45,
"initial_quantity": 0,
"amount": 9450000,
"discount_amount": 9450000,
"initial_amount": 0,
"applied_discount_amount": 9450000,
"price": 210000,
"subtotal_amount": 0,
"product": {
"id": "prod_0bae2dc5a090fd0184",
"source_id": "first_product",
"name": "Samsung Phone 1",
"price": 220000
},
"sku": {
"id": "sku_0bae3b28f610fd0da1",
"source_id": "first_product_sku_1",
"sku": "Samsung phone 256GB",
"price": 210000
}
}
],
"metadata": {},
"customer_id": null,
"referrer_id": null,
"object": "order"
},
"id": "promo_ZWkx6R0I1Ts3N9HL4kfTdxOm",
"name": "Add new SKU",
"discount": {
"type": "UNIT",
"effect": "ADD_NEW_ITEMS",
"unit_off": 45,
"unit_type": "sku_0bae3b28f610fd0da1",
"sku": {
"id": "sku_0bae3b28f610fd0da1",
"source_id": "first_product_sku_1",
"sku": "Samsung phone 256GB"
},
"product": {
"id": "prod_0bae2dc5a090fd0184",
"source_id": "first_product",
"name": "Samsung Phone 1"
}
},
"campaign": {
"id": "camp_40LC42P5NFbkkD4RWoJ4btks",
"start_date": null,
"expiration_date": null,
"active": true,
"object": "campaign"
},
"hierarchy": 4,
"discount_amount": 9450000,
"applied_discount_amount": 9450000,
"metadata": {},
"object": "promotion_tier"
}

Authorizations

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

Path Parameters

tierId
string
required

Body

application/json
customer
object
  • Customer ID
  • Customer Source ID
  • Customer
order
object
  • Order ID
  • Order Source ID
  • Order Customer And Referrer Ids Objects
metadata
object

Response

200 - application/json
  • Promotion Tier Valid
  • Promotion Tier Not Valid
valid
string
applicable_to
object
inapplicable_to
object
tracking_id
string
order
object
  • Order object - Effect: Apply to order
  • Order object - Effect: Apply to items
id
string
Example:
name
string
banner
string
Example:
discount
object
  • Amount Discount
  • Percent Discount
  • Fixed Discount
  • Unit Discount, Product
  • Unit Discount, SKU
  • Unit Discount, multiple items
  • Shipping Discount
start_date
string<date-time>
Example:
expiration_date
string<date-time>
Example:
campaign
object
hierarchy
integer
discount_amount
integer
applied_discount_amount
integer
metadata
object
object
string
default:promotion_tier