Magento XMLRPC APIΒΆ

From Magento API setup instructions - SOAP/XML

Role

_images/magento-role-access.png

User

_images/magento-user.png

User Role

_images/magento-user-role.png

Connect to the XMLRPC API and retrieve a sales order:

import json
import urllib.parse
import xmlrpc.client

api_url = "http://my-project.co.uk/test/"
url = urllib.parse.urljoin(api_url, "api/xmlrpc")
client = xmlrpc.client.ServerProxy(url)
session = client.login('pkimber', 'my-new-api-key-see-above')

# retrieve an order
params = [{"increment_id": "100015171"}]
response = client.call(session, "sales_order.list", params)
print(json.dumps(response, indent=4))