/pricelists/create v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Price Lists
postPriceListCreate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"listPriceId": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the list price, optional and can be nullable.",
"nullable": true
},
"name": {
"type": "string",
"description": "The name of the pricing list.",
"nullable": true
},
"defaultCurrency": {
"type": "string",
"description": "The default currency for the pricing list.",
"nullable": true
},
"listPricing": {
"type": "boolean",
"description": "Flag indicating if list pricing is enabled.",
"nullable": true
},
"defaultMarginPercentMaterials": {
"type": "number",
"format": "decimal",
"description": "The default margin percent for materials.",
"nullable": true
},
"defaultMarginPercentLabour": {
"type": "number",
"format": "decimal",
"description": "The default margin percent for labor.",
"nullable": true
},
"defaultDiscountPercentMaterials": {
"type": "number",
"format": "decimal",
"description": "The default discount percent for materials.",
"nullable": true
},
"defaultItemPricing": {
"type": "array",
"items": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Flag indicating if the item pricing is enabled.",
"nullable": true
},
"listPricing": {
"type": "boolean",
"description": "Flag indicating if list pricing is applied to this item.",
"nullable": true
},
"defaultDiscountPercent": {
"type": "number",
"format": "decimal",
"description": "The default discount percent for the item.",
"nullable": true
},
"defaultMarginPercent": {
"type": "number",
"format": "decimal",
"description": "The default margin percent for the item.",
"nullable": true
}
}
},
"description": "The default pricing settings for items.",
"nullable": true
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/pricelists/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /pricelists/create
Create a price list
Creates a price list for the organization.
Body parameter
{
"type": "object",
"properties": {
"listPriceId": {
"type": "string",
"format": "mongo-id",
"description": "The MongoDB ID of the list price, optional and can be nullable.",
"nullable": true
},
"name": {
"type": "string",
"description": "The name of the pricing list.",
"nullable": true
},
"defaultCurrency": {
"type": "string",
"description": "The default currency for the pricing list.",
"nullable": true
},
"listPricing": {
"type": "boolean",
"description": "Flag indicating if list pricing is enabled.",
"nullable": true
},
"defaultMarginPercentMaterials": {
"type": "number",
"format": "decimal",
"description": "The default margin percent for materials.",
"nullable": true
},
"defaultMarginPercentLabour": {
"type": "number",
"format": "decimal",
"description": "The default margin percent for labor.",
"nullable": true
},
"defaultDiscountPercentMaterials": {
"type": "number",
"format": "decimal",
"description": "The default discount percent for materials.",
"nullable": true
},
"defaultItemPricing": {
"type": "array",
"items": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"description": "Flag indicating if the item pricing is enabled.",
"nullable": true
},
"listPricing": {
"type": "boolean",
"description": "Flag indicating if list pricing is applied to this item.",
"nullable": true
},
"defaultDiscountPercent": {
"type": "number",
"format": "decimal",
"description": "The default discount percent for the item.",
"nullable": true
},
"defaultMarginPercent": {
"type": "number",
"format": "decimal",
"description": "The default margin percent for the item.",
"nullable": true
}
}
},
"description": "The default pricing settings for items.",
"nullable": true
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » listPriceId | body | string(mongo-id)¦null | false | The MongoDB ID of the list price, optional and can be nullable. |
| » name | body | string¦null | false | The name of the pricing list. |
| » defaultCurrency | body | string¦null | false | The default currency for the pricing list. |
| » listPricing | body | boolean¦null | false | Flag indicating if list pricing is enabled. |
| » defaultMarginPercentMaterials | body | number(decimal)¦null | false | The default margin percent for materials. |
| » defaultMarginPercentLabour | body | number(decimal)¦null | false | The default margin percent for labor. |
| » defaultDiscountPercentMaterials | body | number(decimal)¦null | false | The default discount percent for materials. |
| » defaultItemPricing | body | [object]¦null | false | The default pricing settings for items. |
| »» enabled | body | boolean¦null | false | Flag indicating if the item pricing is enabled. |
| »» listPricing | body | boolean¦null | false | Flag indicating if list pricing is applied to this item. |
| »» defaultDiscountPercent | body | number(decimal)¦null | false | The default discount percent for the item. |
| »» defaultMarginPercent | body | number(decimal)¦null | false | The default margin percent for the item. |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | the newly created item | None |
| 500 | Internal Server Error | Internal server error | string |
