saveSupplierPriceList

Create supplier price list, or add prices to an existing price list.

Contact Erply Helpdesk to enable Supplier Price Lists module on your account. (If not enabled, API returns error 1006.)

If you need to create a very large price list (with thousands of items), we strongly recommend to create it in parts — create the list itself with the first API call, and then add items into the list with each subsequent call, eg. in batches of 1000.

If needed, you can edit just an existing price list's name, status, validity dates and supplier. In that case, API will not modify price list contents. However, you can also use this call for adding or updating prices in an existing price list. If you send any price list rules, API will check if the specified product already exists in price list. If yes, that price list item will be updated. If not, a new one will be added.

If you want to remove any items from the price list, use the removeItemsFromSupplierPriceList API call.

If you have the Quantity Discounts module enabled, please note that each product may have multiple entries in the price list. If you want to address and update one specific rule, you also need to pass along the "amount" parameter.

Input parameters

Parameter name Description Possible value Required
supplierPriceListID Price list ID.
If this parameter is present the specified price list will be updated.
integer
name Price list name. string yes
supplierID Supplier ID. integer yes
startDate string Valid From date. ISO date (yyyy-mm-dd)
endDate string Valid Until date. ISO date (yyyy-mm-dd)
active Setting this field to 1 activates the price list, setting it to 0 disables it. 0 or 1
***** Price list rules. Each rule consists of a set of parameters. The "#" in parameter names denotes rule number. When preparing input parameters for this API call, please give a sequential number (1, 2, 3, ...) to each rule you send.
When updating an existing price list, API will only update the rules specified in input data and leave all other existing rules unchanged. You cannot use saveSupplierPriceList to delete a rule. For that purpose, see API call removeItemsFromSupplierPriceList instead.
productID# Product ID. integer yes
price# Discounted price for a product. number yes
amount# Available only if Quantity discounts module is enabled on your account. The quantity threshold from which the specified price will apply. integer yes
***** Additional attributes associated with this item.
Attributes must be supplied as a flat list, each attribute defined by the following set of three parameters. Replace # with set number (1, 2, 3, ...).

When updating an existing entry, API will only update the attributes specified in input data and leave all other existing attributes unchanged. To delete an attribute, set its value to 'null' or 'undefined'.
attributeName# Attribute name. Name can only contain the following symbols: A-Z, a-z, 0-9, dash and underscore. string
attributeType# Attribute type, possible types are 'text', 'int' and 'double'. By default 'text'. string
attributeValue# Value of the attribute. Set value to 'null' or 'undefined' to delete an attribute.
'text' attribute can be any string, maximum 255 characters.
'int' must be a signed 32-bit integer.
'double' must be a decimal number.
string
***** End of attribute fields

Response

Field name Type Description
supplierPriceListID integer ID of the newly-created item