Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

API -> Only get orders from date x
 
Bastian_B
Jr. Member
 
Total Posts:  4
Joined:  2009-04-16
 

Hello,

Is it possible to read out all orders from date x with the API? Because i dont want to call ALL orders ...

For Example:

var_dump($proxy->call($sessionId'sales_order.list'));

there i want to add: WHERE created_at > ‘2009-04-01 00:00:00’

How is that possible?

best regards and thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Damian Culotta
Enthusiast
 
Total Posts:  878
Joined:  2008-12-10
Argentina
 

Did you read the method documentation? (http://www.magentocommerce.com/wiki/doc/webservices-api/api/sales_order#sales_order.list)
You can use filters.
I don’t have an example of orders right now, but, for example, take a look at this customer example:

//Url de la conexión
$client = new SoapClient("http://www.dominio.com.ar/index.php/api/?wsdl");
 
//Login
$session $client->login("usuario""contraseña");
 
//Filtro de búsqeuda
$filter = array(
    
"lastname" => "Culotta"
);
 
//Listado de clientes filtrado
$customers $client->call($session"customer.list", array($filter));
 
//Impresión
print_r($customers);
 
//Logout
$client->endSession($session);

I hope that you can understand the idea.

 
Magento Community Magento Community
Magento Community
Magento Community
 
neuro
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-09-29
France
 

/*
CONNECTION Soap magento
        */


$proxy = new SoapClient('http://123/index.php/api/?wsdl');

$sessionId $proxy->login('123''123');


$invoice $proxy->call($sessionId'order_invoice.list''10');

$query='TRUNCATE TABLE `csv`';  
$execute=mysql_query($query);



$tab1 = array();


    foreach (
$invoice as $cle=>$valeur
        
{


foreach ($valeur as $cle=>$valeur
        
{

if ($cle == 'order_increment_id'){
 
$tab1[] 
$valeur;

}}} 

foreach ($tab1 as $cle=>$valeur
        
{
$num_commande 
$valeur;

$invoice3 $proxy->call($sessionId'sales_order.info'$num_commande);

 foreach (
$invoice3 as $cle=>$valeur
        
{

And you can continue for find the date of the order or invoice & short them..

 
Magento Community Magento Community
Magento Community
Magento Community
 
neuro
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-09-29
France
 
Damián Culotta - 17 April 2009 06:02 AM

Did you read the method documentation? (http://www.magentocommerce.com/wiki/doc/webservices-api/api/sales_order#sales_order.list)
You can use filters.
I don’t have an example of orders right now, but, for example, take a look at this customer example:

//Url de la conexión
$client = new SoapClient("http://www.dominio.com.ar/index.php/api/?wsdl");
 
//Login
$session $client->login("usuario""contraseña");
 
//Filtro de búsqeuda
$filter = array(
    
"lastname" => "Culotta"
);
 
//Listado de clientes filtrado
$customers $client->call($session"customer.list", array($filter));
 
//Impresión
print_r($customers);
 
//Logout
$client->endSession($session);

I hope that you can understand the idea.

We can use filter, try to $var_dump or krumo the result of all the sales.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Damian Culotta
Enthusiast
 
Total Posts:  878
Joined:  2008-12-10
Argentina
 

Into Magento, is it possible to call

Zend_Debug::dump($your_variable);
 
Magento Community Magento Community
Magento Community
Magento Community
 
neuro
Sr. Member
 
Avatar
Total Posts:  104
Joined:  2008-09-29
France
 
Damián Culotta - 17 April 2009 06:39 AM

Into Magento, is it possible to call

Zend_Debug::dump($your_variable);

Or krumo (same result but in nice javascript array): http://krumo.kaloyan.info/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top