--- layout: m1x_soap title: Shipment Create ---
Aliases:
Allows you to create a new shipment for an order.
Aliases:
Arguments:
| Type | Name | Description |
|---|---|---|
| string | sessionId | Session ID |
| string | orderIncrementId |
Order increment ID |
| array | itemsQty |
Array of orderItemIdQty (optional) |
| string | comment |
Shipment comment (optional) |
| int | email |
Send email flag (optional) |
| int | includeComment |
Include comment in email flag (optional) |
Returns:
| Type | Name | Description |
|---|---|---|
| string | shipmentIncrementId |
Shipment increment ID |
The orderItemIdQty content is as follows:
| Type | Name | Description |
|---|---|---|
| int | order_item_id |
Order item ID |
| double | qty |
Quantity of items to be shipped |
Notes: The array of orderItemQty is used for partial shipment. To create shipment for all order items, you do not need to specify these attributes.
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$session = $proxy->login('apiUser', 'apiKey');
var_dump ($session);
$orderIncrementId = '200000006';
$itemsQty = array('3' => '3', '4' => '5');
$result = $proxy->call(
$session,
'order_shipment.create',
array(
$orderIncrementId,
$itemsQty
)
);
var_dump ($result);
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary
$result = $proxy->salesOrderShipmentCreate($sessionId, '200000006', array('8', '1'), 'shipment comment');
var_dump($result);
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey'));
$result = $proxy->salesOrderShipmentCreate((object)array('sessionId' => $sessionId->result, 'orderIncrementId' => '200000006', 'itemsQty' => array('order_item_id' => '8', 'qty' => '1'), 'comment' => 'shipment comment', 'email' => null, 'includeComment' => null));
var_dump($result->result);