Created
June 22, 2016 14:12
-
-
Save Andrew-Myers-Webtise/1c9d1c1ba1f34e92fd10ed067a596446 to your computer and use it in GitHub Desktop.
Magento SOAP V2 API test script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* soaptest.php | |
* Use in terminal. E.g. php soaptest.php > myfilename.txt | |
*/ | |
// Some setup | |
$inc_id = "100012345"; | |
$http = "https://www.example.com"; | |
$login_user = "magento_user_id"; | |
$api_key = "your_api_key_here"; | |
$proxy = new SoapClient($http . '/index.php/api/v2_soap?wsdl=1'); | |
$sessionId = $proxy->login($login_user, $api_key); | |
// salesOrderList test example. Provides a smaller output of an order. Comment out to skip. Change filter if need be. | |
echo "Sales Order List: state:processing | increment_id:", $inc_id; | |
echo "\n"; | |
echo "----------------------------------------------------------------------------------------"; | |
echo "\n"; | |
$filter = array('filter' => array(array('key' => 'state', 'value' => 'processing'), array('key' => 'increment_id', 'value' => $inc_id))); | |
$result = $proxy->salesOrderList($sessionId, $filter); | |
var_dump ($result); | |
// salesOrderInfo test example. Has the most info on an order. Comment out to skip | |
echo "\n"; | |
echo "Sales Order Info: increment_id:", $inc_id; | |
echo "\n"; | |
echo "----------------------------------------------------------------------------------------"; | |
echo "\n"; | |
$result = $proxy->salesOrderInfo($sessionId, $inc_id); | |
var_dump( $result ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment