Dynamic Pricing Engine
Get calculated prices
Retrieves prices for items either by SKUs or by item IDs based on the customer specific configuration set in the backend.
post/v1/price/get-by-sku
Request
- Base URLhttps://live.copilot.fabric.inc
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
x-site-contextstring required
Example:{"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account": "1234abcd5678efgh9ijklmno","stage":"production"}
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.
Request body
Example request
{
"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
}Response
Successfully retrieved the prices
Example response
[
{
"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",
"application": 1,
"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
}
]
}
],
"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
}
]
},
"audit": {
"userId": "62f5e25ca090100009c6e0f0",
"priceMethodType": "SurfaceArea_Square_Increment",
"quantity": 5,
"options": {
"length": 12,
"width": 10
},
"appliedAddons": [
"blind-motor"
]
}
}
]Changes
No recorded changes to this operation across all 2 revisions of this API.