PATCH /items/:id
Status codes
200on success400on invalid request404on item not found
Request properties
All optional properties that can overwrite the current value:
name: The name of the Item.category: The id of the new category.account_code: Account code string.vessel: The new vessel object:size: Size of the vessel in the specified unitunit: One of"l","dl","cl","ml","kg","g"or"quantity"type: Optional, see vessel and bundle types
count_fractions: The new value for expressing how fractional counts will be represented. Can be one of"l","dl","cl","ml","kg","g","quantity","quarters","decimal","none".price: The integer price in centsprice_per: One of"vessel","l","kg"or"100g"order_by: One of"vessel"or"kg"bundles: The array of bundle objects:type: See vessel and bundle typessize: The number of vessels in the bundle, or the number of bundles on the pallet iftypeis"PX".unit: Set tog, if the bundle is by weightpallet_bundle: Only iftypeis"PX". Specifies the bundle on the pallet:type: See vessel and bundle typessize: The number of vessels in the bundle
supplierThe new value for supplier properties:id: The id of the supplier.reference: The supplier reference for this item.
The following properties also accept null to delete the current value:
account_codevesselcount_fractionsbundlesorder_bypriceprice_persupplier
When an item is updated to have the same
supplier idandsupplier referenceas another active item, the operation will fail with a validation error.
Response properties
The response is the updated Item.
You can see all the Item properties on the GET /items/:id page under "Response properties".
Example request and response
Original Item:
{
"id": "itm_oh0IyIjqvd",
"category": "cat_KaNDv51Gh0",
"name": "Vodka",
"vessel": {
"size": 7,
"unit": "dl",
"type": "BO"
},
"price": 750,
"supplier": {
"id": 1693919950079,
"reference": "1100992"
}
}
Request body:
{
"category": "cat_UNASSIGNED",
"name": "The other vodka",
"vessel": null,
"price": null
}
Response body:
{
"id": "itm_oh0IyIjqvd",
"category": "cat_UNASSIGNED",
"name": "The other vodka",
"supplier": {
"id": 1693919950079,
"reference": "1100992"
}
}