Skip to content

Update a SKU

Request

Updates a SKU of the sales channel. The properties you leave out keep their value, and a null batch_tracking_enabled is ignored. The SKU is active afterwards, even if it was deleted.

Security
BearerAuth
Path
idinteger, (int64)required

The Hive ID of the SKU.

Bodyapplication/json
barcodestring or null, non-empty

The SKU's barcode. Must not be an empty string.

batch_tracking_enabledboolean or null

Whether inventory of this SKU is tracked per batch. null leaves it unchanged.

cost_in_centsinteger or string or null^-?[0-9]+$

The cost (not the price) of one unit, in cents. A string of digits is accepted too.

country_code_of_originstring or null

The 2-letter ISO 3166-1 code of the country of origin.

hs_codestring or null
image_urlstring or null

A publicly accessible URL of an image of the SKU.

merchant_sku_idstring

Your identifier for the SKU, unique within the sales channel.

namestring

The SKU's name.

weight_in_kgnumber or string or null^-?[0-9]+(\.[0-9]+)?$

The weight of one unit, in kilograms. A numeric string is accepted too.

property name*anyadditional property
cost_in_centinteger or string or null^-?[0-9]+$deprecated

Use cost_in_cents, which wins when both are sent. A string of digits is accepted too.

curl -i -X PATCH \
  'https://hive-merchant-api.redocly.app/_mock/merchant-api-v1/mapi_v1_oas31/skus/{id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Hive T-Shirt (Black - L)",
    "weight_in_kg": 0.35
  }'

Responses

The updated SKU

Bodyapplication/json
barcodestring or nullrequired

The SKU's barcode.

batch_tracking_enabledboolean or nullrequired

Whether inventory of this SKU is tracked per batch.

cost_in_centsinteger or nullrequired

The cost (not the price) of one unit, in cents, in the sales channel's currency.

country_code_of_originstring or nullrequired

The 2-letter ISO 3166-1 code of the country of origin.

created_atstring, (date-time)read-onlyrequired

When the SKU was created.

dangerous_goodbooleanread-onlyrequired

Whether the SKU is classified as a dangerous good.

fulfilled_bystringread-onlyrequired

Who fulfills this SKU.

Enum:"hive""other""new"
h_codesArray of stringsread-onlyrequired

The hazard statement codes (H codes) of the SKU's hazardous good classifications.

hazardous_goodbooleanread-onlyrequired

Whether the SKU is classified as a hazardous good.

hs_codestring or nullrequired
idinteger, (int64)read-onlyrequired

Hive's unique identifier for the SKU.

image_urlstring or nullrequired

A publicly accessible URL of an image of the SKU.

inventoryobject(SkuInventory)read-onlyrequired

The current inventory across all warehouses.

inventory_batchesArray of objects(SkuInventoryBatch)read-onlyrequired

The current stock per inventory batch.

inventory_per_warehouseArray of objects(SkuInventoryPerWarehouse)read-onlyrequired

The current inventory per warehouse.

merchant_sku_idstring or nullrequired

The merchant's identifier for the SKU, unique within the sales channel. Always set for SKUs created through the API.

namestring or nullrequired

The SKU's name. Always set for SKUs created through the API.

statusstringread-onlyrequired

The SKU's status. DELETE /skus/{id} sets it to deleted; creating or updating the SKU sets it back to active.

Enum:"active""archived""draft""deleted"
un_numbersArray of stringsread-onlyrequired

The UN numbers of the SKU's dangerous good classifications.

weight_in_kgnumberrequired

The weight of one unit, in kilograms; 0 when unknown.

cost_in_centinteger or nullrequireddeprecated

The same value as cost_in_cents, which replaces it.

Response
{ "id": 9, "name": "Morph II", "country_code_of_origin": "DE", "hs_code": "950300", "status": "active", "created_at": "2022-08-10T17:53:04.822+02:00", "cost_in_cent": 1200, "cost_in_cents": 1200, "weight_in_kg": 0.3, "merchant_sku_id": "2218061549136", "image_url": "https://example.com/image.png", "barcode": "2218061549136", "batch_tracking_enabled": true, "fulfilled_by": "hive", "dangerous_good": true, "un_numbers": [ "UN3481" ], "hazardous_good": false, "h_codes": [], "inventory": { "stocked": 6760, "reserved": 0, "total": 6760 }, "inventory_per_warehouse": [ { … }, { … } ], "inventory_batches": [ { … } ] }