> ## Documentation Index
> Fetch the complete documentation index at: https://developer.fabric.inc/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculate prices for products by SKUs

> Use this endpoint to calculate prices for one or more products in a specific price list by product SKUs. If you prefer to use item IDs to calculate product prices, use the [calculate prices for products by item IDs](/v3/api-reference/offers/real-time-pricing-engine/calculate-prices-for-products-by-item-ids) endpoint.
<Note>`itemId` is used as the default identifier for a product. If you want to set SKUs as product identifiers and use this endpoint, you must contact fabric support at support@fabric.inc.</Note>




## OpenAPI

````yaml price-engine.openapi post /price-engine/actions/evaluate-products-by-sku
openapi: 3.0.0
info:
  title: Offers - Real-time Pricing Engine
  description: >-
    fabric's Real-time Pricing Engine (RTPE) endpoints are used to calculate
    prices and evaluate discounts for individual products and carts.
  version: 3.0.0
  x-audience: external-public
  termsOfService: https://fabric.inc/terms-of-use
  contact:
    name: Offers support
    email: support@fabric.inc
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
servers:
  - url: https://api.fabric.inc/v3
    description: Production environment
security: []
externalDocs:
  description: Find out more about Offers
  url: https://developer.fabric.inc/docs/offers-overview
paths:
  /price-engine/actions/evaluate-products-by-sku:
    post:
      tags:
        - Real-time Pricing Engine
      summary: Calculate prices for products by SKUs
      description: >
        Use this endpoint to calculate prices for one or more products in a
        specific price list by product SKUs. If you prefer to use item IDs to
        calculate product prices, use the [calculate prices for products by item
        IDs](/v3/api-reference/offers/real-time-pricing-engine/calculate-prices-for-products-by-item-ids)
        endpoint.

        <Note>`itemId` is used as the default identifier for a product. If you
        want to set SKUs as product identifiers and use this endpoint, you must
        contact fabric support at support@fabric.inc.</Note>
      operationId: evaluatePricesBySku
      parameters:
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricDate'
        - $ref: '#/components/parameters/xFabricRequestId'
        - $ref: '#/components/parameters/xFabricChannelId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/evaluateProductsBySkuRequest'
        required: true
      responses:
        '200':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/evaluateProductsBySkuResponse'
              examples:
                successResponseExample:
                  $ref: '#/components/examples/evaluateProductsSuccessBySKU'
        '207':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          description: Partially succeeded in getting results for each item.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/evaluateProductsBySkuResponse'
        '400':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
        '401':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceError'
              example:
                type: UNAUTHORIZED_ACCESS
                message: Unauthorized access
        '500':
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponse'
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceError'
              example:
                type: INTERNAL_SERVER_ERROR
                message: Internal server error
      security:
        - AuthorizationToken: []
