/customer/{customerId}/items/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:
Customers
postCustomerIdItemsExport
Code samples
const inputBody = '{
"type": "object",
"properties": {
"customerItems": {
"type": "array",
"description": "List of customer item MongoDB ObjectIds to export or exclude",
"items": {
"type": "string",
"format": "mongoId"
}
},
"selectAll": {
"type": "boolean",
"description": "If true, export all customer items except those listed in `customerItems`"
}
},
"required": [
"selectAll"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
};
fetch('https://goldleaf.app/api/v1/customer/{customerId}/items/export',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /customer/{customerId}/items/export
Export customer items
Export selected customer items or all items based on the selectAll flag. If selectAll is true, all items except those explicitly listed in customerItems will be exported. Only accessible to users with the admin role. Access is blocked for users with the customer role.
Body parameter
{
"type": "object",
"properties": {
"customerItems": {
"type": "array",
"description": "List of customer item MongoDB ObjectIds to export or exclude",
"items": {
"type": "string",
"format": "mongoId"
}
},
"selectAll": {
"type": "boolean",
"description": "If true, export all customer items except those listed in `customerItems`"
}
},
"required": ["selectAll"]
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| customerId | path | string | true | The MongoDB ObjectId of the customer |
| body | body | object | true | none |
| » customerItems | body | [string] | false | List of customer item MongoDB ObjectIds to export or exclude |
| » selectAll | body | boolean | true | If true, export all customer items except those listed in customerItems |
Example responses
200 Response
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Exported Excel file containing customer data | string |
| 400 | Bad Request | Bad request - No customer items specified | None |
| 500 | Internal Server Error | Server error | string |
