> ## 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.

# Create or update price

> Creates or updates price details for one or many items based on given item IDs. Support for currency code is determined based on the currency code you have set while creating the price list, whuch is identified by priceListId in the request body.



## OpenAPI

````yaml offers_v2_combined post /api-offers/price
openapi: 3.0.0
info:
  title: Offers v2
  description: >-
    fabric's Offers APIs let you set up and manage stock keeping unit (SKU)
    prices. Its wide range of coupon and promotion features let you design
    discounts ranging from single-use, customer-specific coupons to site-wide
    promotions applicable for all SKUs.
  version: 2.0.0
  contact:
    email: support@fabric.inc
  license:
    url: https://fabric.inc/api-license
    name: fabric API license
servers:
  - url: https://live.copilot.fabric.inc
    description: Production
security:
  - AuthorizationToken: []
tags:
  - name: Price List
    description: >-
      Price list is a collection of items and their assigned prices. An item can
      exist in multiple price lists. This gives you the ability to assign
      different prices to the same item. Price lists let you set currency and
      duration of the prices. For example, if the price list expires, prices of
      items within the price list will also expire. You can configure the
      pricing API to include your default price. <br />When requesting pricelist
      of items or evaluating promotions, you should mention the price list ID
      that you want to use.
  - name: Pricing
    description: >-
      Pricing endpoints let you create and manage price details for one or many
      items. You can configure the pricing API to include your default price
      list in all requests.
  - name: Price Guard
    description: >-
      Price Guard allows you to create and manage more diversified price-kinds
      for the item, such as manufacturer recommended retail price (MSRP),
      minimum advertised price (MAP), floor price, ceiling price, clearance
      price,  and so on.  Price guard works as a protection mechanism against
      any further creation of prices for the item. These endpoints let you
      create and manage such price-kinds.
  - name: Price Kind
    description: >-
      Unlike price guard, price kind endpoint lets you get the fundamental price
      kinds (for example, base price and sale price) that are created while
      setting up the item information.
  - name: Promotion
    description: >-
      Promotion is a discount on an item, cart or shipping method based on set
      conditions. As promotions can be linked to specific price lists, it is
      important to submit the correct price list ID. Promotion endpoints let you
      create and manage discounts that will be applied to all customers' carts
      that meet the required conditions.
  - name: Coupon
    description: >-
      Coupon endpoints let you create and manage coupon codes that customers can
      enter at checkout to receive a discount.
  - name: Dynamic Pricing Engine
    description: >-
      fabric's Dynamic Pricing Engine APIs evaluate promotions and calculate
      prices instantly for the cart items using real-time price calculation
      method, that incorporates the latest information, to provide personalized
      and competitive prices for specific customers. It supports formula based
      custom SKU dynamic pricing, and shows discount breakdown details for
      separate items having separate promotions. It uses the cache information,
      instead of fetching offer details of items from database, to evaluate
      promotions and calculate prices instantly. It is fast, scalable to
      millions of pricing requests per day, and supports complex promotional
      strategies.
  - name: Global exclusion
    description: >-
      Global exclusions let you exclude SKUs from being discounted by active
      promotions. These endpoints let you manage those sku-lists.
  - name: Redemption
    description: Redemption endpoints let you manage the records of coupon redemptions.
  - name: Segment
    description: >-
      Segment endpoints let you target promotions at specific groups of
      customers by linking the promotion to a segment identifier. A customer
      segment is a group of customers that have been given a unique reference to
      easily identify them. They may be grouped in a number of ways such as
      demographics, locations, device type, and so on. fabric Offers supports
      the assignment of a customer segment to a promotion so that the promotion
      is applied only to a specific group of customers. You must enter your
      customer segment identifiers in the *Settings* of the Copilot application.
  - name: Upload price CSV
    description: This endpoint lets you bulk upload price details using a CSV file.
  - name: Product
    description: >-
      Product endpoint lets you get product and price information based on sku.
      Product information is retrieved from Product Catalog and price details
      are retrieved from Offers service.
  - name: Item
    description: >-
      Item endpoints let you get products and prices information based on
      itemId. Product information of an item is retrieved from Product Catalog
      and price details are retrieved from Offers service.
  - name: Attributes
    description: >-
      Attributes refer to a collection of attributes names and their values.
      Using attributes, you can group entities, such as products or shoppers,
      that share similar characteristics, such as dimension, age group,
      location, device type, and more. For example, the shopper segmentation can
      be used to tailor promotions to a specific customer segment by linking the
      promotion to the segment identifier.
  - name: Exports
    description: >-
      fabric Export endpoints let you export data to CSV files based on the
      provided filters.
externalDocs:
  description: Learn more about Offers
  url: https://developer.fabric.inc/docs/offers-overview
paths:
  /api-offers/price:
    post:
      tags:
        - Pricing
      summary: Create or update price
      description: >-
        Creates or updates price details for one or many items based on given
        item IDs. Support for currency code is determined based on the currency
        code you have set while creating the price list, whuch is identified by
        priceListId in the request body.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        $ref: '#/components/requestBodies/priceBody'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createCopilotPriceResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceDateError'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/priceListNotFound'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error500'
