POST
/
api-pim
/
item
/
upload-url
Generate URL to bulk upload price details
curl --request POST \
  --url https://live.copilot.fabric.inc/api-pim/item/upload-url \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '{
  "fileName": "file1.csv",
  "type": "price"
}'
{
  "url": "https://example.s3.amazonaws.com/pricelist/123/dev02/123-priceList1.csv?X-Amz-Algorithm...x-amz-meta-stage=dev02",
  "keyId": "1646680518524-priceList1"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-site-context
string
required

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.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

Body

application/json
fileName
string

Name of the file to upload

Example:

"file1.csv"

type

Folder to save the csv files; depending on this will trigger one or other event 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.

Available options:
price,
price-range,
price-range-sku
Example:

"price"

Response

OK

url
string

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
string

Key ID associated with the file

Example:

"1646680518524-priceList1"