Getting Started with Magento Web APIs
What are the Magento web APIs?
The Magento web API framework provides integrators and developers the means to use web services that communicate with the Magento system. Key features include:
- Three types of authentication:
All accounts and integrations are assigned resources that they have access to. The API framework checks that any call has the authorization to perform the request.
Any Magento or third-party service can be configured as a web API with a few lines of xml. To configure a web API, you define XML elements and attributes in a
webapi.xmlconfiguration file. If a service is not defined in a configuration file, it will not be exposed at all.
The framework is based on the CRUD (create, read, update, delete) & search model. The system does not currently support webhooks.
The framework supports field filtering of web API responses to conserve mobile bandwidth.
- Integration style web APIs enable a single web API call to run multiple services at once for a more efficient integration. An example of this behavior can be seen in the Catalog where one web API call can create a product. If your payload includes the
media_gallery_entriesobjects, then the framework will also create the product’s inventory & media in that one API call.
What can I do with the Magento web APIs?
The APIs can be used to perform a wide array of tasks. For example:
Create a shopping app. This can be a traditional app that a user downloads on a mobile device. You could also create an app that an employee uses on a showroom floor to help customers make purchases.
Integrate with CRM (Customer Relationship Management) or ERP (Enterprise Resource Planning) backend systems, such as Salesforce or Xero.
Integrate with a CMS (Content Management System). At present, content tagging is not supported.
How do I get started?
You must register a web service on Magento Admin. Use the following general steps to set up Magento to enable web services.
- If you are using token-based authentication, create a web services user on Magento Admin by selecting System > Permission > All Users > Add New User. (If you are using session-based or OAuth authentication, you do not need to create the new user in the Admin.)
- Create a new integration on Magento Admin. To create an integration, click System > Extensions > Integration > Add New Integration**. Be sure to restrict which resources the integration can access.
- Use a REST or SOAP client to configure authentication.
See the User Guide for more information.