Nilog Developers
  • Introduction
  • Integrations
    • WooCommerce
      • Adding Products
      • Variable Product
      • Product Attributes
      • Managing Orders
      • Coupon Management
      • Currency Switcher
      • WooCommerce Reports
      • WooCommerce Analytics
      • Tax Settings
      • Multi Vendors
      • Email Settings
      • WooCheckout Webview
      • Web Store Layout
    • App Builder
      • App Builder Widgets
    • User Authentication
      • Login with Google
      • Login with Apple
      • Login with Facebook
      • Login with Firebase OTP
    • Cloud Messaging
      • Firebase Cloud Messaging
      • OneSignal
    • Google Maps API Key
  • Developers
    • React Native Development Setup
    • WP Generate Rest API keys
  • Reference
    • API spec
      • WordPress
    • Language Support
    • Changelog
      • App Builder
      • Nilog Monitor
    • Upgrade Your App
    • License Key
    • Enable WP Debug
    • Troubleshooting
      • JWT Authentication for WP REST API plugin installed
      • Hide Admin Account From Vendor List In Dokan Backend
Powered by GitBook
On this page
  • Website Config
  • Step 1: Configuration of your WordPress website
  • Step 2: Configuring WooCommerce
  • App Config
  • Configure API
  • API Endpoint and Customer Secret & Key
  1. Developers

WP Generate Rest API keys

Setting Up the Development Environment

PreviousReact Native Development SetupNextAPI spec

Last updated 1 year ago

Website Config

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:

For WooCommerce Required Plugins

  • Free

  • App Builder License Key

Step 1: Configuration of your WordPress website

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.

Step 2: Configuring WooCommerce

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.

App Config

Configure API

Unzip file product.zip located inside the app folder.

API Endpoint and Customer Secret & Key

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

  1. Open file in below path:

product/lib/constants/app.dart

2. And replace your Rest API keys and domain with below info in app.dart file:

const String baseUrl = 'https://yourdomain.com/';

const String consumerKey = 'ck_xxxxxxxxxxxxxxxxxx';

const String consumerSecret = 'cs_xxxxxxxxxxxxxxx';

https://wordpress.org
WooCommerce
Config WordPress permalinks settings.
Generating API keys.