Skip to content

Batch pricelist update

Request

This endpoint allows updating multiple prices at once. Price fields and other attributes from a pricelist of a product (variant) can be updated. Batch update is processed asynchronously in same way as for example products snapshot, but it does not have resultUrl with prices to download in response. Instead, you can check attribute log which contains successfully updated prices and errors.

See how Asynchronous requests work on our developer's portal.

File with data for update must be in JSONL (jsonlines) format. Each line must contain one pricelist price in JSON format. Maximum size of file is 100MB.

Structure of JSON row is same as structure of JSON for single pricelist update. See Pricelist update schema for more details.

Asynchronous job process jsonl file row by row and try to validate and save data. If there is any error, row is skipped and error is logged, but it does not stop processing of other rows.

In Log, every product is identified by its position in file (starting from 1).

The request must contain a product variant code code and at least one of the price, priceWithVat, priceWithoutVat, orderableAmount or sales objects. Send only fields you want to change, the others will stay untouched. Be aware of the difference between

  • not providing a field: the field will not be changed

  • providing e. g. data.price.buyPrice: null will remove the price

If you set includingVat or vatRate field, current data for product (or variant) will be recalculated. (even through untouched by your request)

Object price directly sets price of product, without recalculating.

Object priceWithVat sets price of product, respecting it is price with VAT and thus recalculating if needed.

Object priceWithoutVat sets price of product, respecting it is price without VAT and thus recalculating if needed.

Note, that you can change buyPrice only for default price list! For others price lists, value stays null.

For non-vat payer e-shops, vatRate and includingVat fields are forbidden to use and fields price, priceWithVat and priceWithoutVat all works the same.

In order to change the currency of the prices, you will need to have the Currencies module activated on the customer's e-shop.

Note that if you change the currency code of the price list, all prices will not be recalculated to the new currency; only the currency code will be changed.

Security
shoptetAccessToken or shoptetPrivateApiToken
Path
idintegerrequired

Pricelist id

Example:1
Headers
Content-Typestringrequired
Default:"application/json"
Bodyapplication/json
batchFileUrlPathstringrequired

Url to batch file with products data. File must be in JSONL format.

curl -i -X PATCH \
  https://api.docs.shoptet.com/_mock/shoptet-api/openapi/api/pricelists/1/batch \
  -H 'Content-Type: application/json' \
  -H 'Shoptet-Access-Token: YOUR_API_KEY_HERE' \
  -d '{
    "batchFileUrlPath": "https://cdn.myshoptet.com/batch-products-update.jsonl"
  }'

Responses

Accepted

Bodyapplication/json
dataobjectrequired
errorsArray of objects or null(Errors)required
Response
{ "data": { "jobId": "ad24xod" }, "errors": [ {} ] }