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

# Generate URL to bulk upload price details

> This endpoint lets you generate a secured S3 URL using which you can upload the CSV file containing price details. Ensure that all the headers and values in the CSV file are double-quoted. After a file is uploaded, it is processed internally to apply bulk changes to price details.<br /><br />**Note:** The maximum number of rows with price records to upload per CSV file is 5000.



## OpenAPI

````yaml offers_v2_combined post /api-pim/item/upload-url
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-pim/item/upload-url:
    post:
      tags:
        - Upload price CSV
      summary: Generate URL to bulk upload price details
      description: >-
        This endpoint lets you generate a secured S3 URL using which you can
        upload the CSV file containing price details. Ensure that all the
        headers and values in the CSV file are double-quoted. After a file is
        uploaded, it is processed internally to apply bulk changes to price
        details.<br /><br />**Note:** The maximum number of rows with price
        records to upload per CSV file is 5000.
      parameters:
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/uploadUrlRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/getUploadURLResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error400'
        '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"}
  schemas:
    uploadUrlRequest:
      type: object
      properties:
        fileName:
          type: string
          example: file1.csv
          description: Name of the file to upload
        type:
          description: >-
            Folder to save the csv files; depending on this will trigger one or
            other event
          example: price
          required:
            - fileName
            - type
          enum:
            - price
            - price-range
            - price-range-sku
          oneOf:
            - title: price
              type: string
              example: price
              description: >-
                `price`: Folder to upload the CSV to apply bulk changes to
                normal or current offer prices. The CSV to be uploaded must have
                following columns:
                 - **SKU ID**: `Required` SKU of the item.

                 - **Cost**: `Required` Cost of the item.

                 - **Price**: `Required` Base price of the item.

                 - **Clearance Price**: `Optional` Sale price of the item.

                 - **Start Date(UTC)**: `Required` From this start date, the
                current price will be available. The format must be
                `YYYY-MM-DDThh:mm:ssZ`. For example, `2021-08-31T17:09:18.407Z`.
                The date has to be greater than the current date.

                 - **Price List Id**: `Required` Price list ID for the price.


                 CSV Example:
                   ```
                   SKU ID,Cost,Price,Clearance Price,Start Date(UTC),Price List
                Id
                   COFFEE,10,25,15,2021-08-31T17:09:18.407Z,100000

                   ```

                 The result of the upload will be saved on import history.
            - title: price-range
              type: string
              example: price-range
              description: >
                `price-range` - Folder to upload prices with range (1 and 2
                dimensional). The CSV to be uploaded must have the following
                columns:

                - **REFID**: `Required` SKU of the item.

                - **Length**: `Required` Length or minimum quantity to get a
                specific price. It has to be a valid integer.

                - **Width**: `Optional` Width to get a specific price. It has to
                be a valid integer. It is required only if Price Method Type is
                SurfaceArea_Square_Increment_2Dim.

                - **Price**: `Required` The price for an item, it has to be a
                valid float.

                - **motorized**: `Optional` Attributes or addons, on the rows
                the prices for this addon has to be set. Any extra column will
                be taken as an attribute or addon.

                - **Price Method Type**: `Optional` It must be one of the three
                allowed price method types: `Range-Base`,
                `SurfaceArea_Square_Increment`,
                `SurfaceArea_Square_Increment_2Dim`, otherwise that row will
                display an error

                - **Start Date(UTC)**: `Optional` Start Date and End date are
                optional. If set, they must be equal or greater than `now` and
                have consistency between them. The format must be
                `YYYY-MM-DDThh:mm:ssZ`. For example, `2021-08-31T17:09:18.407Z`.

                - **End Date(UTC)**: `Optional` Start Date and End date are
                optional. If set, they must be equal or greater than `now` and
                have consistency between them. The format must be
                `YYYY-MM-DDThh:mm:ssZ`. For example, `2021-08-31T17:09:18.407Z`.

                - **Price List Name**: `Optional` The price list ID has to be
                provided. If not sent, the prices will registered under the
                default price list.


                CSV Example with full headers:
                  ```
                  REFID,Length,Width,Price,motorized
                  TEST,30,30,285,665
                  TEST,30,34,300,665
                  TEST,36,42,365,665
                  TEST,36,48,390,665
                  TEST,42,54,405,665
                  ```
                CSV Example with some headers:
                  ```
                  REFID,Length,Width,Price,motorized,Price Method Type,Start
                Date(UTC),End Date(UTC),Price List Name
                  TEST,30,30,285,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,30,34,300,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,36,42,365,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,36,48,390,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  TEST,42,54,405,665,SurfaceArea_Square_Increment_2Dim,,,100000
                  ```
            - title: price-range-sku
              type: string
              example: price-range-sku
              description: >-
                `price-range-sku` - Folder to upload RH prices, only for
                SurfaceArea_Square_Increment types. This event will request RH
                service internally to get the price. Only SKU is needed in the
                CSV.

                The CSV to be uploaded has to have the following columns:

                - **FULL_SKU_ID**: `Required` SKU of the item


                CSV Example:
                  ```
                  FULL_SKU_ID
                  10015762FOG
                  10015760CRBN
                  ```

                As we are only uploading the SKU the process will load
                internally the following values for each SKU uploaded:
                  - priceListId: default price list
                  - startDate: now()
                  - endDate: 2100-01-01
                  - base: 0
                  - currency: it will be set to *USD*
                  - price method type: SurfaceArea_Square_Increment
                  - range.minQuantity: 1.
                  - range.maxQuantity: Infinity.
                  - price: this value will be populated by RH service.
    getUploadURLResponse:
      type: object
      properties:
        url:
          type: string
          description: URL to upload the CSV. The URL is valid for 5 minutes.
          example: >-
            https://example.s3.amazonaws.com/pricelist/123/dev02/123-priceList1.csv?X-Amz-Algorithm...x-amz-meta-stage=dev02
        keyId:
          type: string
          description: Key ID associated with the file
          example: 1646680518524-priceList1
    error400:
      type: object
      properties:
        code:
          description: The error code.
          type: string
          example: BAD_REQUEST
        message:
          description: An error message coressponding to the `code`.
          type: string
          example: Bad Request
    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.
  securitySchemes:
    AuthorizationToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````