Calculate prices for products by IDs
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"
}
'import requests
url = "https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id"
payload = {
"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"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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'
})
};
fetch('https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id"
payload := strings.NewReader("{\n \"priceListId\": 100275,\n \"itemIds\": [\n 111111,\n 222222\n ],\n \"customer\": {\n \"id\": \"5e2cfb9b45570b000864c4b5\",\n \"segments\": [\n {\n \"name\": \"category\",\n \"value\": [\n \"GOLD\",\n \"YELLOW\"\n ]\n },\n {\n \"name\": \"ageGroup\",\n \"value\": [\n \"elderly\"\n ]\n }\n ]\n },\n \"priceParameters\": [\n {\n \"additionalProperties\": [\n {\n \"id\": \"length\",\n \"value\": 10\n },\n {\n \"id\": \"width\",\n \"value\": 20\n }\n ],\n \"selectedAddOns\": [\n \"blind_motor\"\n ],\n \"quantity\": 500,\n \"itemId\": 12345\n }\n ],\n \"isAudit\": true,\n \"locale\": \"en-US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"priceListId\": 100275,\n \"itemIds\": [\n 111111,\n 222222\n ],\n \"customer\": {\n \"id\": \"5e2cfb9b45570b000864c4b5\",\n \"segments\": [\n {\n \"name\": \"category\",\n \"value\": [\n \"GOLD\",\n \"YELLOW\"\n ]\n },\n {\n \"name\": \"ageGroup\",\n \"value\": [\n \"elderly\"\n ]\n }\n ]\n },\n \"priceParameters\": [\n {\n \"additionalProperties\": [\n {\n \"id\": \"length\",\n \"value\": 10\n },\n {\n \"id\": \"width\",\n \"value\": 20\n }\n ],\n \"selectedAddOns\": [\n \"blind_motor\"\n ],\n \"quantity\": 500,\n \"itemId\": 12345\n }\n ],\n \"isAudit\": true,\n \"locale\": \"en-US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceListId\": 100275,\n \"itemIds\": [\n 111111,\n 222222\n ],\n \"customer\": {\n \"id\": \"5e2cfb9b45570b000864c4b5\",\n \"segments\": [\n {\n \"name\": \"category\",\n \"value\": [\n \"GOLD\",\n \"YELLOW\"\n ]\n },\n {\n \"name\": \"ageGroup\",\n \"value\": [\n \"elderly\"\n ]\n }\n ]\n },\n \"priceParameters\": [\n {\n \"additionalProperties\": [\n {\n \"id\": \"length\",\n \"value\": 10\n },\n {\n \"id\": \"width\",\n \"value\": 20\n }\n ],\n \"selectedAddOns\": [\n \"blind_motor\"\n ],\n \"quantity\": 500,\n \"itemId\": 12345\n }\n ],\n \"isAudit\": true,\n \"locale\": \"en-US\"\n}"
response = http.request(request)
puts response.read_body{
"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
}
]
}
}
]
}{
"errors": [
{
"type": "Not found",
"message": "Price doesn't exist for product 179089, channels [12, 10], date Wed Nov 16 14:11:16 UYT 2022 and price lists [197090]"
}
],
"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"
}
]
}
}
],
"additionalAttributes": [
{}
],
"promotionMessages": [
{
"title": "Buy 2 get 1 free",
"message": "Offer valid at participating stores through September 5, 2023.",
"pages": [
"PDP"
],
"locales": [
"en-CA"
],
"type": "DISCOUNT",
"threshold": 2,
"promoId": "61df12345678900009b7091c"
}
]
},
"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
}
]
}
}
]
}{
"type": "BAD_REQUEST",
"message": "Request isn't valid",
"errors": [
{
"type": "Bad request",
"message": "-1.0 isn't a valid shipping price. Value must be greater than or equal to 0."
}
]
}{
"type": "UNAUTHORIZED_ACCESS",
"message": "Unauthorized access"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "Internal Server Error"
}Real-time Pricing Engine
Calculate prices for products by IDs
Use this endpoint to calculate prices for one or more products in a specific price list using item IDs. If you prefer to use SKUs to calculate product prices, use the calculate prices for products by SKUs endpoint.
POST
/
price-engine
/
actions
/
evaluate-products-by-id
Calculate prices for products by IDs
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"
}
'import requests
url = "https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id"
payload = {
"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"
}
headers = {
"x-fabric-tenant-id": "<x-fabric-tenant-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-fabric-tenant-id': '<x-fabric-tenant-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
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'
})
};
fetch('https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"x-fabric-tenant-id: <x-fabric-tenant-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id"
payload := strings.NewReader("{\n \"priceListId\": 100275,\n \"itemIds\": [\n 111111,\n 222222\n ],\n \"customer\": {\n \"id\": \"5e2cfb9b45570b000864c4b5\",\n \"segments\": [\n {\n \"name\": \"category\",\n \"value\": [\n \"GOLD\",\n \"YELLOW\"\n ]\n },\n {\n \"name\": \"ageGroup\",\n \"value\": [\n \"elderly\"\n ]\n }\n ]\n },\n \"priceParameters\": [\n {\n \"additionalProperties\": [\n {\n \"id\": \"length\",\n \"value\": 10\n },\n {\n \"id\": \"width\",\n \"value\": 20\n }\n ],\n \"selectedAddOns\": [\n \"blind_motor\"\n ],\n \"quantity\": 500,\n \"itemId\": 12345\n }\n ],\n \"isAudit\": true,\n \"locale\": \"en-US\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-fabric-tenant-id", "<x-fabric-tenant-id>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id")
.header("x-fabric-tenant-id", "<x-fabric-tenant-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"priceListId\": 100275,\n \"itemIds\": [\n 111111,\n 222222\n ],\n \"customer\": {\n \"id\": \"5e2cfb9b45570b000864c4b5\",\n \"segments\": [\n {\n \"name\": \"category\",\n \"value\": [\n \"GOLD\",\n \"YELLOW\"\n ]\n },\n {\n \"name\": \"ageGroup\",\n \"value\": [\n \"elderly\"\n ]\n }\n ]\n },\n \"priceParameters\": [\n {\n \"additionalProperties\": [\n {\n \"id\": \"length\",\n \"value\": 10\n },\n {\n \"id\": \"width\",\n \"value\": 20\n }\n ],\n \"selectedAddOns\": [\n \"blind_motor\"\n ],\n \"quantity\": 500,\n \"itemId\": 12345\n }\n ],\n \"isAudit\": true,\n \"locale\": \"en-US\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fabric.inc/v3/price-engine/actions/evaluate-products-by-id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fabric-tenant-id"] = '<x-fabric-tenant-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceListId\": 100275,\n \"itemIds\": [\n 111111,\n 222222\n ],\n \"customer\": {\n \"id\": \"5e2cfb9b45570b000864c4b5\",\n \"segments\": [\n {\n \"name\": \"category\",\n \"value\": [\n \"GOLD\",\n \"YELLOW\"\n ]\n },\n {\n \"name\": \"ageGroup\",\n \"value\": [\n \"elderly\"\n ]\n }\n ]\n },\n \"priceParameters\": [\n {\n \"additionalProperties\": [\n {\n \"id\": \"length\",\n \"value\": 10\n },\n {\n \"id\": \"width\",\n \"value\": 20\n }\n ],\n \"selectedAddOns\": [\n \"blind_motor\"\n ],\n \"quantity\": 500,\n \"itemId\": 12345\n }\n ],\n \"isAudit\": true,\n \"locale\": \"en-US\"\n}"
response = http.request(request)
puts response.read_body{
"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
}
]
}
}
]
}{
"errors": [
{
"type": "Not found",
"message": "Price doesn't exist for product 179089, channels [12, 10], date Wed Nov 16 14:11:16 UYT 2022 and price lists [197090]"
}
],
"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"
}
]
}
}
],
"additionalAttributes": [
{}
],
"promotionMessages": [
{
"title": "Buy 2 get 1 free",
"message": "Offer valid at participating stores through September 5, 2023.",
"pages": [
"PDP"
],
"locales": [
"en-CA"
],
"type": "DISCOUNT",
"threshold": 2,
"promoId": "61df12345678900009b7091c"
}
]
},
"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
}
]
}
}
]
}{
"type": "BAD_REQUEST",
"message": "Request isn't valid",
"errors": [
{
"type": "Bad request",
"message": "-1.0 isn't a valid shipping price. Value must be greater than or equal to 0."
}
]
}{
"type": "UNAUTHORIZED_ACCESS",
"message": "Unauthorized access"
}{
"type": "INTERNAL_SERVER_ERROR",
"message": "Internal Server Error"
}Authorizations
Headers
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:
24Body
application/json
A sample request to evaluate the prices of products by item IDs.
The price list ID associated with the item generated using the create price list endpoint.
Example:
100275
Was this page helpful?
