Here is the API Documentation for a Sales Order:
http://www.magentocommerce.com/api/soap/sales/salesOrder/sales_order.info.html
Here is the API documentation for a Shipment:
http://www.magentocommerce.com/api/soap/sales/salesOrderShipment/salesOrderShipment.html
I cannot for the life of me figure out how to establish a relationship between them. The order/info endpoint doesn't seem to return a shipment_id of any kind and the order/shipment endpoint doesn't seem to be filterable by order_id.
This is possible by using a filter on the order's order_id
value.
Note that order_id
is different to the order's increment_id
which is the usual customer facing reference number. Therefore an extra step is required to convert the order's reference into the order_id
.
I can't give you working PHP code, I'm working in Java, but I can describe the method:
- Get the order data for your order number (
increment_id
) using sales_order.info
API call
- get the
order_id
from the order data
- Use the
order_id
as a filter in sales_order_shipment.list
- This will give you a list of shipments each with an
increment_id
. This id is the shipment's reference.
- Use the shipment's
increment_id
in sales_order_shipment.info
to get more details.
Here is the PHP code to complete @Kevin Sadler answer:
/** @var array $filters */
$filters = array(
array('order_id' => array('eq' => $orderId)) // Entity ID, not Increment ID
);
/** @var array $orderShipments */
$orderShipments = $client->call($session, 'sales_order_shipment.list', $filters);