components:
  parameters:
    xFabricTenantId:
      in: header
      name: x-fabric-tenant-id
      schema:
        type: string
        minLength: 24
        maxLength: 24
      required: true
      example: 5f328bf0b5f328bf0b5f328b
      description: >-
        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](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
    xFabricDate:
      name: x-fabric-date
      in: header
      description: >-
        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.
      required: false
      schema:
        type: string
        example: '2022-09-06T14:07:17.000Z'
    xFabricRequestId:
      in: header
      name: x-fabric-request-id
      description: A unique request ID.
      required: false
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
    xFabricChannelId:
      in: header
      name: x-fabric-channel-id
      schema:
        type: string
        example: '12'
      description: >-
        x-fabric-channel-id identifies the sales channel where the API request
        is being made; primarily for multichannel use cases. The channel ids are
        12 corresponding to US and 13 corresponding to Canada. The default
        channel id is 12. This field is required.
  schemas:
    evaluateProductsBySkuRequest:
      type: object
      required:
        - priceListId
        - skus
      description: Evaluate prices for products based on their individual SKUs.
      properties:
        priceListId:
          description: Price list ID of the item.
          type: integer
          format: int32
          example: 100275
        skus:
          type: array
          description: >-
            List of product SKUs for which prices are to be retrieved. You can
            specify up to 50 SKUs.
          example:
            - '1000019501'
            - '1000019502'
          minItems: 1
          maxItems: 50
          items:
            description: Product SKU
            example: SKU10023
            type: string
        customer:
          $ref: '#/components/schemas/customer'
        priceParameters:
          type: array
          description: The parameters used to calculate the price.
          items:
            $ref: '#/components/schemas/priceParameterBySku'
        isAudit:
          type: boolean
          description: >
            Specifies whether an audit's required. The options are:

            - `true`: Response includes an audit object mentioning how the price
            is calculated.

            - `false`: Response doesn't include an audit object.
          example: true
        locale:
          type: string
          description: >-
            The language code, which is a combination of language in ISO 639
            format and country in ISO 3166 format. The default value is en-US.
          example: en-US
    evaluateProductsBySkuResponse:
      description: Sample response including successful retrievals and potential errors.
      type: object
      properties:
        errors:
          description: An array containing error codes and corresponding messages.
          type: array
          items:
            $ref: '#/components/schemas/priceError'
        data:
          type: array
          items:
            $ref: '#/components/schemas/calculatedPriceBySku'
      items:
        type: object
        description: Calculated price details
        properties:
          id:
            description: Price ID
            example: 5e2cfb9b45570b000864c4b5
          value:
            oneOf:
              - $ref: '#/components/schemas/arrayOfStrings'
              - type: string
                example: red
                description: String value
            example: Nike
            description: Property value
    apiError:
      type: object
      description: The details of validation errors.
      properties:
        type:
          type: string
          description: The error code.
          example: BAD_REQUEST
        message:
          type: string
          description: An error message corresponding to the `type`.
          example: Request isn't valid
        errors:
          description: The error details.
          type: array
          items:
            $ref: '#/components/schemas/cartSubError'
    priceError:
      type: object
      description: The validation errors related to the price.
      properties:
        type:
          type: string
          description: The error code.
          example: Not found
        message:
          type: string
          description: An error message corresponding to the `type`.
          example: >-
            Price doesn't exist for product 179089, channels [12, 10], date Wed
            Nov 16 14:11:16 UYT 2022 and price lists [197090]
    customer:
      type: object
      description: Customer details
      properties:
        id:
          type: string
          description: Unique identifier for the customer
          example: 5e2cfb9b45570b000864c4b5
        segments:
          type: array
          description: A list of segments the customer belongs to.
          example:
            - name: category
              value:
                - GOLD
                - YELLOW
            - name: ageGroup
              value:
                - elderly
          items:
            type: object
            properties:
              name:
                description: The name of the segment the customer belongs to.
                type: string
                example: category
              value:
                type: array
                description: The values of the segment associated with the customer.
                items:
                  type: string
                  description: Segment item
                  example: GOLD
    priceParameterBySku:
      allOf:
        - $ref: '#/components/schemas/priceParameter'
        - type: object
          properties:
            sku:
              type: string
              description: Product SKU
              example: '1000019501'
            quantity:
              type: integer
              description: >-
                Number of products ordered. This value is required for the
                range-based pricing method.
              format: int32
              example: 500
    calculatedPriceBySku:
      type: object
      description: Calculated price details
      properties:
        priceListId:
          description: The price list ID of the item.
          type: integer
          format: int32
          example: 100275
        sku:
          type: string
          description: Product SKU
          example: SKU1234
        offer:
          $ref: '#/components/schemas/calculatedPriceOffersBySKU'
        audit:
          $ref: '#/components/schemas/calculatedPriceAudit'
    arrayOfStrings:
      type: array
      description: A list of string values.
      example:
        - blue
        - red
      items:
        type: string
        description: The string value.
        example: blue
    cartSubError:
      type: object
      description: The validation sub errors related to the cart.
      properties:
        type:
          type: string
          description: The error code.
          example: Bad request
        message:
          type: string
          description: The error message corresponding to the `type`.
          example: >-
            -1.0 isn't a valid shipping price. Value must be greater than or
            equal to 0.
    priceParameter:
      allOf:
        - $ref: '#/components/schemas/priceAdditionalProperties'
        - type: object
          properties:
            selectedAddOns:
              type: array
              description: List of add-ons selected for the product.
              example:
                - blind_motor
              items:
                type: string
                example: blind_motor
                description: Add-on name
    calculatedPriceOffersBySKU:
      type: object
      description: Discounts or special offers applied to the price.
      properties:
        price:
          $ref: '#/components/schemas/calculatedPriceObject'
        discounts:
          type: array
          description: A list of discounts applied to the price.
          items:
            $ref: '#/components/schemas/promotionDiscountWithPromoMessage'
        suggestedProducts:
          description: The suggested products.
          items:
            $ref: '#/components/schemas/pdpSuggestedSKU'
        additionalAttributes:
          type: array
          description: A placeholder for additional price attributes, in name-values pairs.
          items:
            type: object
        promotionMessages:
          $ref: '#/components/schemas/rtpePromotionMessages'
    calculatedPriceAudit:
      type: object
      description: Details involved in calculating the price.
      properties:
        userId:
          type: string
          description: The auto populated ID of the user who created the price.
          example: 62f5e25ca090100009c6e0f0
        priceMethodType:
          description: The method used to calculate the price.
          type: string
          example: SurfaceArea_Square_Increment
        quantity:
          description: The quantity of items for which the price is calculated.
          type: integer
          format: int32
          example: 50
        priceParameters:
          $ref: '#/components/schemas/priceAdditionalProperties'
        appliedAddons:
          type: array
          description: List of additional components used in the price calculation
          items:
            type: object
            example:
              name: blind-motor
              value: 100
    priceAdditionalProperties:
      type: object
      description: The additional parameters for calculating the price.
      properties:
        additionalProperties:
          type: array
          description: The additional properties for calculating the price.
          example:
            - id: length
              value: 10
            - id: width
              value: 20
          items:
            type: object
            properties:
              id:
                description: The variable ID.
                type: string
                example: length
              value:
                description: The variable value.
                type: number
                example: 10
                format: double
    calculatedPriceObject:
      type: object
      description: The calculated price details for line items.
      example:
        sale: 1000.15
        cost: 900.15
        base: 2000.15
        unitPriceWithoutDiscounts: 2000.15
        lineTotalWithoutDiscounts: 2000.15
        lineTotalWithDiscounts: 2000.15
        type: BASE
      properties:
        sale:
          type: number
          description: Sale price of the product.
          format: double
          example: 1000.15
          nullable: true
        cost:
          type: number
          description: >-
            Cost of goods sold, from either producing or purchasing from other
            vendors.
          format: double
          example: 900.15
        base:
          type: number
          description: The base price of a single item before any discounts.
          format: double
          example: 2000.15
        unitPriceWithoutDiscounts:
          type: number
          nullable: true
          description: >-
            Price of a single item without discount. This price is either the
            `base` or `sale` price. The type used is noted in the `type`
            property.
          format: double
          example: 2000.15
        lineTotalWithoutDiscounts:
          type: number
          nullable: true
          description: >-
            Total price of all items without calculating discounts. This is the
            `unitPriceWithoutDiscounts` multiplied by the quantity.
          format: double
          example: 5000.15
        lineTotalWithDiscounts:
          type: number
          nullable: true
          description: >-
            Total price of all items after all discounts. This is the
            unitPriceWithoutDiscounts multiplied by the quantity, less the
            promotion discounts.
          format: double
          example: 5000.15
        type:
          type: string
          nullable: true
          description: Price type
          example: BASE
        currency:
          type: string
          description: Currency string value
          example: USD
    promotionDiscountWithPromoMessage:
      type: object
      description: Promotion discount
      example:
        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
      properties:
        amount:
          type: number
          description: >-
            The actual amount of the discounts applied to the price. For
            example, entering 100.15 for a product with a base price of 2000.15
            results in a discounted price of 1900.
          format: double
          example: 100.15
        quantity:
          type: integer
          description: The number of items eligible for the promotional discount.
          format: int32
          example: 5
        application:
          type: integer
          nullable: true
          description: >-
            The number of times the BuyGet promotion can be used, indicating how
            many times you can use the promotions, such as get a certain amount
            or percentage off, or get free items when making a purchase.
          format: int32
          example: 1
        promotion:
          type: object
          description: Promotion object
          example:
            id: 6197ec46e836ff000952c668
            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
          properties:
            id:
              type: string
              description: >-
                A 24-character system-generated coupon ID generated using the
                [create coupon](/v3/api-reference/offers/coupons/create-coupon)
                endpoint.
              example: 6197ec46e836ff000952c667
            value:
              type: number
              description: >-
                The discount applied to the price. This can be specified as a
                percentage or a fixed amount.
              format: double
              example: 2000.15
            groupId:
              type: string
              nullable: true
              description: ID of the group or category this product belongs to
              example: 61a6354d0d70e30009415f16
            level:
              type: integer
              nullable: true
              description: The order in which the current promotion is executed.
              format: int32
              example: 1
            isStackable:
              type: boolean
              nullable: true
              description: >-
                Specifies whether the promotion is stackable. You can set one of
                the following: - `true`: This promotion can be combined with
                other stackable promotions, allowing multiple discounts to be
                applied together. - `false`: The promotion isn't stackable. You
                can't combine this promotion with other promotions.
              example: true
            isAlwaysApplied:
              type: boolean
              nullable: true
              description: >-
                Specifies whether the promotion is applied regardless of the
                exclusive promotions on the same item. You can set one of the
                following values: - `true`: Promotion is applied regardless of
                the exclusive promotions on the same item. - `false`: Promotion
                isn't applied on the item.
              example: true
            stackingType:
              type: string
              description: >-
                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 can't 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 can't 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.
              enum:
                - STACKABLE
                - EXCLUSIVE
                - TYPE_EXCLUSIVE
                - UNIVERSAL
              example: STACKABLE
            name:
              type: string
              description: Promotion name
              example: 20% off
            type:
              type: string
              description: Promotion type
              example: COUPON
            discountType:
              example: PERCENTAGE_OFF
              type: string
              description: Discount type
              enum:
                - PERCENTAGE_OFF
                - AMOUNT_OFF
                - FIXED_PRICE
            promotionMessages:
              $ref: '#/components/schemas/rtpePromotionMessages'
    pdpSuggestedSKU:
      type: array
      description: A list of suggested products.
      items:
        description: The suggested product.
        type: object
        properties:
          promotionId:
            type: string
            description: >-
              A 24-character system-generated promotion ID generated using the
              [create
              promotion](/v3/api-reference/offers/promotions/create-promotion)
              endpoint.
            example: 6197ec46e836ff000952c668
          promotionName:
            type: string
            description: The name of the promotion.
            example: Buy Shoes, get socks for free
          skus:
            type: array
            description: A list of Stock Keeping Units (SKUs).
            items:
              description: SKU
              example: SKU1
              type: string
            example:
              - SOCK1
              - SOCK2
              - SOCKN
          eligiblePriceLists:
            type: array
            description: The eligible price lists.
            items:
              description: >-
                The price list ID associated with the item generated using the
                [create price
                list](/v3/api-reference/offers/price-lists/create-price-list)
                endpoint.
              example: 10000
              type: integer
              format: int32
            example:
              - 10000
          isFree:
            type: boolean
            description: >-
              A flag indicating whether the promotion offers complimentary
              items. Set to `true` if the promotion includes one or more
              complimentary items and `false` if it doesn't.
            example: false
          discountType:
            type: string
            description: >-
              The type of discount, such as PERCENTAGE_OFF, AMOUNT_OFF, or
              FIXED_PRICE.
            enum:
              - PERCENTAGE_OFF
              - AMOUNT_OFF
              - FIXED_PRICE
            example: PERCENTAGE_OFF
          amount:
            type: number
            description: The discount amount.
            format: double
            example: 50
          quantity:
            type: number
            description: The number of complimentary items in the cart.
            format: double
            example: 50
    rtpePromotionMessages:
      allOf:
        - $ref: '#/components/schemas/promotionMessages'
        - type: array
          items:
            type: object
            properties:
              promoId:
                type: string
                description: >-
                  A 24-character system-generated coupon ID generated using the
                  [create
                  coupon](/v3/api-reference/offers/coupons/create-coupon)
                  endpoint.
                example: 61df12345678900009b7091c
    promotionMessages:
      type: array
      description: The promotion message that is displayed to the customer.
      required:
        - message
        - locales
        - type
      items:
        type: object
        description: Message description for the promotion
        properties:
          title:
            type: string
            description: Message name
            example: Buy 2 get 1 free
          message:
            type: string
            description: Message description
            example: Offer valid at participating stores through September 5, 2023.
          pages:
            type: array
            description: The types of web pages where the message is displayed.
            items:
              type: string
              description: Page type
              enum:
                - PDP
                - PLP
                - Cart
                - Checkout
              example: PDP
          locales:
            type: array
            description: >-
              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.
            items:
              type: string
              description: Locale
              example: en-CA
          type:
            type: string
            description: |-
              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.
            enum:
              - DISCOUNT
              - PROXIMITY
              - POTENTIAL_DISCOUNT
            example: DISCOUNT
          threshold:
            type: integer
            format: int32
            description: >-
              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.
            example: 2
  headers:
    xFabricRequestIdResponse:
      description: Unique request ID
      schema:
        type: string
        example: 263e731c-45c8-11ed-b878-0242ac120002
  examples:
    evaluateProductsSuccessBySKU:
      value:
        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
                  skus:
                    - SOCK1
                    - SOCK2
                    - SOCKN
                  eligiblePriceLists:
                    - 10000
                  isFree: false
                  discountType: PERCENTAGE_OFF
                  amount: 50
                  quantity: 1
              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: 50
              priceParameters:
                additionalProperties:
                  - id: length
                    value: 10
                  - id: width
                    value: 20
              appliedAddons:
                - name: blind-motor
                  value: 100
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````