WooCommerce API
Keep the ERP or warehouse system you used with WooCommerce, by giving it a new shop address and a key.
In the admin Apps › WooCommerce API
WooCommerce API is an app. Install it from Apps, then open it with Open app: it opens inside your admin, signed in to your store as you.
Use it when a system you already have (an ERP, a warehouse system, a shipping tool) was built to work with a WooCommerce shop and you do not want to change it. The app answers that system the way a WooCommerce shop does: the system reads your orders, marks them completed when they are shipped, and writes your stock. You give it a new shop address and a key; nothing else in it changes.
Connect your system
- Copy Shop address for the connected system into the place where your system asks for the WooCommerce store URL. The system adds
/wp-json/wc/v3itself. - Under Keys, type a Description (the system’s name), choose its Permissions (Read/Write, Read or Write) and press Add key.
- Copy the Consumer key and the Consumer secret into your system at once: the secret is shown only this one time. The app keeps both only as hashes, so nobody can read them back.
Each key shows its last seven characters and when it was last used. To stop a key, tick Yes, revoke it and press Revoke: it stops working at once and cannot be brought back. Give each system its own key, so you can stop one without the others.
Making or revoking a key and changing the settings below need a role that sees your customers and your orders, because a key gives another system both. If the app has been open for more than 15 minutes when you press, it asks you to open it again from Apps.
Which orders your system sees
Installing the app connects it as your fulfillment service: in Settings › Fulfillment it shows Connected by the app WooCommerce API and ships every product not given to another service. Each order handed to it appears to your system as a WooCommerce order with the status processing, usually within seconds and at the latest after ten minutes. Warehouse connection on the app’s page says whether it is connected; Connect again connects it anew.
- When your system marks an order completed, the order is marked shipped in your store and the customer is emailed. If your system wrote a tracking number on the order (as
_tracking_number,tracking_number,_wc_shipment_tracking_numberorawb), the shipment gets it, with the courier’s name (_tracking_provider,tracking_provider,_tracking_companyorcourier) and a tracking address that begins with http or https (_tracking_urlortracking_url). - When your system marks an order cancelled, the app keeps it as cancelled for your system and says so under Recent problems. It does not cancel the order in your store: cancel it there yourself if it should be.
- Any other status your system sets (on hold, pending and the like) is not applied, and Recent problems says so.
- When you cancel an order in your store, the app accepts the cancellation, unless your system had already marked the order completed: then it is refused and Recent problems says why.
- Order fields and notes your system writes on an order are kept and given back to it.
- When an order changes in your store (it is paid, say), your system reads the change.
Your system cannot create or delete orders through the app: orders are made in your store.
How a courier and a delivery point read
Some systems expect their own fields in an order to know the courier. Nothing is added unless you set it.
- Courier fields in orders: one line per courier, with the courier, the kind of delivery (
address,office,locker, or*for any) and the fields the order gets, likeecont office: courierID=15, delivery_type=office. - Shipping address for an office or locker: what the first line of the shipping address says when the order goes to a courier’s office or locker.
{name},{code},{address}and{city}are replaced with the point’s own. Left empty, it is the point’s address.
Products and stock
Your system reads your products: a product with one variant reads as a simple product, one with several as a variable product with its variations. It can find them by SKU. It cannot add or change products.
Stock your system writes for a product or a variation is taken as what your warehouse counted for that SKU. Your store then subtracts what orders have taken that the warehouse has not yet, and sets the rest. A SKU your store does not know, or one whose stock your store does not set from this warehouse (a product given to another service, a bundle, an item without stock tracking, stock kept per location), is left as it is and named under Recent problems.
Amounts and VAT
Each order gives its total, the VAT in it (total_tax) and whether your prices include VAT (prices_include_tax). Items, shipping and a payment fee (such as a cash on delivery fee) are given as your customer was charged, with the VAT inside them when your prices include it. A discounted item gives its amount before the discount and after it.
The app does not give the VAT of a single item or of shipping, and no VAT rates: those fields read 0 and the list of taxes by rate is empty. If your system books VAT for each item, set the VAT rates in that system.
Amounts are written in the currency’s own decimals: two for euros, none for yen, three for Kuwaiti dinars.
An order partly paid with a gift card or store credit still reads with its full total. If your system collects cash on delivery from the order’s total, check such orders in your store, where the order says what is left to pay.
How often your system may call
Each key may make 600 reads, 240 order changes and 60 stock changes a minute. A stock change that sets many products at once (a batch of up to 100) counts as one. Past that the app answers “too many requests” and says when to try again; a system that waits and tries again loses nothing.
Your customers' data
The app keeps a copy of each order handed to it, with the customer’s name, email, phone, address and note, so your system can read it. Its privacy page, linked from the app in Apps, says what is kept.
- When you delete a customer in Customers, who they were is removed from the app’s copy of their orders, with the fields and notes your system wrote on them. The orders stay, with their items and amounts.
- When you ask for a customer’s data in Customers, the app’s page shows Customers’ data requests with a file of what the app keeps of them: press Download.
- Your connected system has its own copy of the orders it read. Delete the customer there too.
- 48 hours after you remove the app, everything it kept for your store is deleted.
What it does not do
- Refunds, coupons, customers and webhooks are not offered to your system: it reads orders by asking for them.
- Dates are given in UTC.
- The app’s page is in English and Bulgarian, and the lines under Recent problems are in English.