tags:

views:

25

answers:

1

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?

I'm very new to Magento and I'm trying to figure out how to understand working with some of the lower level operations.

+1  A: 

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:

sales_order_shipment.create

Create new shipment for order

Return: string - shipment increment id

Arguments:

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)

I can also provide some source code in C# if you will find it helpful...

silvo
Cool. Thank you very much. I'm sure I'll have more questions, but it's great to have some specific examples to help me get off the ground.As an aside, after reading the source code, it appears that the Magento wiki is missing some key methods from the api. Do you know if the wiki is very out of date?
Joshua
I have noticed that the magento wiki has been vandalised recently and nobody really bothered to restore the previous versions. Which language will you be using to consume the magento's web services?
silvo