WP Generate Rest API keys
Setting Up the Development Environment
Last updated
Setting Up the Development Environment
Last updated
Before we start, make sure you have installed WordPress and WooCommerce and your website is up and running. If you have not installed WordPress yet, start from here:
Free
App Builder License Key
If you’re using non-pretty permalinks in WooCommerce, the REST API will not work. Configure pretty permalinks in Settings > Permalinks so that the custom endpoints are supported.
Pre-generated keys can be used to authenticate use of the REST API endpoints. New keys can be generated either through the WordPress admin interface or they can be auto-generated through an endpoint.
Generating API keys in the WordPress admin interface
Note: We not require WRITE permission READ is enough.
To create or manage keys for a specific WordPress user, go to WooCommerce > Settings > Advanced => REST 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. Use of the REST API with the generated keys will confirm to that user’s WordPress roles and capabilities.
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.
Unzip file product.zip
located inside the app folder.
Open file api.js
in product/lib/constants/app.dart
and change it with your domain name, customer key and customer secret you generated from Woocommerce -> Settings -> Advanced -> REST API
Open file in below path:
2. And replace your Rest API keys and domain with below info in app.dart file: