XM

Validate Promotions

Path:

POST /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 : {"stage":"dev02","account":"5f328bf0b7c15700071233b9","date":"","channel":12}

x-api-key: Av5xCBXsWo8EDGbNTHZ2r8J5XI5txqaqIITDxTE3

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: body

Name: validate-promo

Description: 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": 1000000119,
"group": [
"5e2cfb9b45570b000863c4b5"
],
"quantity": 3,
"price": {
"sale": 1000,
"cost": 0,
"currency": "USD",
"base": 5000,
"kind": "Promotion",
"discount": 0
},
"discount": [
{
"_id": "5f9be340dde1cd0008f96035",
"unit": "AMOUNT_OFF",
"value": 300,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5f9be340dde1cd0008f96035",
"promoId": "5f9be340dde1cd0008f96034",
"promoCode": "300DOFF",
"promoTitle": "SKU 300 D off all skus",
"type": "COUPON"
},
{
"_id": "5faa9c8bf6e1ad0007fb2f1f",
"unit": "%OFF",
"value": 70,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5faa9c8bf6e1ad0007fb2f1f",
"promoId": "5faa9c8bf6e1ad0007fb2f1e",
"promoTitle": "EXclusion promo quantity 70P off",
"type": "PROMOTION-QUANTITY"
},
{
"_id": "5faaac2dd49ffe00071e4f8e",
"unit": "%OFF",
"value": 99,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5faaac2dd49ffe00071e4f8e",
"type": "PROMOTION-SKU",
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off "
}
],
"discountQuantity": 3,
"discountAmount": 5070
}
],
"errors": [],
"appliedDiscounts": [
{
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off ",
"type": "PROMOTION-SKU"
},
{
"promoId": "5faa9c8bf6e1ad0007fb2f1e",
"promoTitle": "EXclusion promo quantity 70P off",
"type": "PROMOTION-QUANTITY"
},
{
"promoId": "5f9be340dde1cd0008f96034",
"promoCode": "300DOFF",
"promoTitle": "SKU 300 D off all skus",
"type": "COUPON"
}
],
"discounts": [
{
"_id": "5faaac2dd49ffe00071e4f8e",
"unit": "%OFF",
"value": 99,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5faaac2dd49ffe00071e4f8e",
"type": "PROMOTION-SKU",
"promoId": "5faaac2dd49ffe00071e4f8d",
"promoTitle": "inclsion promo 99 P off "
},
{
"_id": "5faa9c8bf6e1ad0007fb2f1f",
"unit": "%OFF",
"value": 70,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5faa9c8bf6e1ad0007fb2f1f",
"promoId": "5faa9c8bf6e1ad0007fb2f1e",
"promoTitle": "EXclusion promo quantity 70P off",
"type": "PROMOTION-QUANTITY"
},
{
"_id": "5f9be340dde1cd0008f96035",
"unit": "AMOUNT_OFF",
"value": 300,
"ON": {
"kind": "SKU",
"value": null
},
"id": "5f9be340dde1cd0008f96035",
"promoId": "5f9be340dde1cd0008f96034",
"promoCode": "300DOFF",
"promoTitle": "SKU 300 D off all skus",
"type": "COUPON"
}
]
}

HTTP Code: 406 Message: Promo not-stackable

Sample:

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

Changelog

*Last updated - March 2021