You can create WooCommerce REST API keys under WooCommerce > Settings > Advanced > REST API, then select Read, Write, or Read/Write access levels. We recommend giving each integration only the access it needs, using a dedicated WordPress user where practical.

That small choice protects your store when you connect reporting tools, inventory systems, or custom scripts. Start by choosing the appropriate access level, then generate your key and test the connection.

Key Takeaways

  • Choose Read for integrations that only retrieve data. Write access allows changes and deletions.
  • A key's access setting works alongside its assigned WordPress user's capabilities.
  • Keep credentials private, use HTTPS, and revoke keys when an integration no longer needs access.

Choose What WooCommerce REST API Keys Can Access

A small brass key lies on a surface beside a server firewall in a server room.

Match Permissions to the Job

The key permission setting controls which request methods an integration can use.

PermissionAllowed actionsSuitable purpose
ReadRetrieve data with GETReporting and exports
WriteCreate, update, and delete dataSending changes into your store
Read/WriteRetrieve and change dataTwo-way synchronization

Start with the smallest permission set that supports the integration. A reporting connection doesn't need permission to delete products.

Write-only access also doesn't support a normal GET test. Use a Read key for the product-reading test below. Test write operations separately on staging.

Keep User Capabilities in the Picture

Every key belongs to a WordPress user. That user's capabilities still apply, as explained in WooCommerce's authentication guidance.

Assigning Read/Write doesn't give a Subscriber the management capabilities of an Administrator. We recommend a dedicated integration account with only the capabilities its endpoints require.

There's another limit worth understanding: standard key settings don't offer per-endpoint scopes. Read doesn't mean "products only." Access depends on both the key setting and the user's capabilities.

Read-only access prevents changes, but it can still expose sensitive information the assigned user is permitted to retrieve.

Create Your Key in WooCommerce Settings

Sign in with an account that can manage WooCommerce settings. Follow the official key-generation instructions:

  1. Open WooCommerce > Settings > Advanced > REST API.
  2. Select Add Key, or Create an API key if that's the option displayed.
  3. Enter a description that identifies the integration and its purpose.
  4. Choose the WordPress user, then select Read, Write, or Read/Write.
  5. Click Generate API Key and save the Consumer Key and Consumer Secret securely.

Use a description you'll recognize later. A service name and purpose make cleanup easier than a label such as "API key."

The Consumer Secret is displayed when the key is generated. Save it before leaving that screen. If it's lost, generate a replacement rather than trying to recover it.

Enter both values in the integration's designated credential fields or protected server configuration. Don't send them or store them in a public or shared location.

We also recommend separate keys for separate integrations. You can then revoke one connection without interrupting every service linked to your store.

Test the Connection in Postman

A successful test gives you a clear starting point. Confirm authentication works before adding filters, custom code, or synchronization rules.

Send a Read-Only Product Request

Create a request and select GET. Enter your store's HTTPS address followed by /wp-json/wc/v3/products, a wc/v3 endpoint for product data.

Under Authorization, choose Basic Auth. Enter the Consumer Key as the username and the Consumer Secret as the password.

Select Send. A successful request normally returns 200 OK and a JSON array containing product data. An empty array, [], can be valid when no products match.

Keep this first request simple. Extra query parameters make it harder to separate authentication problems from filtering mistakes.

WooCommerce also supports OAuth 1.0a as an alternative request-signing method. A client configured for OAuth signs requests with the consumer key and secret.

Understand the Basic Auth Header

Basic Auth combines the credentials as consumer_key:consumer_secret, Base64-encodes that string, and sends it in an Authorization: Basic header.

For server-side Node.js code, this generates the header using credentials stored in environment variables:

const credentials =
  `${process.env.WC_CONSUMER_KEY}:${process.env.WC_CONSUMER_SECRET}`;


const authorization =
  `Basic ${Buffer.from(credentials, "utf8").toString("base64")}`;

Pass authorization as the value of your HTTP client's Authorization header.

Base64 isn't encryption. HTTPS protects the connection. Never put these credentials in browser JavaScript, public repositories, screenshots, or shared collections.

Understand Endpoints Before Allowing Changes

Among WooCommerce APIs, the WC REST API extends the WordPress REST API. It exchanges JSON data for resources including products, orders, customers, coupons, and shipping zones.

Match the Method to the Action

For products, orders, customers, and coupons, the standard operations follow this pattern. The API endpoints below use HTTP methods to identify each action.

MethodRoute patternAction
GET/wp-json/wc/v3/productsList records
POST/wp-json/wc/v3/productsCreate a record
PUT/wp-json/wc/v3/products/{id}Update a record
DELETE/wp-json/wc/v3/products/{id}Delete a record

Replace products with orders, customers, or coupons for those resources. Request bodies and deletion behavior vary by endpoint.

