/pricelists/export 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
postPriceListsExport
Code samples
const inputBody = '{
"type": "object",
"required": [
"priceLists",
"selectAll"
],
"properties": {
"priceLists": {
"type": "array",
"items": {
"type": "string",
"format": "mongoId"
},
"description": "Array of price list IDs to export"
},
"selectAll": {
"type": "boolean",
"description": "Whether to export all price lists ignoring the priceLists array"
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/pricelists/export',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /pricelists/export
Export price list data to Excel
Exports price list data to an Excel file based on specified price list IDs. Requires admin role.
Body parameter
{
"type": "object",
"required": ["priceLists", "selectAll"],
"properties": {
"priceLists": {
"type": "array",
"items": {
"type": "string",
"format": "mongoId"
},
"description": "Array of price list IDs to export"
},
"selectAll": {
"type": "boolean",
"description": "Whether to export all price lists ignoring the priceLists array"
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » priceLists | body | [string] | true | Array of price list IDs to export |
| » selectAll | body | boolean | true | Whether to export all price lists ignoring the priceLists array |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Excel file generated and returned successfully | None |
| 400 | Bad Request | Bad request - invalid input data | None |
| 500 | Internal Server Error | none | string |
