/inventoryitems/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:
Inventory
postInventoryItemsExport
Code samples
const inputBody = '{
"type": "object",
"properties": {
"inventoryItems": {
"type": "array",
"description": "List of inventory item IDs to export",
"items": {
"type": "string",
"example": "60f6c4d2b4e6a51234567890"
}
},
"selectAll": {
"type": "boolean",
"description": "Whether to export all matching items",
"example": false
},
"search": {
"type": "object",
"description": "Search filters to apply when selectAll is true",
"properties": {
"partNumber": {
"type": "string",
"example": "PN-1234"
},
"brandName": {
"type": "string",
"example": "Acme"
},
"warehouseName": {
"type": "string",
"example": "Main Warehouse"
},
"itemType": {
"type": "string",
"example": "component"
}
}
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/inventoryitems/export',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /inventoryitems/export
Export inventory items
Exports selected inventory items to an Excel spreadsheet. Requires admin or regular user roles.
Body parameter
{
"type": "object",
"properties": {
"inventoryItems": {
"type": "array",
"description": "List of inventory item IDs to export",
"items": {
"type": "string",
"example": "60f6c4d2b4e6a51234567890"
}
},
"selectAll": {
"type": "boolean",
"description": "Whether to export all matching items",
"example": false
},
"search": {
"type": "object",
"description": "Search filters to apply when selectAll is true",
"properties": {
"partNumber": {
"type": "string",
"example": "PN-1234"
},
"brandName": {
"type": "string",
"example": "Acme"
},
"warehouseName": {
"type": "string",
"example": "Main Warehouse"
},
"itemType": {
"type": "string",
"example": "component"
}
}
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » inventoryItems | body | [string] | false | List of inventory item IDs to export |
| » selectAll | body | boolean | false | Whether to export all matching items |
| » search | body | object | false | Search filters to apply when selectAll is true |
| »» partNumber | body | string | false | none |
| »» brandName | body | string | false | none |
| »» warehouseName | body | string | false | none |
| »» itemType | body | string | false | none |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Inventory items exported successfully | None |
| 400 | Bad Request | Bad request – validation failed | None |
| 500 | Internal Server Error | Internal server error | string |
