XM

Validate Promotions

Path:

POST https://{baseurl}/api-price/promo/validate

This API facilitates you to validate promotions for a customer, based on the specified item IDs.

Headers

Content-Type : application/json

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type: Body

Name: The criteria to validate promotions based on the item details along with promo codes.

Required: true

Sample Request

{
"isLoggedIn": false,
"userId": "5e2cfb9b45570b000864c4b5",
"promoCodes": ["300DOFF"],
"items": [
{
"lineItemId": 1,
"sku": "SKU0001",
"itemId": 1000000119,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"base": 1000,
"sale": 0,
"currency": "USD"
}
}
]
}

Response

HTTP Code: 200 Message: OK

Sample:

{
"isSuccess": true,
"items": [
{
"lineItemId": 1,
"sku": "SKU0001",
"itemId": 1000000227,
"priceListId": 10000003,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"base": 299,
"sale": 0,
"kind": "Promotion",
"discount": 295.67
},
"shippingPrice": 10,
"shippingMethodId": "string",
"discount": [
{
"promoId": "5f9be340dde1cd0008f96034",
"promoCode": "BLACKFRIDAY",
"promoTitle": "Blackfriday sale",
"type": "COUPON",
"unit": "AMOUNT_OFF",
"value": 10
}
],
"discountQuantity": 3,
"discountAmount": 10,
"shippingDiscount": 10
}
],
"appliedDiscounts": [
{
"promoId": "5f9be340dde1cd0008f96034",
"promoTitle": "Blackfriday sale",
"type": "COUPON"
}
]
}

HTTP Code: 406 Message: Promo not-stackable

Sample:

{
"code": "PROMO_NOT_STACKABLE",
"message": "NONSTACK promo not stackable."
}

Change Log

  • June - 2021

  • March - 2021 First updated