---
title: "Get calculated prices"
method: POST
path: "/v1/price/get-by-sku"
tags: ["Dynamic Pricing Engine"]
---

# Get calculated prices

`POST /v1/price/get-by-sku`

## Request

- Base URL: `https://live.copilot.fabric.inc`
- URL: `https://live.copilot.fabric.inc/v1/price/get-by-sku`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/fabric/apis/offers-v2/docs/v1/price/get-by-sku/post.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves prices for items either by SKUs or by item IDs based on the customer specific configuration set in the backend.

## Headers

- `x-site-context` string, required

## Request body

- GetPricesRequest: Prices conditions
  - `traceId` string: Trace ID, used to trace logs
  - `priceList` string[]: List of price list IDs which items or SKUs belong to
  - `sku` string[]: 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.
  - `itemId` integer[]: 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.
  - `userId` string: User ID
  - `userProfile` object: Segment the user belongs to
  - `isLoggedIn` boolean: true if the user logged in<br /> false if the user is not logged in
  - `channel` integer[]: List of channel ID from where the request is coming
  - `date` string, date-time: Date for which the prices are to be retrieved
  - `priceParams` PriceRequestParam[]: Various price parameters to calculate final price
    - `options` object: Pricing options for calculation
    - `sku` string: Item SKU. Either SKU or ItemId is mandatory
    - `quantity` number, double: Number of items ordered. Mandatory for Range-Base pricing method
    - `itemId` integer: Item ID. Either SKU or ItemId is mandatory
  - `audit` boolean: true if audit is required. Response body will have an audit object with details about how the dynamic pricing engine obtained the result.<br /> false if audit is not required.

## Response `200`

Successfully retrieved the prices

- CalculatedPrice[]
  - `priceList` string: Price List ID
  - `sku` string: Item SKU
  - `itemId` integer: Item SKU
  - `offers` CalculatedPriceOffers: Offers on the price
    - `price` CalculatedPriceObject
      - `sale` number, double: Price at which the product is offered for sale
      - `cost` number, double: Cost price. Displayed if configured earlier
      - `base` number, double: Minimum fixed price of a single unit of the item
      - `finalPrice` number, double: Final calculated price of the item. Does not include discounts.
      - `currency` string: Currency
      - `totalPrice` number, double: Final calculated price of the item, include discounts.
    - `kind` string: Price kind name
    - `channel` integer: Channel for which the price is retrieved
    - `discounts` PromotionDiscount[]: Discount object
      - `amount` number, double: Actual discount amount
      - `value` number, double: Discount in percent or amount
      - `groupId` string: ID of the group or category this item belongs to
      - `promotionId` string: Promotion ID
      - `priority` integer: 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.
      - `stackable` boolean: true indicates promotions are stackable, meaning their discounts will be summed together. Stackable promotions will be applied regardless of other promotions being applied.<br /> false indicates promotions are non-stackable, meaning discounts will be compared, within the same priority, and the maximum discount will be applied for promotion.
      - `title` string: Promotion title
      - `quantity` integer: Item quantity
      - `promotionType` string: Promotion type
      - `discountType` 'PERCENTAGE_OFF' | 'AMOUNT_OFF' | 'FIXED_PRICE': Discount Type
      - `application` integer: 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.
      - `isAlwaysApplied` boolean: 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.
      - `level` integer: 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.
      - `stackingType` 'STACKABLE' | 'EXCLUSIVE' | 'TYPE_EXCLUSIVE' | 'UNIVERSAL': 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.
      - `proratedAmount` number, double: 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`.
      - `proratedQuantity` integer: 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.
      - `promotionMessages` object[]: The promotion message that is displayed to the customer.
        - `promoId` string: Promotion ID
        - `title` string: The title of the promotion message, summarizing the offer or discount type.
        - `message` string: A promotional message providing details about the offer, including eligibility, duration, and conditions.
        - `pages` string[]: 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.
        - `locales` string[]: 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.
        - `type` 'DISCOUNT' | 'PROXIMITY' | 'POTENTIAL_DISCOUNT': 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.
        - `threshold` integer: 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.
    - `additionalAttributes` object[]: A placeholder for additional attributes, in key-value pairs.
    - `promotionMessages` object[]: The promotion message that is displayed to the customer.
      - `promoId` string: Promotion ID
      - `title` string: The title of the promotion message, summarizing the offer or discount type.
      - `message` string: A promotional message providing details about the offer, including eligibility, duration, and conditions.
      - `pages` string[]: 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.
      - `locales` string[]: 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.
      - `type` 'DISCOUNT' | 'PROXIMITY' | 'POTENTIAL_DISCOUNT': 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.
      - `threshold` integer: 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.
  - `audit` CalculatedPriceAudit
    - `userId` string: ID of the user who created the price
    - `priceMethodType` string
    - `quantity` number, double
    - `options` object
      - `length` number
      - `width` number
    - `appliedAddons` string[]

## Other responses

- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/fabric/apis/offers-v2.md) - [All operations](https://skmtc.dev/fabric/apis/offers-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/fabric/apis/offers-v2/revisions/da2bd742b9bc?raw)
