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-channel-id: <x-fabric-channel-id>' \
  --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"
            }
          }
        ],
        "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
          }
        ],
        "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
headerrequired

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

Headers

x-fabric-tenant-id
string
required

Merchant's 24-character tenant ID

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.

x-fabric-request-id
string

A unique request ID.

x-fabric-channel-id
string
required

The sales channel ID.

Body

application/json
priceListId
integer
required

The price list ID associated with the item.

itemIds
integer[]
required

A list of product IDs for which prices needs to be retrieved. You can specify up to 50 IDs at a time.

customer
object

Customer details

priceParameters
object[]

The parameters for price calculation

isAudit
boolean

A flag indicating whether the audit details should be included in the response. Set to true to include the audit details along with the price calculation details and set to false to exclude the audit details in the response.

locale
string

The language code, which is a combination of language (ISO 639 format) and country (ISO 3166 format). <br />Default value is en-US.

Response

200 - application/json
errors
object[]

Errors array

data
object[]