Skip to content

Create a SKU

Request

Creates a SKU, or updates the sales channel's SKU with the same merchant_sku_id if there is one; either way the SKU is active afterwards and the response is 201 Created.

When an existing SKU is updated, the properties you leave out are cleared, except batch_tracking_enabled, which keeps its value.

Security
BearerAuth
Bodyapplication/jsonrequired
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. When left out, a new SKU is not batch-tracked and an existing SKU keeps its setting.

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.

created_atany

Accepted and ignored; Hive sets the creation time.

hs_codestring or null
idany

Accepted and ignored; Hive assigns the ID.

image_urlstring or null

A publicly accessible URL of an image of the SKU.

merchant_sku_idstringrequired

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

namestringrequired

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.

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 POST \
  https://developers.hive.app/_mock/merchant-api-v1/mapi_v1_oas31/skus \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "merchant_sku_id": "HIVE_TSH_BLK_M",
    "name": "Hive T-Shirt (Black - M)",
    "barcode": "2218061549136",
    "cost_in_cents": 800,
    "weight_in_kg": 0.3,
    "batch_tracking_enabled": false
  }'

Responses

The created or 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": [ { … } ] }