Magento – How to create shipment using API (SOAP V1) with specific items in it

apimagento-1.9sales-ordershipmentsoap

I'm looking to find how should array of items look like.
I have found an example here:

$orderIncrementId = '200000006';
$itemsQty = array('3' => '3', '4' => '5');

$result = $proxy->call(
    $session,
    'order_shipment.create',
    array(
        $orderIncrementId,
        $itemsQty
    )
);

But that doesn't work for me. Plus there's misleading action name. It should be "sales_order_shipment.create" instead "order_shipment.create". So far I have found that passing empty array as second parameter works, but then a shipment is created for all ordered items. Not what I need.

Best Answer

Make sure you read that link that you sent very well. It answers all of your questions in there.

1) order_shipment.create is an alias for sales_order_shipment.create

2) It says that the second parameter in the array ($itemsQty) is optional and if you leave that parameter out or blank it will create a shipment for all your items.

3) How to get it to work so you can specify which products and quantities are in the shipment you create is in that $itemsQty array. The first number you enter in there is the Magento ID of your product and the second number is the quantity that you want for the shipment. Make sure you verify that your ID and quantity are correct.
NOTE: One of the main things that you need to verify is that you have the Order Item ID and not the Product ID. They are not the same thing. You can find the Order Item ID in sales_order.info in the salesOrderItemEntity content. more information here

If you are getting errors please specify what errors those are.

Related Topic