Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Module: Mage_Sales

Resource: sales_order_shipment

Aliases:

  • order_shipment
Method:
  • sales_order_shipment.create (SOAP V1)
  • salesOrderShipmentCreate (SOAP V2)

Allows you to create a new shipment for an order.

Aliases:

  • order_shipment.create

Arguments:

TypeNameDescription
stringsessionIdSession ID
stringorderIncrementIdOrder increment ID
arrayitemsQtyArray of orderItemIdQty (optional)
stringcommentShipment comment (optional)
intemailSend email flag (optional)
intincludeCommentInclude comment in email flag (optional)

Returns:

TypeNameDescription
stringshipmentIncrementIdShipment increment ID

The orderItemIdQty content is as follows:

TypeNameDescription
intorder_item_idOrder item ID
doubleqtyQuantity 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.

Examples

Request Example SOAP V1
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');

$session = $proxy->login('apiUser', 'apiKey');

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

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

var_dump ($result);
Request Example SOAP V2
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

$itemsQty = array(
    array(
        'order_item_id' => 3,
        'qty' => 3
    ),
    array(
        'order_item_id' => 4,
        'qty' => 5
    ));

$result = $proxy->salesOrderShipmentCreate($sessionId, '200000006', $itemsQty, 'shipment comment');
var_dump($result);
Request Example SOAP V2 (WS-I Compliance Mode)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); 

$sessionId = $proxy->login((object)array('username' => 'apiUser', 'apiKey' => 'apiKey')); 

$itemsQty = array(
    array(
        'order_item_id' => 3,
        'qty' => 3
    ),
    array(
        'order_item_id' => 4,
        'qty' => 5
    ));
 
$result = $proxy->salesOrderShipmentCreate((object)array(
    'sessionId' => $sessionId->result,
    'orderIncrementId' => '200000006',
    'itemsQty' => $itemsQty,
    'comment' => 'shipment comment',
    'email' => null, 'includeComment' => null));   
    
var_dump($result->result);

Table of contents