POST /items
Status codes
200
on success400
on invalid request
Request properties
The request body must contain these properties:
category
: The ID of the categoryname
: The name of the Item
It can also contain the following optional properties:
account_code
: Optional string with the account codevessel
: The vessel object:size
: Size of the vessel in the specified unitunit
: One of"l"
,"dl"
,"cl"
,"ml"
,"kg"
,"g"
or"quantity"
type
: See vessel and bundle types
supplier
contains information about the supplier:id
: The id of the supplier.reference
: The supplier reference for this item.
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 iftype
is"PX"
.unit
: Set tog
, if the bundle is by weightpallet_bundle
: Only iftype
is"PX"
. Specifies the bundle on the pallet:type
: See vessel and bundle types.size
: The number of vessels in the bundle.
price
: The integer price in centsprice_per
: One of"vessel"
,"l"
,"kg"
or"100g"
order_by
: Optional property set to"vessel"
or"kg"
count_fractions
: Optional value expressing how fractional counts will be represented. Can be one of"l"
,"dl"
,"cl"
,"ml"
,"kg"
,"g"
,"quantity"
,"quarters"
,"decimal"
,"none"
.
When an item is created with the same
supplier id
andsupplier reference
as an existing active item, the operation will fail with a validation error.
Response properties
Same as the request body but with the new item's id.
You can see all the Item properties on the GET /items/:id page under "Response properties".
Example request and response
Request body:
{
"category": "cat_KaNDv51Gh0",
"name": "Vodka",
"vessel": {
"size": 7,
"unit": "dl",
"type": "BO"
},
"price": 1275,
"price_per": "l",
"supplier": {
"id": 1693919950079,
"reference": "1100992"
}
}
Response body:
{
"id": "itm_80oz3W0dka",
"category": "cat_KaNDv51Gh0",
"name": "Vodka",
"vessel": {
"size": 7,
"unit": "dl",
"type": "BO"
},
"price": 1275,
"price_per": "l",
"supplier": {
"id": 1693919950079,
"reference": "1100992"
}
}