# PriceListItem

An object representing a price item in a price list for the current shop.

# Properties

Property Type Description
uid integer The unique identifier of the price list item.
priceList integer The identifier of the PriceList of the price list item.
article integer The identifier of the Article of the price list item.
currency string The three letter code of the currency.
qtyFloor number The quantity from where the price is applicable.
amount number The price

# Methods

# create

Creates a new price list item. This is shorthand for set with the unique identifier null.

# delete

Removes an existing price list item.

# Parameters

Parameters Description
uid UID of object to delete.

# get

Fetches information about a price list item.

# Parameters

Parameter Description
uid The unique identifier of the price list.
query Which info to return. See Query language.

# Example

PriceListItem.get(12345)

# getSchema

Fetches the JSON Schema which can be used for client-side validation.

# Parameters

The unique identifier of the price list item.

# list

Returns an array of objects representing price list items.

# Parameters

Parameter Description
query Which info to return. See Query language.
selection Which price lists to list. See List selection.

# Filters

Filtering on the properties using their JSON pointers is possible. For example, list all price list items in price list 13991 for article 172358573:

PriceListItem.list({
  "uid": true,
  "priceList": true,
  "article": true,
  "currency": true,
  "qtyFloor": true,
  "amount": true
}, {
  "filters": {
    "/priceList": {
      "in": [
        13991
      ]
    },
    "/article": 172358573
  },
  "sort": "uid",
  "descending": false,
  "offset": 0,
  "limit": 500
})

# Pagination

The API will return maximum 500 items even if there are more than 500 price list items. To hande more than 500 items you will need to make several requests to PriceListItem.list and specify offset and limit until you receive an empty response. See List selection.

# lookup

Returns an array of objects representing price list items. Please note that this method is intended to be used for presentation only. No uid will be returned for price lists items.

# Parameters

Parameter Description
article Uid of the article
pricelist Uid of the pricelist
currency Currency code or null (optional)
quanity Get prices for this quantity (optional)

# set

Creates or updates a price list.

# Parameters

Parameter Description
uid The unique identifier of the price list item or null to create a new price list item.
patch An object containing the properties and values to set for the price list item.
query A query specifying what to return after a successful set (optional). See Query language.

# Example

PriceListItem.set(123456, {
  "priceList": 1,
  "article": 123,
  "currency": "SEK",
  "qtyFloor": 0,
  "amount": 100
}, [
  "uid",
  "currency",
  "amount"
])