0

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.

8
  • do you want to get order list via script ? ie PHP code using API.
    – Pawan
    Commented 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 script
    – sebas
    Commented 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
    Commented May 27, 2020 at 15:09
  • @Pawan any sample code for google app script?
    – sebas
    Commented 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
    Commented May 27, 2020 at 15:49

1 Answer 1

0

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.