/customers/items/import 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
postCustomersItemsImport
Code samples
const inputBody = '{
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary",
"description": "Excel file (.xlsx) containing customer items to import"
}
}
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/customers/items/import',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /customers/items/import
Import customer items via Excel file upload
Imports customer-item records in bulk from an uploaded Excel file. Only accessible to users with the admin role. Access is blocked for users with the customer role.
Body parameter
type: object
properties:
file:
type: string
format: binary
description: Excel file (.xlsx) containing customer items to import
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| ยป file | body | string(binary) | false | Excel file (.xlsx) containing customer items to import |
Example responses
500 Response
{
"oneOf": [
{
"type": "object",
"properties": {
"message": {
"type": "string"
},
"details": {
"type": "string"
}
}
},
{
"type": "string"
}
]
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 401 | Unauthorized | Unauthorized - Missing or invalid authentication | None |
| 500 | Internal Server Error | Server error | Inline |
