LianaCommerce REST API

Prices

Serverhttps://shop.example.com/api/v1

Update the prices of many products and variations in one request, by id, product code, EAN code or ERP id.


Update prices in bulk

POST
https://shop.example.com/api/v1
/prices

Updates the prices of products and variations. The body is an array; each element names one product or variation, or a code that can match several, and the prices to set. Prices you leave out keep their value. Products and variations are not created.

Which items an element updates depends on its identifier and its price fields:

  • product_id updates that product with price, suggested_retail_price, vat and inventory_price. additional_price is ignored.
  • variation_id updates that variation with inventory_price and additional_price. The other price fields are ignored.
  • code, ean_code and erp_id are looked up in both products and variations, and every match is updated: products if the element has a product price field, variations if it has inventory_price or additional_price. An element that has additional_price and a product-only field (price, suggested_retail_price or vat) returns 400.

Deleted products and variations are never matched. Send each product or variation once per request.

The response lists the updated products and variations, highest id first, not in request order. If some elements updated nothing (an unknown identifier, or price fields that don't apply to it), the response lists them in not_found. If no element matched anything, the response is 404; if no element has a price field that applies to its identifier, it is 400.

Update prices in bulk › Request Body

​PriceIn[] · minItems: 1
One price update: exactly one identifier (`product_id`, `variation_id`, `code`, `ean_code` or `erp_id`) and at least one price field. Numbers must be JSON numbers, not strings; `null` is not accepted for a price field, `code`, `ean_code` or `erp_id`.
product_id
​integer

Updates the product with this id.

Example: 42
variation_id
​integer

Updates the variation with this id.

Example: 311
code
​string

Updates every product whose product code is this value and every variation whose code is this value.

Example: COFFEE-500
ean_code
​string

Updates every product and variation with this EAN code.

Example: 6412345678903
erp_id
​string

Updates every product and variation with this ERP id.

Example: ERP-10042
price
​number

The product's base price, stored with 5 decimals. Products only.

Example: 12.9
suggested_retail_price
​number

The product's suggested retail price, stored with 5 decimals. Products only.

Example: 14.9
vat
​number · min: 0 · max: 100

The product's VAT percentage, stored with 2 decimals. Products only.

Example: 14
inventory_price
​number

The inventory price, stored with 2 decimals. Products and variations.

Example: 6.5
additional_price
​number

The variation's additional price on top of the product's price, stored with 2 decimals. Variations only.

Example: 2

Update prices in bulk › Responses

The updated products and variations, and not_found if some elements updated nothing. The response has no paging links.

href
​string

The URL of the request.

Example: https://shop.example.com/api/v1/products
​PriceNotFound[]

The elements that updated nothing, each as its identifier field and the value you sent. Present only if some elements updated nothing.

​object[]
​Meta