/salesestimates/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:
Sales Estimates
postSalesEstimatesExport
Code samples
const inputBody = '{
"type": "object",
"properties": {
"salesEstimates": {
"type": "array",
"items": {
"type": "string",
"format": "mongoId"
},
"description": "Array of sales estimate IDs to export"
},
"selectAll": {
"type": "boolean",
"description": "Flag indicating whether to select all matching sales estimates"
},
"search": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "Filter by sales estimate number (optional)"
},
"customer": {
"type": "string",
"description": "Filter by customer name (optional)"
},
"status": {
"type": "string",
"description": "Filter by sales estimate status (optional)"
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/octet-stream'
};
fetch('https://goldleaf.app/api/v1/salesestimates/export',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /salesestimates/export
Export sales estimates data to a file
Exports sales estimate data to an Excel or similar file based on specified sales estimate IDs or search criteria. Requires admin role.
Body parameter
{
"type": "object",
"properties": {
"salesEstimates": {
"type": "array",
"items": {
"type": "string",
"format": "mongoId"
},
"description": "Array of sales estimate IDs to export"
},
"selectAll": {
"type": "boolean",
"description": "Flag indicating whether to select all matching sales estimates"
},
"search": {
"type": "object",
"properties": {
"number": {
"type": "string",
"description": "Filter by sales estimate number (optional)"
},
"customer": {
"type": "string",
"description": "Filter by customer name (optional)"
},
"status": {
"type": "string",
"description": "Filter by sales estimate status (optional)"
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | Sales estimates export parameters |
| » salesEstimates | body | [string] | false | Array of sales estimate IDs to export |
| » selectAll | body | boolean | false | Flag indicating whether to select all matching sales estimates |
| » search | body | object | false | none |
| »» number | body | string | false | Filter by sales estimate number (optional) |
| »» customer | body | string | false | Filter by customer name (optional) |
| »» status | body | string | false | Filter by sales estimate status (optional) |
Example responses
200 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Export file generated successfully | string |
| 400 | Bad Request | Invalid request payload | None |
| 401 | Unauthorized | Unauthorized - user must be authenticated | None |
| 403 | Forbidden | Forbidden - customers are blocked and admin role required | None |
| 500 | Internal Server Error | Internal server error | None |
