Order API

Last modified by josch1985 on Wed, September 14, 2011 08:58
Source|Old Revisions  

This is an old revision of the document!


HUHU Allows to import/export orders.

Module: Mage_Sales

Resource: sales_order

Aliases:

  • order

Methods

sales_order.list

Retrieve list of orders by filters

Return: array

Arguments:

  • array filters - filters for order list (optional)

Aliases:

  • order.list

sales_order.info

Retrieve order information

Return: array

Arguments:

  • string orderIncrementId - order increment id

Aliases:

  • order.info

sales_order.addComment

Add comment to order

Return: boolean

Arguments:

  • string orderIncrementId - order increment id
  • string status - order status
  • string comment - order comment (optional)
  • boolean notify - notification flag (optional)

Aliases:

  • order.addComment

sales_order.hold

Hold order

Return: boolean

Arguments:

  • string orderIncrementId - order increment id

Aliases:

  • order.hold

sales_order.unhold

Unhold order

Return: boolean

Arguments:

  • mixed orderIncrementId - order increment id

Aliases:

  • order.unhold

sales_order.cancel

Cancel order

Return: boolean

Arguments:

  • mixed orderIncrementId - order increment id

Aliases:

  • order.cancel

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

  1. $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
  2. $sessionId = $proxy->login('apiUser', 'apiKey');
  3.  
  4. // Getting list of orders created by John Doe
  5. var_dump($proxy->call($sessionId, 'sales_order.list', array(array('customer_firstname'=>array('eq'=>'John'), 'customer_lastname'=>array('eq'=>'Doe')))));
  6.  
  7.  
  8. // Get order info 100000003
  9. var_dump($proxy->call($sessionId, 'sales_order.info', '100000003'));
  10.  
  11.  
  12. // Hold order 100000003
  13. $proxy->call($sessionId, 'sales_order.hold', '100000003');
  14.  
  15. // Unhold order 100000003
  16. $proxy->call($sessionId, 'sales_order.unhold', '100000003');
  17.  
  18. // Hold order and add comment 100000003
  19. $proxy->call($sessionId, 'sales_order.addComment', array('100000003', 'holded''You order is holded'true));
  20.  
  21. // Unhold order and add comment 100000003
  22. $proxy->call($sessionId, 'sales_order.addComment', array('100000003', 'pending', 'You order is pending', true));
  23.  
  24. // Get order info 100000003
  25. var_dump($proxy->call($sessionId, 'sales_order.info', '100000003'));



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs