/customer/{customerId}/item/{itemId}/update 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
postCustomerIdItemIdUpdate
Code samples
const inputBody = '{
"type": "object",
"properties": {
"price": {
"type": "number",
"example": 19.99
},
"discount": {
"type": "number",
"example": 0.1
},
"notes": {
"type": "string",
"example": "Special pricing agreement"
}
},
"additionalProperties": true,
"description": "Fields validated by customerItemPropertiesExpressValidationSchema."
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/customer/{customerId}/item/{itemId}/update',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /customer/{customerId}/item/{itemId}/update
Update a customer item
Updates the properties of an item associated with a specific customer. Only accessible to users with admin or regular roles. Access is blocked for users with the customer role.
Body parameter
{
"type": "object",
"properties": {
"price": {
"type": "number",
"example": 19.99
},
"discount": {
"type": "number",
"example": 0.1
},
"notes": {
"type": "string",
"example": "Special pricing agreement"
}
},
"additionalProperties": true,
"description": "Fields validated by customerItemPropertiesExpressValidationSchema."
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| customerId | path | string | true | MongoDB ObjectId of the customer. |
| itemId | path | string | true | MongoDB ObjectId of the item. |
| body | body | object | true | none |
| » price | body | number | false | none |
| » discount | body | number | false | none |
| » notes | body | string | false | none |
Example responses
500 Response
{
"type": "object",
"properties": {
"message": {
"type": "string"
},
"details": {
"type": "object",
"nullable": true
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Customer item updated successfully. | None |
| 500 | Internal Server Error | Internal server error. | Inline |
Response Schema
Status Code 500
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » message | string | false | none | none |
| » details | object¦null | false | none | none |
