m openmage

OpenMage LTS Developer Documentation

Sales Order

Edit this page on GitHub

Module: Mage_Sales

The Mage_Sales module allows you to manage sales orders, invoices, shipments, and credit memos.

Order

Allows you to manage orders.

Resource Name: sales_order

Aliases:

Methods:

Faults

Fault Code Fault Message
100 Requested order not exists.
101 Invalid filters given. Details in error message.
102 Invalid data given. Details in error message.
103 Order status not changed. Details in error message.

Examples

Example 1. Work with orders
$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');

// Getting list of orders created by John Doe
var_dump($proxy->call($sessionId, 'sales_order.list', array(array('customer_firstname'=>array('eq'=>'John'), 'customer_lastname'=>array('eq'=>'Doe')))));


// Get order info 100000003
var_dump($proxy->call($sessionId, 'sales_order.info', '100000003'));


// Hold order 100000003
$proxy->call($sessionId, 'sales_order.hold', '100000003');

// Unhold order 100000003
$proxy->call($sessionId, 'sales_order.unhold', '100000003');

// Hold order and add comment 100000003
$proxy->call($sessionId, 'sales_order.addComment', array('100000003', 'holded',  'You order is holded',  true));

// Unhold order and add comment 100000003
$proxy->call($sessionId, 'sales_order.addComment', array('100000003', 'pending', 'You order is pending', true));

// Get order info 100000003
var_dump($proxy->call($sessionId, 'sales_order.info', '100000003'));