I want to mark orders as shipped after we import the shipping feed from our warehouse. Is there an API for this? Or do I have to use the actual classes?
Yes, of course! You can use the shipment API, to which you can connect using both SOAP and XML-RPC. The call that will be of most interest to you is shipment.create.
Here’s the sample code from magento’s site [php]:
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl'); $sessionId = $proxy->login('apiUser', 'apiKey'); $notShipedOrderId = '100000003'; // Create new shipment $newShipmentId = $proxy->call($sessionId, 'sales_order_shipment.create', array($notShipedOrderId, array(), 'Shipment Created', true, true));
And here are the comments:
Create new shipment for order
Return: string – shipment increment id
string orderIncrementId – order increment id
array itemsQty – items qty to ship as associative array (order_item_id ⇒ qty)
string comment – shipment comment (optional)
boolean email – send e-mail flag (optional)
boolean includeComment – include comment in e-mail flag (optional)