PUT
Change a unit of an item
Company space For: Manager · Permission: variant_units.update, bundle_units.update Conditions
  • The permission depends on the type of item: variant_units.update or bundle_units.update.
  • A sku or barcode sent must not be used by another unit of the organization; null is accepted for both. Empty values are not compared.
  • Reactivating an inactive unit is refused when its measurement category differs from the one of the item.
What else happens
  • Reactivating a unit sets the item’s measurement category when it had none.
Part of Set prices and units of sale.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

stockable
string
required

Identifier of the sellable item (stockable): the stockable record of a product variant or of a bundle, not the variant or bundle identifier itself.

unit
string
required

Identifier of the unit of measure (27-character KSUID).

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, stockable_id, uom_unit_id, sku, barcode, is_active, sort_order, created_at, updated_at.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: uomUnit, prices, stockable, stockable.vat_rate, stockable.taxes, stockable.subject.

Body

application/json
sku
string | null

New SKU, up to 512 characters, unique within the organization. null is accepted; when omitted the stored SKU is kept.

Maximum string length: 512
barcode
string | null

New barcode, up to 120 characters, unique within the organization when not null. Send null to clear it; when omitted the stored barcode is kept.

Maximum string length: 120
is_active
boolean

Set false to deactivate the unit or true to reactivate it. Reactivation is refused when the unit's measurement category differs from the item's. When omitted, the state is kept.

sort_order
integer

Display position, integer of at least 0. When omitted, the stored position is kept.

Response

Resource (only with response=resource).

id

Identifier of the unit of sale (27-character KSUID string).

stockable_id

Identifier of the item the unit belongs to.

uom_unit_id

Identifier of the unit of measure (for example piece or box) this unit of sale uses.

sku

Stock keeping unit code, unique within the organization. Generated as ITEM-UNIT-001 when not sent at creation.

barcode

Barcode of the unit, unique within the organization when set; null when none.

is_active
boolean

Whether the unit can be used for new prices and sales. A unit already used by orders is deactivated instead of deleted.

sort_order
integer

Display position of the unit; lower values come first. 0 when not sent at creation.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).

uom_unit
object | null

Unit of measure object. Only returned when selected with ?include=uomUnit.

prices
array

Prices of this unit for the caller's company. Only returned when selected with ?include=prices.

stockable
object | null

The item the unit belongs to. Only returned when selected with ?include=stockable.