Update an Item

PATCH /items/:id

You cannot use supplier.id to switch an Item to a YBM Connect supplier. Supplier-managed products must be imported from YBM Connect; an Item already linked to such a product cannot be switched to another supplier through this endpoint.

Status codes

  • 200 on success
  • 400 on invalid request
  • 404 on 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 Product group.
  • account_code: Account code string.
  • external_id: Identifier from an external system.
  • vessel: The new vessel object:
    • size: Size of the vessel in the specified unit
    • unit: 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 cents
  • container_price: Container deposit price in cents.
  • price_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 types
    • size: The number of vessels in the bundle, or the number of bundles on the pallet if type is "PX".
    • unit: Set to g, if the bundle is by weight
    • pallet_bundle: Only if type is "PX". Specifies the bundle on the pallet:
  • supplier: The new value for Supplier properties:
    • id: The required supplier ID when a supplier object is sent.
    • reference: The supplier reference for this item.
    • comment: Account-specific supplier note.
    • connect.price_linked: For an imported YBM Connect Item, whether the supplier's price remains linked.
  • min_inventory: Minimum stock level, with integer count and an optional package unit.
  • custom_properties: Additional product details such as description and labels.
  • links.replacement: ID of an Item that replaces this one, or null to remove the link.

The following properties also accept null to delete the current value:

  • account_code
  • vessel
  • count_fractions
  • bundles
  • order_by
  • price
  • price_per
  • supplier
  • container_price
  • min_inventory
  • external_id
  • custom_properties

Changing an Item's vessel or order_by is restricted when master_data_locked is true or weight-based bundles are present. The API checks vessel compatibility and may reject ordering-unit changes. A Product group other than cat_UNASSIGNED must exist in your account. order_by="kg" requires a 1 kg vessel; price_per and count_fractions must be compatible with the vessel unit.

If another active Item has the same supplier ID and supplier reference, the API rejects the update with 400 (ITEM_DUPLICATE_REFERENCE).

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"
  }
}