curl --request POST \
--url https://live.copilot.fabric.inc/v1/price/get-by-sku \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"traceId": 394823457,
"priceList": [
100275,
100276
],
"sku": [
1000019501,
1000019502
],
"itemId": [
111111,
222222
],
"userId": "5e2cfb9b45570b000864c4b5",
"userProfile": {
"Customer Type": [
"Wholesale"
]
},
"isLoggedIn": true,
"channel": [
12,
15
],
"date": "2019-08-24T14:15:22Z",
"priceParams": [
{
"options": {
"length": "2",
"width": "15",
"blindMotor": true
},
"sku": "11111",
"quantity": 5,
"itemId": 12345
}
],
"audit": true
}
'[
{
"priceList": "100275",
"sku": "11111111",
"itemId": 11111111,
"offers": {
"price": {
"sale": 10,
"cost": 9,
"base": 10,
"finalPrice": 20,
"currency": "USD",
"totalPrice": 15
},
"kind": "BASE",
"channel": 12,
"discounts": [
{
"amount": 10,
"value": 20,
"groupId": "61a6354d0d70e30009415f16",
"promotionId": "6197ec46e836ff000952c668",
"priority": 1,
"stackable": true,
"title": "20% off",
"quantity": 5,
"promotionType": "COUPON",
"discountType": "PERCENTAGE_OFF",
"application": 1,
"isAlwaysApplied": false,
"level": 1,
"stackingType": "STACKABLE",
"proratedAmount": 10,
"proratedQuantity": 1,
"promotionMessages": [
{
"promoId": "61df12345678900009b7091c",
"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
}
]
}
],
"additionalAttributes": [
{}
],
"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"
}
]
},
"audit": {
"userId": "62f5e25ca090100009c6e0f0",
"priceMethodType": "SurfaceArea_Square_Increment",
"quantity": 5,
"options": {
"length": 12,
"width": 10
},
"appliedAddons": [
"blind-motor"
]
}
}
]Retrieves prices for items either by SKUs or by item IDs based on the customer specific configuration set in the backend.
curl --request POST \
--url https://live.copilot.fabric.inc/v1/price/get-by-sku \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-site-context: <x-site-context>' \
--data '
{
"traceId": 394823457,
"priceList": [
100275,
100276
],
"sku": [
1000019501,
1000019502
],
"itemId": [
111111,
222222
],
"userId": "5e2cfb9b45570b000864c4b5",
"userProfile": {
"Customer Type": [
"Wholesale"
]
},
"isLoggedIn": true,
"channel": [
12,
15
],
"date": "2019-08-24T14:15:22Z",
"priceParams": [
{
"options": {
"length": "2",
"width": "15",
"blindMotor": true
},
"sku": "11111",
"quantity": 5,
"itemId": 12345
}
],
"audit": true
}
'[
{
"priceList": "100275",
"sku": "11111111",
"itemId": 11111111,
"offers": {
"price": {
"sale": 10,
"cost": 9,
"base": 10,
"finalPrice": 20,
"currency": "USD",
"totalPrice": 15
},
"kind": "BASE",
"channel": 12,
"discounts": [
{
"amount": 10,
"value": 20,
"groupId": "61a6354d0d70e30009415f16",
"promotionId": "6197ec46e836ff000952c668",
"priority": 1,
"stackable": true,
"title": "20% off",
"quantity": 5,
"promotionType": "COUPON",
"discountType": "PERCENTAGE_OFF",
"application": 1,
"isAlwaysApplied": false,
"level": 1,
"stackingType": "STACKABLE",
"proratedAmount": 10,
"proratedQuantity": 1,
"promotionMessages": [
{
"promoId": "61df12345678900009b7091c",
"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
}
]
}
],
"additionalAttributes": [
{}
],
"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"
}
]
},
"audit": {
"userId": "62f5e25ca090100009c6e0f0",
"priceMethodType": "SurfaceArea_Square_Increment",
"quantity": 5,
"options": {
"length": 12,
"width": 10
},
"appliedAddons": [
"blind-motor"
]
}
}
]Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
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.
"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"
Prices conditions
Trace ID, used to trace logs
394823457
List of price list IDs which items or SKUs belong to
[100275, 100276]A list of Stock Keeping Units (SKUs) for items whose prices needs to be retrieved. Specify either SKUs or itemIds. If both are provided, the SKU takes precedence.
[1000019501, 1000019502]List of item IDs for items whose prices needs to be retrieved. Specify either SKUs or itemIds. If both are provided, the SKU takes precedence.
[111111, 222222]User ID
"5e2cfb9b45570b000864c4b5"
true if the user logged in
false if the user is not logged in
true
List of channel ID from where the request is coming
List of channel ID from where the request is coming
[12, 15]Date for which the prices are to be retrieved
"2019-08-24T14:15:22Z"
Various price parameters to calculate final price
Show child attributes
Item SKU. Either SKU or ItemId is mandatory
"11111"
Number of items ordered. Mandatory for Range-Base pricing method
5
Item ID. Either SKU or ItemId is mandatory
12345
true if audit is required. Response body will have an audit object with details about how the dynamic pricing engine obtained the result.
false if audit is not required.
true
Successfully retrieved the prices
Price List ID
"100275"
Item SKU
"11111111"
Item SKU
11111111
Offers on the price
Show child attributes
Show child attributes
Price at which the product is offered for sale
10
Cost price. Displayed if configured earlier
9
Minimum fixed price of a single unit of the item
10
Final calculated price of the item. Does not include discounts.
20
Currency
"USD"
Final calculated price of the item, include discounts.
15
Price kind name
"BASE"
Channel for which the price is retrieved
12
Discount object
Show child attributes
Actual discount amount
10
Discount in percent or amount
20
ID of the group or category this item belongs to
"61a6354d0d70e30009415f16"
Promotion ID
"6197ec46e836ff000952c668"
The order in which promotion should be applied. Promotion types are assigned a default priority. First, priority 1 promotions will be evaluated. The result of priority 1 will be used as a base price for priority 2. Similarly, the result of priority 2 will be used as a base price for priority 3 and so on.
1
true indicates promotions are stackable, meaning their discounts will be summed together. Stackable promotions will be applied regardless of other promotions being applied.
false indicates promotions are non-stackable, meaning discounts will be compared, within the same priority, and the maximum discount will be applied for promotion.
true
Promotion title
"20% off"
Item quantity
5
Promotion type
"COUPON"
Discount Type
PERCENTAGE_OFF, AMOUNT_OFF, FIXED_PRICE It is used specifically for BuyGet type that applies when you Buy something and Get discount of some amount or percentage or free items. This field indicates how many times this BuyGet promotion is applied.
1
A flag indicating whether the promotion is always applied. Set it to true if the promotion is always applied, even on non-stackable promotions and false to apply promotions based on configured conditions.
false
The promotion execution order. Promotion types are assigned default execution orders. Initial evaluation begins with level 1 promotions. The result of level 1 is used as the base price for level 2. Similarly, the result of level 2 becomes the base price for level 3, and so on.
1
Defines the rules for how a promotion can be combined with other promotions. This field determines whether a specific promotion can be applied in conjunction with other active promotions during a transaction or if it must be used exclusively. Possible values: - STACKABLE: This promotion can be combined with other stackable promotions, allowing multiple
discounts to be applied together. The order in which stackable promotions are applied
is determined by the level field, with promotions having a higher priority (lower numeric value)
being applied before those with a lower priority.
EXCLUSIVE: This promotion cannot be combined with any other promotions. The level field is
used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive
promotion is applied, no other promotions can be used in the same transaction.TYPE_EXCLUSIVE: This promotion cannot be combined with other promotions of the same type.
The level field is used to determine which promotion within the same type will be evaluated and
applied first.UNIVERSAL: This promotion can be combined with any other promotions without restrictions.
Universal promotions will be evaluated last.STACKABLE, EXCLUSIVE, TYPE_EXCLUSIVE, UNIVERSAL "STACKABLE"
The BuyGet promotions distribute the discount across specified parameters. For example, when buying A results in a discount on B, the discount amount on B is prorated across both A and B. The distributed amount is reflected in proratedAmount, while the quantity is captured in proratedQuantity.
10
The proratedQuantity is used in conjunction with proratedAmount to determine the discount portion allocated to the respective units of BuyGet promotions. This is applicable in partial return scenarios.
1
The promotion message that is displayed to the customer.
Show child attributes
Promotion ID
"61df12345678900009b7091c"
The title of the promotion message, summarizing the offer or discount type.
"Buy 2 get 1 free"
A promotional message providing details about the offer, including eligibility, duration, and conditions.
"Offer valid at participating stores through September 5, 2023."
The web pages where the message is displayed, whether the product display page (PDP), product list page (PLP), the customer's cart, or the checkout page.
Page type
PDP, PLP, Cart, Checkout The geographic regions where the promotion message is displayed, determined by the user's IP address. Locales define language and country-specific settings for promotions.
Locale
Specifies the promotion message type.
DISCOUNT: The discount has been applied.PROXIMITY: The product or cart is close to meeting discount conditions.POTENTIAL_DISCOUNT: The product could qualify for a discount but has not yet.DISCOUNT, PROXIMITY, POTENTIAL_DISCOUNT "DISCOUNT"
Indicates a quantity or amount that is close to meeting the discount requirement. If the user reaches this value, a promotion message is displayed. This field is only valid for PROXIMITY messages.
2
A placeholder for additional attributes, in key-value pairs.
The promotion message that is displayed to the customer.
Show child attributes
Promotion ID
"61df12345678900009b7091c"
The title of the promotion message, summarizing the offer or discount type.
"Buy 2 get 1 free"
A promotional message providing details about the offer, including eligibility, duration, and conditions.
"Offer valid at participating stores through September 5, 2023."
The web pages where the message is displayed, whether the product display page (PDP), product list page (PLP), the customer's cart, or the checkout page.
Page type
PDP, PLP, Cart, Checkout The geographic regions where the promotion message is displayed, determined by the user's IP address. Locales define language and country-specific settings for promotions.
Locale
Specifies the promotion message type.
DISCOUNT: The discount has been applied.PROXIMITY: The product or cart is close to meeting discount conditions.POTENTIAL_DISCOUNT: The product could qualify for a discount but has not yet.DISCOUNT, PROXIMITY, POTENTIAL_DISCOUNT "DISCOUNT"
Indicates a quantity or amount that is close to meeting the discount requirement. If the user reaches this value, a promotion message is displayed. This field is only valid for PROXIMITY messages.
2
[
{
"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"
}
]Show child attributes
ID of the user who created the price
"62f5e25ca090100009c6e0f0"
"SurfaceArea_Square_Increment"
5
Was this page helpful?