Requirements to create REST API for mobile apps in woocommerce:
- To use the latest version of the REST API you must be using on the woocommerce.
- WooCommerce 2.6+.
- WordPress 4.4+.
- Pretty permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work.
- You may access the API over either HTTP or HTTPS, but HTTPS is recommended where possible.
- The default response format is JSON. Requests with a message-body use plain JSON to set or update resource attributes. Successful requests will return a 200 OK HTTP status.
- WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any WP REST API authentication plugin or method.
Steps to Generating API keys in the WordPress admin :
- To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > API > Keys/Apps.
- Click the “Add Key” button. In the next screen, add a description and select the WordPress user you would like to generate the key for.
Choose the level of access for this REST API key, which can be Read access, Write access or Read/Write access.
- Then click the “Generate API Key” button and WooCommerce will generate REST API keys for the selected user.
- Now that keys have been generated, you should see two new keys, a QRCode, and a revoke API key button. These two keys are your Consumer Key and Consumer Secret.
Author: Venkata Saikumar Bitta