WordPress routing depends on Pretty permalinks. If an API route returns a 404, see the later 404 troubleshooting section.

Separate Storefront Access and Webhooks

The WooCommerce Store API provides public, customer-facing product, cart, and checkout endpoints. It isn't a substitute for authenticated access to private store-management data.

Webhooks work in the opposite direction to a normal API request. When an event occurs, such as a new order, WooCommerce can POST order details to an external service.

If notifications stop arriving, our guide to troubleshooting WooCommerce webhook delivery covers that separate connection.

Fix Authentication and Route Errors

A toolkit with network diagnostic tools and an illuminated network switch on a server room desk.

Record the failing method, endpoint, status code, and response body before changing settings. The WooCommerce REST API reference describes response codes and authentication behavior.

Investigate 401 and 403 Responses

A 401 Unauthorized response means authentication or access requirements weren't satisfied. Incorrect credentials and insufficient access for the assigned user are documented causes.

Confirm you're using the Consumer Key and Consumer Secret from the same key pair. These fields take WooCommerce credentials, not your WordPress login password or an Application Password.

A 403 Forbidden response indicates that access was refused. Examine the response message and the security layer producing it.

Your request may be blocked before WooCommerce receives it. A security plugin, proxy, hosting firewall, or server rule can interfere. Also investigate whether the Authorization header reaches WordPress.

Don't grant administrator access simply to silence an error. Identify the missing permission or blocking rule first.

Investigate 404 Responses

404 Errors can also result from an incorrect endpoint, a missing record, or a server rewrite problem.

WooCommerce documents a requirement for pretty permalinks. Open Settings > Permalinks, select an option other than Plain, and click Save Changes.

Pretty permalinks are required, but enabling them won't fix every 404. If the whole /wp-json/ route fails, investigate WordPress routing. If only one record fails, examine its resource type and ID.

Diagnose SSL and Server Problems Safely

Keep HTTPS Consistent

Use your store's preferred HTTPS hostname throughout the integration. Redirects between HTTP and HTTPS, or between different hostnames, complicate diagnosis.

Qualys SSL Labs' SSL Server Test can inspect your site's public SSL certificate configuration. Keep certificate validation enabled in your API client, and verify the SSL certificate is valid for your chosen hostname. Disabling validation trades a visible connection problem for weaker protection.

A protected staging site can also introduce another authentication layer. Account for that layer rather than assuming WooCommerce rejected the key.

Isolate a 500 Error Without Disrupting Sales

A 500 Internal Server Error means the server failed while processing the request. For recurring 500 Internal Server Errors, match each failure's timestamp to the PHP error log.

Back up the site before making changes. On staging, establish a WooCommerce-only baseline to check for Plugin Conflicts. Retest, then restore extensions one at a time. If 500 Internal Server Errors persist after restoring extensions, check server resources and recent server configuration changes.

Health Check & Troubleshooting offers session-based testing through Tools > Site Health > Troubleshooting. However, an external API request won't automatically share your logged-in troubleshooting session. Use staging for dependable external-request testing.

Store, Rotate, and Revoke Credentials

Treat both key values as credentials. Store them in a secrets manager or protected server configuration, and redact them from logs before sharing diagnostic information.

To remove access, return to WooCommerce > Settings > Advanced > REST API, open the relevant key, and choose Revoke API Key.

For routine rotation, generate a replacement with the same necessary access. Update the integration, test it, then revoke the old key. If credentials have been exposed, revoke them immediately and investigate their use.

We recommend reviewing keys whenever an employee leaves, an agency handover finishes, or a service is disconnected. Unused access has no upside.

Your hosting should fit the workload behind those connections, too. ZADiC WordPress hosting starts at $9.99/month. For projects needing more server control, our flexible VPS options offer another path. Choose around your store's requirements rather than paying for a one-size-fits-all setup.

Frequently Asked Questions

Can a Read Key Change Products or Orders?

No. Read permissions allow retrieval, not creation, updates, or deletion. Those changes require Write or Read/Write permissions and sufficient capabilities for the assigned user.

If the integration only produces reports, we recommend keeping it read-only.

Can Existing Keys Be Found in WordPress?

Yes. Open WooCommerce > Settings > Advanced > REST API to manage existing keys and their details.

The Consumer Secret isn't displayed again after generation. If you haven't stored it securely, create a replacement, update the integration, and revoke the old key.

Connect Your Store With Less Access

A reliable integration starts with limited permissions, a suitable WordPress user, and a successful authenticated test. Keep credentials private and remove access when its job is finished.

Start with Read when retrieval is enough. Add write access only when the integration needs to change your store. You get a working connection without handing over more control than necessary.

We use cookies so you can have a great experience on our website. View more
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://zadic.net.

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year. If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser. When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed. If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website. These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue. For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where your data is sent

Visitor comments may be checked through an automated spam detection service.
Save settings
Cookies settings