Price Lists [API]
Customer price lists allow you to define multiple prices that can be assigned to different customers. Eg if you have a set of customers that orders products at a specific price and another set of customers that orders products at a different price, you can create two different pricelists and assign customers accordingly.
Notes: When you define a product you can set the prices for different price lists. The price the customer will see will be based on the price list he/she is assigned to and the price that is assigned to the specific pricelist of a product.
Also, you can override the prices for specific customers (see Product Customer Prices)
Description |
List available Pricelists |
Action |
GET |
URL |
<your URL here>/api/pricelists |
Sample request parameters |
(empty – no data required) |
Sample Successful Response |
[
{
"id":1,
"name":"Wholesale Pricelist",
"short_name":"Wholesale Price",
"for_guests":false,
"cannot_delete":true,
"created_at":"2016-06-23T09:13:17.000Z",
"updated_at":"2016-06-23T09:13:17.000Z",
"sort":1,
"is_default":true,
"discount_percentage":"0.0",
"pricelist_id":null
},
{
"id":2,
"name":"Wholesale Pricelist 2",
"short_name":"Wholesale Price 2",
"for_guests":false,
"cannot_delete":false,
"created_at":"2016-06-23T09:13:17.000Z",
"updated_at":"2016-06-23T09:13:17.000Z",
"sort":2,
"is_default":false,
"discount_percentage":"0.0",
"pricelist_id":null
}
]
|
Description |
Create Pricelist |
Action |
POST |
URL |
<your URL here>/api/pricelists |
Sample request parameters |
{"pricelist":{"name":"Country Distributor Pricelist"}}
|
Sample Successful Response |
{
"id":8,
"name":"Country Distributor Pricelist",
"short_name":"Country Distributor Pricelist",
"for_guests":false,
"cannot_delete":false,
"created_at":"2016-09-11T11:35:14.345Z",
"updated_at":"2016-09-11T11:35:14.345Z",
"sort":null,
"is_default":false,
"discount_percentage":"0.0",
"pricelist_id":null
}
|
Description |
Update Pricelist |
Action |
PATCH/PUT |
URL |
<your URL here>/api/pricelists/<id of pricelist> |
Sample request parameters |
{"pricelist":{"name":"Big Distributor Pricelist"}}
|
Sample Successful Response |
{
"id":8,
"name":"Big Distributor Pricelist",
"short_name":"Country Distributor Pricelist",
"for_guests":false,
"cannot_delete":false,
"created_at":"2016-09-11T11:35:14.000Z",
"updated_at":"2016-09-11T11:41:51.038Z",
"sort":null,
"is_default":false,
"discount_percentage":"0.0",
"pricelist_id":null
}
|
Sample Failed Response |
If the pricelist you are trying to update does not exist you will receive a 404 error |
Required fields |
name |
Field descriptions for Price lists
Name |
Type |
Description |
Required |
name |
string |
Name of customer price list defined |
true |
short_name |
string |
Short Name of customer price list |
no |
for_guests |
boolean |
Price list is for guests or not (unused if products are private) |
auto calculated |
cannot_delete |
boolean |
Customer Price List is in system's default and cannot be deleted |
auto calculated |
created_at |
datetime |
Create Time |
auto calculated |
updated_at |
datetime |
Update Time |
auto calculated |
sort |
integer |
Show order |
no |
is_default |
boolean |
Is customer price list default for new customers? |
no |
pricelist_id |
integer |
Customer Price List is based on another customer price list |
no |
discount_percentage |
decimal |
If Customer Price List is based on another, all derived prices can be a discount based on the parent customer list |
no |