Magento version: 1.9.4.1
Trying to come up with a SOAP api GET request v1 or v2 to bring all the orders list. Have already read the documentation: https://devdocs.magento.com/guides/m1x/api/soap/sales/salesOrder/sales_order.list.html
Have already created an apiuser and apikey from the System backend SOAP/XML-RPC with admin permissions.
Tried this with no result. https://www.magentohost.com/api/soap/?wsdl?apiuser=xxx&apiKey=xxxxxxxxxxxxx
Im trying to come up with a working URL so i can then import the order list into a Google Sheet. Can't use Zapier or Integromat for this.
-
do you want to get order list via script ? ie PHP code using API.Pawan– Pawan2020年05月27日 07:30:43 +00:00Commented May 27, 2020 at 7:30
-
Only vía directa url so i can importdata on Google Sheets or use API connector addon or using Google app scriptsebas– sebas2020年05月27日 13:52:07 +00:00Commented May 27, 2020 at 13:52
-
I think with direct URL it is not possible(because to access API, you need first to create token and add token in request), you can put logic in script and manipulate (import) result wherever you want !Pawan– Pawan2020年05月27日 15:09:33 +00:00Commented May 27, 2020 at 15:09
-
@Pawan any sample code for google app script?sebas– sebas2020年05月27日 15:37:16 +00:00Commented May 27, 2020 at 15:37
-
i do not have any idea of google app script :( , can share PHP code and you need to convert it .Pawan– Pawan2020年05月27日 15:49:37 +00:00Commented May 27, 2020 at 15:49
1 Answer 1
You can get all order using below code:
<?php
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
$url = 'http://127.0.0.1/1924sample/index.php/api/v2_soap/?wsdl';
$client = new SoapClient($url);
// get token
$session = $client->login('soapadmin', 'admin@123');
$result = $client->salesOrderList($session);
var_dump ($result);
You need to change, username, password and HostURL
Hope above will help!