components:
  parameters:
    xSiteContent:
      name: x-site-context
      in: header
      description: >-
        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.
      required: true
      schema:
        type: string
        example: >-
          {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
          "1234abcd5678efgh9ijklmno","stage":"production"}
  requestBodies:
    priceBody:
      description: A JSON object containing price information
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/createPrice'
  schemas:
    createCopilotPriceResponse:
      type: array
      description: List of created or updated prices
      items:
        type: object
        properties:
          id:
            type: string
            description: fabric internal ID
          isSoftDeleted:
            type: boolean
            description: >-
              true: Price is soft deleted, means the details are removed from UI
              but are available in the databse.<br /> false:  Price is not
              deleted
          itemId:
            type: number
            example: 1000000051
            description: ID of the item
          itemSku:
            type: string
            example: SKU123456
            description: SKU of the item
          priceListId:
            type: number
            description: ID of the pricelist to which the created price is added or updated
            example: 100000
          offerId:
            type: number
            description: ID of the created offer for the itemId or itemSku
            example: 2386
          offers:
            type: array
            maxItems: 10
            minItems: 1
            description: Prices of the SKU or priceListId
            items:
              type: object
              properties:
                kind:
                  description: >-
                    Pricekind ID. This ID helps to identify if the price is base
                    price or clearance price or any other additional price.
                  type: number
                  example: 12
                channel:
                  description: Channel ID
                  type: number
                  example: 12
                startDate:
                  description: Price start date-time
                  type: string
                  format: date-time
                endDate:
                  description: Price end date-time
                  type: string
                  format: date-time
                price:
                  type: object
                  description: Price data
                  properties:
                    base:
                      description: Minimum fixed price of the item
                      type: number
                      example: 299
                    sale:
                      description: Price at which the product is offered for sale
                      type: number
                      example: 199
                    cost:
                      type: number
                      description: Cost of the item if any
                      example: 149
                    currency:
                      description: Currency code of the price
                      type: string
                      example: USD
                priceMethodType:
                  description: >-
                    Type of method for calculating the price. <br />
                    **Range-Base:** Uses the quantity of sold items to determine
                    which price to use. Base price (minimum fixed price) is
                    ignored in this method.<br />
                    **SurfaceArea_Square_Increment:** Adds an incremental amount
                    depending on the area of the item. The final price is
                    calculated by adding the area multiplied by the price set
                    for quantity, to the base price. For example, if we sell a
                    rug that is 10x2, final price will be the base price (50,
                    for example), plus an increment of the area (20) times the
                    price range set for min quantity.<br />
                    **SurfaceArea_Square_Increment_2Dim:** Adds extra price to
                    the base price, determined by the area. The difference with
                    this Square Area method is that in this case the overprice
                    is not calculated, but instead it is looked-up in a
                    table-like structure that is already created, by checking
                    for the range of values provided in `width`.
                  type: string
                  enum:
                    - Range-Base
                    - SurfaceArea_Square_Increment
                    - SurfaceArea_Square_Increment_2Dim
                  example: Range-Base
                additionalAttributes:
                  type: array
                  description: A placeholder for additional attributes, in key-value pairs.
                  items:
                    type: object
                    properties:
                      customSkuTitle:
                        type: string
                        example: HOUSE TREE
                      customCategory:
                        type: string
                        example: HOME
          createdAt:
            type: string
            format: date-time
            description: Price creation date-time
            example: '2020-02-02T17:22:48.570Z'
          updatedAt:
            type: string
            format: date-time
            description: price last updated date-time
            example: '2020-02-02T17:22:48.570Z'
          job:
            type: boolean
            description: >-
              true: Job is running either to create or update details<br />
              false: Job is either completed or not running for some reason
            example: false
    priceDateError:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_TIME_RANGE_ERROR
        message:
          description: An error message corresponding to the `code`.
          type: string
          example: >-
            The start date must be at least 15 minutes before the end date, and
            both dates must be in the future.
    priceListNotFound:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: PRICE_LIST_NOT_FOUND
        message:
          description: The error message corresponding to the `code`.
          type: string
          example: No Price List with this ID Found
    error500:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: INTERNAL_SERVER_ERROR
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: Internal server error.
    createPrice:
      type: object
      required:
        - itemIds
        - offers
      properties:
        priceListId:
          description: ' `Optional`. ID or name of the price list to update the price for. If you do not provide ID or name, price will be updated for the *default* price list.<br /> If you''re using this endpoint to create price details, the price list ID will be generated automatically.'
          oneOf:
            - type: string
              example: 100-TwoWeeks
            - type: number
              example: 123456789
        itemIds:
          type: array
          description: Item IDs to create or update the price for
          items:
            type: number
            example: 10000001
        itemSkus:
          type: array
          description: SKUs of the products to create or update the price for
          items:
            type: string
            example: SKU0123456
        offers:
          type: array
          maxItems: 10
          minItems: 1
          items:
            type: object
            required:
              - channel
              - startDate
              - endDate
              - price
            properties:
              kind:
                description: >-
                  Pricekind ID. This ID helps to identify if the price is base
                  price or clearance price or any other additional price.
                type: number
                example: 12
              channel:
                description: Sales channel ID
                type: number
                example: 12
              startDate:
                description: Price start date and time
                type: string
                format: date-time
              endDate:
                description: Price end date and time
                type: string
                format: date-time
              price:
                type: object
                description: Price data
                properties:
                  base:
                    description: Base price of the item
                    type: number
                    example: 299
                  sale:
                    description: Price at which the product is offered for sale
                    type: number
                    example: 199
                  cost:
                    description: Cost of the item, set by the manufacturer, if any
                    type: number
                    example: 149
                  currency:
                    description: Currency code of the price
                    type: string
                    example: USD
              additionalAttributes:
                type: array
                description: A placeholder for additional attributes, in key-value pairs.
                items:
                  type: object
                  properties:
                    customSkuTitle:
                      type: string
                      example: HOUSE TREE
                    customCategory:
                      type: string
                      example: HOME
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````