Skip to content

Split the out-of-stock items off an order

Request

Splits an order's shipment into two, moving the items that split_by selects to a separate shipment. The body is required and names the kind of split; out_of_stock is the only kind today, and more may be added later.

With split_by: out_of_stock, the out-of-stock items are split off the order, so the items in stock can ship first. This is "Split order" in the merchant portal: the out-of-stock items of the order's shipment that is still waiting_for_picking move to a separate shipment that ships once they are back in stock, and the items in stock stay where they are and are fulfilled as usual. The separate shipment is a new one, or the order's existing out-of-stock shipment from an earlier split. Add-ons from packaging rules and items kitted at packing do not move.

A shipment is split only when it keeps at least one item in stock. When out-of-stock items sit in more than one shipment or warehouse of the order, the request is refused; split such orders in the merchant portal. If the out-of-stock items are back in stock while the original shipment is still waiting for picking, Hive may move them back into it.

A request sent as application/json without a body, with a body that is not valid JSON, without split_by, or with a value that is not listed is rejected with 400 and nothing is split; a request whose Content-Type is missing or is not application/json is rejected with 415. On success the response lists every shipment of the order.

Security
BearerAuth
Path
idinteger, (int64)required

Order ID

Bodyapplication/jsonrequired
split_bystring(OrderSplitBy)required

The kind of split, which decides the items that move to a separate shipment

Value:"out_of_stock"
curl -i -X PUT \
  'https://developers.hive.app/_mock/merchant-api-v2/mapi_v2_oas31/orders/{id}/split' \
  -H 'Authorization: Bearer <YOUR_token_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "split_by": "out_of_stock"
  }'

Responses

The items were moved to a separate shipment

Bodyapplication/json
dataArray of objects(Shipment)required

Every shipment of the order after the split, oldest first

Response
{ "data": [ { … } ] }