price-lists

price-lists.find

Returns the price lists that meet the given conditions.

JS
CR.api('commerce.price-lists.find', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.price-lists.find

request

{
  "conditions" : { // returns only the price lists …
    "isDefault" : false, // … that are the default price list or not - bool
    "isBase" : true // … that are a base price list or not - bool
  },
  "fields" : [ "id", "name", … ], // fields to return - string
  "order" : [ "name" ], // sort order of returned price lists, can contain "id", "-id", "name", "-name", "baseList", "-baseList",
                        // "change", "-change", "allowOrders", "-allowOrders", "allowQuotes", "-allowQuotes", "showTax", "-showTax" - string
  "limit" : 10, // maximum number of price lists to return - int(1…100)
  "first" : 30 // index of the first price list to return - int(0…)
}

response

{
  "status" : "ok",
  "priceLists" : [ {
    "id" : 3, // identifier - int(1…)
    "name" : "Resellers", // name - string(0…120)    
    "baseList" : 1, // listino da cui dipende (id) (can be null) - int(1…)    
    "change" : -20, // price change - int(-99…99)    
    "allowOrders" : true, // indicates if orders are allowed - bool    
    "minOrder" : 100.00, // minimum subtotal allowed for an order (can be null) - decimal[10,2](0…)    
    "maxOrder" : 5000.00, // maximum subtotal allowed for an order (can be null) - decimal[10,2](0…)    
    "allowQuotes" : false, // indicates if quotes are allowed - bool    
    "showTax" : false, // indicates if the prices are showed tax included to the clients - bool    
    "isDefault" : false // indicates if it is the default price list - bool
  }, … ]
}

price-lists.get

Returns a price list given its identifier.

JS
CR.api('commerce.price-lists.get', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.price-lists.get

request

{
  "id" : 3, // identifier of the price list to return (required) - int(1…)
  "fields" : [ "id", "name", … ] // fields to return - string
}

response

{
  "status" : "ok",
  "priceList" : {
    "id" : 3, // identifier - int(1…)
    "name" : "Resellers", // name - string(0…120)    
    "baseList" : 1, // listino da cui dipende (id) (can be null) - int(1…)    
    "change" : -20, // price change - int(-99…99)    
    "allowOrders" : true, // indicates if orders are allowed - bool    
    "minOrder" : 100.00, // minimum subtotal allowed for an order (can be null) - decimal[10,2](0…)    
    "maxOrder" : 5000.00, // maximum subtotal allowed for an order (can be null) - decimal[10,2](0…)    
    "allowQuotes" : false, // indicates if quotes are allowed - bool    
    "showTax" : false, // indicates if the prices are showed tax included to the clients - bool    
    "isDefault" : false // indicates if it is the default price list - bool
  }
}

price-lists.count

Number of price lists that meet the given conditions.

JS
CR.api('commerce.price-lists.count', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.price-lists.count

request

{
  "conditions" : { // counts only the price lists …
    "isDefault" : false, // … that are the default price list or not - bool
    "isBase" : true // … that are a base price list or not - bool
  }
}

response

{
  "status" : "ok",
  "count" : 7 // number of price lists - int(0…)
}

price-lists.create

Create a new price list.

JS
CR.api('commerce.price-lists.create', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.price-lists.create

request

{
  "priceList" : { // price list to create (required)
    "name" : "Resellers", // name - string(0…120)
    "baseList" : 1, // listino da cui dipende (id) (can be null) - int(1…)
    "change" : -20, // price change - int(-99…99)
    "allowOrders" : true, // indicates if orders are allowed - bool
    "minOrder" : 100.00, // minimum subtotal allowed for an order (can be null) - decimal[10,2](0…)
    "maxOrder" : 5000.00, // maximum subtotal allowed for an order (can be null) - decimal[10,2](0…)
    "allowQuotes" : false, // indicates if quotes are allowed - boo
    "showTax" : false, // indicates if the prices are showed tax included to the clients - bool
    "isDefault" : false // indicates if it is the default price list - bool
  }
}

response

{
  "status" : "ok",
  "id" : 3 // identifier of the new price list - int(1…)
}

Errors

Field Type Description
priceList LimitReached Maximum limit of price lists has been reached
baseList InvalidValue Price list <baseList> does not exist or is not a base price list

price-lists.update

Updates a price list. Any fields left out of the request will remain unchanged.

JS
CR.api('commerce.price-lists.update', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.price-lists.update

request

{
  "id" : 3, // identifier of the price list to update (required)
  "priceList" : { // price list's fields to update (required)
    "name" : "Resellers", // name - string(0…120)
    "baseList" : 1, // listino da cui dipende (id) - int(1…)
    "change" : -20, // price change - int(-99…99)
    "allowOrders" : true, // indicates if orders are allowed - bool
    "minOrder" : 100.00, // minimum subtotal allowed for an order - decimal[10,2](0…)
    "maxOrder" : 5000.00, // maximum subtotal allowed for an order - decimal[10,2](0…)
    "allowQuotes" : false, // indicates if quotes are allowed - bool
    "showTax" : false, // indicates if the prices are showed tax included to the clients - bool
    "isDefault" : false // indicates if it is the default price list - bool
  }
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
id NotFound Price list <id> does not exist
baseList CannotChange 'BaseList' can not be changed for base price lists
baseList NotFound Price list <baseList> does not exist
baseList InvalidValue Price list <baseList> is not a base price list
change CannotChange 'change' can not be changed for a base price list

price-lists.delete

Deletes one or more price lists.

JS
CR.api('commerce.price-lists.delete', request, function(response) { … });
HTTP
POST /open2b/api/v3/commerce.price-lists.delete

request

{
  "ids" : [ 3, 7, … ] // identifiers of the price lists to delete (required) - int(1…)
}

response

{
  "status" : "ok"
}

Errors

Field Type Description
ids InvalidValue Default price list <id> can not be deleted