How to set up REST API on WooCommerce

intermediate 8 min read Updated 2026-03-18
Quick Answer

Setting up WooCommerce REST API involves enabling the API in WooCommerce settings, generating API keys with appropriate permissions, and configuring authentication. The process requires admin access and takes about 10-15 minutes to complete.

Prerequisites

  • WordPress admin access
  • WooCommerce plugin installed and activated
  • Basic understanding of API keys and webhooks
  • SSL certificate installed on your website

Step-by-Step Instructions

1

Access WooCommerce Settings

Log into your WordPress admin dashboard and navigate to WooCommerce > Settings. Click on the Advanced tab at the top of the settings page to access API configuration options.
Ensure you're logged in as an administrator to see all WooCommerce settings options.
2

Enable REST API

In the Advanced settings, click on the REST API sub-tab. Check the box next to Enable the REST API to activate API functionality. Click Save changes to apply the setting.
The REST API is enabled by default in newer WooCommerce versions, but always verify this setting.
3

Create API Keys

Still in the REST API section, click the Add Key button. Fill in the required fields:
  • Description: Enter a meaningful name for your API key
  • User: Select the WordPress user account to associate with this key
  • Permissions: Choose Read, Write, or Read/Write based on your needs
Click Generate API Key when finished.
Use descriptive names for API keys to easily identify their purpose later.
4

Copy and Store API Credentials

After generating the key, WooCommerce will display your Consumer Key and Consumer Secret. Copy both values immediately and store them securely - the secret will only be shown once. Use these credentials for API authentication in your applications.
Store API credentials in a secure password manager or environment variables - never hardcode them in your application.
5

Test API Connection

Test your API setup by making a simple GET request to https://yoursite.com/wp-json/wc/v3/products using your API credentials. You can use tools like Postman or curl:
curl -u consumer_key:consumer_secret https://yoursite.com/wp-json/wc/v3/products
Start with simple GET requests to verify connectivity before attempting POST or PUT operations.
6

Configure Webhooks (Optional)

To receive real-time notifications about store events, go to WooCommerce > Settings > Advanced > Webhooks. Click Add Webhook, select the event topic (like order creation), enter your endpoint URL, and set the delivery method to JSON.
Test webhook endpoints with a service like webhook.site before using your production URL.
7

Set Proper Permissions

Review and adjust API key permissions based on your application needs. Go back to REST API settings and click Edit next to your key. Set permissions to Read for data retrieval only, Write for updates only, or Read/Write for full access.
Follow the principle of least privilege - only grant the minimum permissions required for your application.

Common Issues & Troubleshooting

401 Unauthorized error when making API calls

Verify your consumer key and secret are correct. Ensure your site has SSL enabled if using HTTPS. Check that the API key hasn't been revoked and has proper permissions.

REST API tab not visible in WooCommerce settings

Update WooCommerce to the latest version. Ensure you're logged in as an administrator. Check if any security plugins are hiding the API settings and whitelist WooCommerce endpoints.

API requests returning empty results

Verify the API endpoint URL is correct. Check that your API key has Read permissions. Ensure pretty permalinks are enabled in WordPress Settings > Permalinks.

Webhook delivery failures

Verify your webhook endpoint URL is accessible and returns a 200 status code. Check your server logs for incoming webhook requests. Ensure your endpoint can handle JSON payloads and responds quickly.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official WooCommerce website before purchasing.