What we do
Tools
Industries
Department
How we workLet's talk →
Home/WooCommerce
WooCommerce

The API for WooCommerce: Creating Keys, Making Calls and Connecting the Store

An accounting app, a shipping tool or the developer you just hired wants "API access" to your store. You don't need to install anything for that. WooCommerce comes with a REST API, and access is a pair of keys you create in the admin, with the permission you choose. Here's where they are, how they're used, and what it takes to build a real connection on top.

Where WooCommerce stops

Orders and products get exported and imported by hand between WooCommerce, spreadsheets and accounting.

Stuck on WooCommerce? Let's solve it →
The short version

Yes, there's an API, and it's free. It's part of WooCommerce itself. Calls go to yourstore.com/wp-json/wc/v3, with endpoints for orders, products, customers, coupons and more.

Keys live here. Click Add key, pick a WordPress user and a permission, and WooCommerce generates a consumer key and consumer secret.

WooCommerce Settings Advanced REST API

Want to hear about new orders as they happen? That's a webhook, not repeated API calls. More on the WooCommerce webhooks page.

WooCommerce Settings Advanced Webhooks

Creating a key for an app or a developer

Some apps skip this screen: they send you to a WooCommerce approval page (the /wc-auth/v1/authorize endpoint), you approve, and the keys are created and passed to the app for you.

  1. 1

    Confirm your permalinks

    Settings Permalinks

    Pick any option except Plain. WooCommerce's API docs say default permalinks won't work with the /wp-json/ address.

  2. 2

    Add the key and name it after the app

    WooCommerce Settings Advanced REST API Add key

    Write a description you'll recognize in a year, like "Shipping app, set up by the warehouse". Then choose the WordPress user the key acts as. It gets that user's capabilities.

    Watch for: the user you pick. If that WordPress user is ever deleted, the key stops working, and the app quietly loses access. A dedicated integration user is safer than a staff member's login.

  3. 3

    Give it only the access it needs

    The choices are Read, Write and Read/Write. A reporting or dashboard tool needs Read. Anything that updates stock, creates orders or changes prices needs Write.

  4. 4

    Generate and copy both strings

    Click Generate API key. You get a consumer key (starts ck_) and a consumer secret (starts cs_). Copy them before leaving the screen, because the secret is hidden afterwards, and share them through a password manager, not email.

  5. 5

    Revoke it when the app goes

    Each key on the REST API screen has a Revoke option. Cancelled an app or ended a contract with a developer? Revoke their key the same day.

How the key gets sent: HTTPS or plain HTTP

WooCommerce accepts two ways of authenticating, and which one applies depends on whether the store is on HTTPS.

Store on HTTPS

Basic Auth with the key pair

  • The consumer key is the username and the consumer secret is the password.
  • If the server doesn't pass the Authorization header through, send them as consumer_key and consumer_secret in the query string instead.
  • Anyone holding both strings can do whatever the key's permission allows, so treat them like an admin password.
Store on HTTP

OAuth 1.0a, signed on every request

  • Each call carries a signature (HMAC-SHA1 or HMAC-SHA256), a timestamp and a random nonce.
  • Requests with a timestamp more than 15 minutes off are rejected.
  • More code to write and more to go wrong, which is why most integrations only target HTTPS stores.

If the store isn't on HTTPS yet, moving it there is less work than signing every request, and your checkout should be on HTTPS anyway. One more thing: the Store API under /wp-json/wc/store/ serves the shopper's cart in the browser. A back-office sync belongs on /wc/v3.

What people connect through the WooCommerce API, and what makes each one hard

If you want On the API side What usually trips it up
Orders posted to QuickBooks, Xero or another ledger Read new orders from /orders, or receive an order webhook, and create the matching sale in the books. Refunds, shipping and gateway fees need their own lines, and the processor's deposit rarely equals the order total. The QuickBooks side is covered on WooCommerce to QuickBooks.
Stock that matches a warehouse or ERP Update stock_quantity on products and variations, using the batch endpoints for big catalogs. Each variation keeps its own count, and two systems writing the same number at once overwrite each other. See WooCommerce inventory.
Buyers and orders showing up in a CRM An order-created webhook plus the /customers endpoint for account holders. Guest checkouts don't create a customer account, so the CRM has to match on email from the order itself.
Subscription renewals tracked outside WordPress The Subscriptions extension adds its own subscription endpoints next to the core ones. A failed renewal changes status inside WooCommerce. Your CRM or books only hear about it if something listens for the subscription webhook. More on WooCommerce Subscriptions.
Custom options or checkout fields sent to production Extra data arrives as meta_data on the order and its line items. Every plugin names its fields differently. See product add-ons and checkout customization.

An outdoor gear store whose last unit kept selling twice

An outdoor gear retailer on WooCommerce, with a small warehouse of its own.

Before

A shipment arrived at the warehouse, and the website kept showing the old count until someone updated it by hand.

In the gap, two customers could both buy the last unit.

After

Receiving stock in the warehouse updates WooCommerce within minutes.

An online sale of the last unit lowers what the warehouse system thinks is available, so the count agrees in both places.

Questions people ask

Do I pay anything extra to use the WooCommerce REST API?

No. It ships with WooCommerce, so every store has it. Any cost comes from the app you're connecting, or from building and looking after a custom integration.

Can an app get into my store without my admin password?

Yes, and it should. Create a REST API key for it under WooCommerce, Settings, Advanced, REST API, with Read or Read/Write access. The app uses the key pair, never your login, and you can revoke it on its own.

Is WooCommerce free?

The plugin is free to install on WordPress. The store around it isn't: hosting, a theme, payment processing, and paid extensions like Subscriptions or advanced shipping all add up. For most stores, the free core is the smallest part of the running cost.

What is WooCommerce Subscriptions?

A paid extension that adds recurring billing to WooCommerce. It charges the saved payment method on a schedule and creates a renewal order each time. It can fire subscription webhooks, but nothing outside WordPress acts on a failed renewal unless something is listening for them, which is where an integration usually picks up.

Should I use Shopify or WooCommerce?

It's mostly about who runs the store. Shopify is hosted for you, and WooCommerce runs on your own WordPress site and hosting, which gives you more control and more to maintain. Both have an API and can be tied to accounting, stock and a CRM. There's a fuller breakdown on Shopify vs WooCommerce.

Can WooCommerce sync inventory with my warehouse or ERP automatically?

Not by itself. WooCommerce keeps the count it's given. A two-way sync, where a receipt in the warehouse updates the site and a web sale updates the warehouse, is built on the API around whichever system owns your stock.

Does WooCommerce integrate with payment processors beyond the defaults?

Yes, there are gateway plugins for most processors, and checkout itself is rarely the problem. The work tends to be afterwards: matching each processor deposit, with its fees taken out, back to the orders it paid for in your books.

Let's talk

Tell us the one thing your team does manually that eats up time. We read every message and reply within a day.