Skip to main content

API - Dealing with split orders

Tom Higgs avatar
Written by Tom Higgs
Updated over a month ago

This guide is intended for customers with custom-built third-party API integrations. It provides an additional method for handling split orders, rather than the standard approach. It's possible that an order you inject in via the API might get split into multiple orders. This can happen if there isn't enough stock or the order is allocated to be despatched from multiple warehouses for example. If this happens on order creation you get multiple order IDs back in the create order response call.

Example

[ { "OrderId": 1, "DropShipOrderId": 0, "OrderNumber": "OrderNumber1", "Success": true, "OrderStatusId": 1, "OrderStatus": "NEW", "Message": "string" }, { "OrderId": 2, "DropShipOrderId": 0, "OrderNumber": "OrderNumber1", "Success": true, "OrderStatusId": 5, "OrderStatus": "ONBACKORDER", "Message": "string" } ]

You then know you need to track or listen out for orders relating to those OrderIDs supplied.


What if an order is split at a later point?

It's also possible for the order to be split into multiple parts at a point in the future so you don't know the order is split. You can deal with this in two ways.


Register a split Webhook so you get callbacks when a split occurs

If an order is split at a point after creation, you can register a Webhook to split out about that split. To do this you need to populate ExtraCode5 when adding a connect action.

Example

{ "ExtraCode5": "https://api.yoursystem.com/callback/OrderSplit" }

The URL is then called once an order is split into multiple parts.
​
You receive JSON containing the original order and the new split order with all the details you need to see how the order has been split.

[{ "Order": {}, // Full Details of the Order "SplitOrder": {}, // Full Details of the Split Order "OrderId": 78025, "SplitOrderId": 78026, "ID": 1, "LastUpdated": "2020-10-05T23:36:31.5231781", "LastUpdatedByUser": "groveslu" }]

Use the API to look for splits manually

If you notice all the items on the order aren't despatched or are now in multiple parts, you can call the Order/{id}/Splits API which returns any splits that have happened to that order.
​
You receive JSON containing the original order and the new split order with all the details you need to see how the order is split.

[{ "Order": {}, // Full Details of the Order "SplitOrder": {}, // Full Details of the Split Order "OrderId": 78025, "SplitOrderId": 78026, "ID": 1, "LastUpdated": "2020-10-05T23:36:31.5231781", "LastUpdatedByUser": "groveslu" }]

Did this answer your question?