[Magento 1] Magento 1.x #magento #php
<?php
$client = new SoapClient('https://api.example.com/api/v2_soap?wsdl=1');
$session = $client->login('username', 'password');
$orders = ['100193253', '100193224', '100193291', '100193320'];
$increment_id = '100193224';
/*$params = [
'filter' => [
['key' => 'increment_id', 'value' => '100193253'],
],
];*/
$params = [
'complex_filter' => [
[
'key' => 'increment_id',
'value' => [
'key' => 'in',
'value' => implode(',', $orders),
],
],
/*[
'key' => 'protect_code',
'value' => [
'key' => 'eq',
'value' => 'ebb2a0',
],
],*/
],
];
// $result = $client->salesOrderList($session, $params);
foreach ($orders as $increment_id) {
$result = $client->salesOrderInfo($session, $increment_id);
var_dump($result->increment_id);
var_dump($result->status_history);
}