---
title: "Generate URL to bulk upload price details"
method: POST
path: "/api-pim/item/upload-url"
tags: ["Upload price CSV"]
---

# Generate URL to bulk upload price details

`POST /api-pim/item/upload-url`

## Request

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

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.

## Headers

- `x-site-context` string, required

## Request body

- UploadUrlRequest
  - `fileName` string: Name of the file to upload
  - `type` union: Folder to save the csv files; depending on this will trigger one or other event
    - 'price' | 'price-range' | 'price-range-sku': `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.
    - 'price' | 'price-range' | 'price-range-sku': `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 ```
    - 'price' | 'price-range' | 'price-range-sku': `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.

## Response `200`

OK

- GetUploadURLResponse
  - `url` string: URL to upload the CSV. The URL is valid for 5 minutes.
  - `keyId` string: Key ID associated with the file

## Other responses

- `400`: Bad Request
- `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)
