POST
/
price-engine
/
actions
/
evaluate-products-by-id
curl --request POST \
  --url https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '{
  "priceListId": 100275,
  "itemIds": [
    111111,
    222222
  ],
  "customer": {
    "id": "5e2cfb9b45570b000864c4b5",
    "segments": [
      {
        "name": "category",
        "value": [
          "GOLD",
          "YELLOW"
        ]
      },
      {
        "name": "ageGroup",
        "value": [
          "elderly"
        ]
      }
    ]
  },
  "priceParameters": [
    {
      "additionalProperties": [
        {
          "id": "length",
          "value": 10
        },
        {
          "id": "width",
          "value": 20
        }
      ],
      "selectedAddOns": [
        "blind_motor"
      ],
      "quantity": 500,
      "itemId": 12345
    }
  ],
  "isAudit": true,
  "locale": "en-US"
}'
{
  "errors": [],
  "data": [
    {
      "priceListId": 100275,
      "itemId": 11111111,
      "currency": "USD",
      "channelId": "12",
      "offer": {
        "price": {
          "sale": 1000.15,
          "cost": 900.15,
          "base": 2000.15,
          "unitPriceWithoutDiscounts": 2000.15,
          "lineTotalWithoutDiscounts": 2000.15,
          "lineTotalWithDiscounts": 2000.15,
          "type": "BASE"
        },
        "discounts": [
          {
            "amount": 100.15,
            "quantity": 1,
            "application": 1,
            "promotion": {
              "id": "6197ec46e836ff000952d668",
              "value": 2000.15,
              "groupId": "61a6354d0d70e30009415f16",
              "level": 1,
              "isStackable": true,
              "isAlwaysApplied": true,
              "name": "20% OFF",
              "type": "Coupon",
              "discountType": "AMOUNT_OFF",
              "stackingType": "STACKABLE",
              "promotionMessages": [
                {
                  "promoId": "6197ec46e836ff000952c666",
                  "title": "Get 50% off socks when buying shoes!",
                  "message": "Buy any pair of shoes and get 50% off a pair of socks.",
                  "locales": [
                    "en-US",
                    "en-GB"
                  ],
                  "pages": [
                    "PDP",
                    "CART"
                  ],
                  "type": "DISCOUNT"
                }
              ]
            }
          }
        ],
        "suggestedProducts": [
          {
            "promotionId": "6197ec46e836ff000952c668",
            "promotionName": "Buy Shoes, get socks 50% off",
            "itemIds": [
              10021,
              10022,
              10023
            ],
            "eligiblePriceLists": [
              10000
            ],
            "isFree": false,
            "discountType": "PERCENTAGE_OFF",
            "amount": 50,
            "quantity": 1
          }
        ],
        "promotionMessages": [
          {
            "promoId": "6197ec46e836ff000952c667",
            "threshold": 3,
            "message": "Add another pair of shoes to get free socks!",
            "locales": [
              "en-US",
              "en-GB"
            ],
            "type": "PROXIMITY"
          },
          {
            "promoId": "6197ec46e836ff000952c668",
            "title": "Get free socks!",
            "message": "Buy two pairs of shoes and get a pair of socks for free!",
            "locales": [
              "en-US",
              "en-GB"
            ],
            "pages": [
              "PDP",
              "Cart"
            ],
            "type": "POTENTIAL_DISCOUNT"
          }
        ],
        "additionalAttributes": [
          {}
        ]
      },
      "audit": {
        "userId": "62f5e25ca090100009c6e0f0",
        "priceMethodType": "SurfaceArea_Square_Increment",
        "quantity": 50,
        "priceParameters": {
          "additionalProperties": [
            {
              "id": "length",
              "value": 10
            },
            {
              "id": "width",
              "value": 20
            }
          ]
        },
        "appliedAddons": [
          {
            "name": "blind-motor",
            "value": 100
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-fabric-tenant-id
string
required

A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.

Required string length: 24
x-fabric-date
string

The Date and time, in ISO 8601 format, for which the evaluation should be done. The prices and promotions that are active on this date will be considered for evaluation.

Example:

"2022-09-06T14:07:17.000Z"

x-fabric-request-id
string

A unique request ID.

Example:

"263e731c-45c8-11ed-b878-0242ac120002"

x-fabric-channel-id
string

x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.

Example:

"12"

Body

application/json

A sample request to evaluate the prices of products by item IDs.

Response

200
application/json

OK

Sample response including successful retrievals and potential errors.