POST
/
api-price
/
promo
/
validate
curl --request POST \
  --url https://prod01-apigw.{customer_name}.fabric.zone/api-price/promo/validate \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '{
  "isLoggedIn": false,
  "userId": "5e2cfb9b45570b000864c4b5",
  "promoCodes": [
    "300DOFF"
  ],
  "items": [
    {
      "lineItemId": 1,
      "sku": "SKU0001",
      "itemId": 1000000119,
      "group": [
        "5e2cfb9b45570b000863c4b5"
      ],
      "quantity": 3,
      "price": {
        "base": 1000,
        "sale": 0,
        "currency": "USD"
      }
    }
  ]
}'
{
  "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"
        }
      ],
      "discountQuantity": 3,
      "discountAmount": 5070
    }
  ],
  "appliedDiscounts": [
    {
      "promoId": "5faaac2dd49ffe00071e4f8d",
      "promoTitle": "inclsion promo 99 P off ",
      "type": "PROMOTION-SKU"
    }
  ],
  "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."
    }
  ]
}

Headers

x-site-context
string
required

The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

Body

application/json

A JSON object containing information to apply eligible promotions to cart items.

The body is of type object.

Response

200
application/json

Successful

The response is of type object.