=== Ordersmith – Orders & Stock Sync for TikTok Shop ===
Contributors: sysridge
Tags: tiktok shop, woocommerce, order sync, inventory sync, multichannel
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sync TikTok Shop orders, shipping labels, tracking and stock with WooCommerce, instantly, so you never oversell.

== Description ==

Selling on TikTok Shop and your own WooCommerce store? Ordersmith connects the two, so you stop copying orders by hand and stop selling the same item twice.

**What it does**

* **Orders in, instantly.** New TikTok Shop orders appear in WooCommerce within seconds, with items, shipping fee and discounts. Status changes (on hold, awaiting shipment, delivered, cancelled) follow automatically, and completed TikTok refunds and returns are recorded as WooCommerce refunds (returned items go back into stock).
* **Ship from WooCommerce.** For orders shipped with a TikTok Shop label, arrange drop-off or pickup and print the label from the order screen. If you use your own courier, enter the carrier and tracking number and Ordersmith sends them to TikTok Shop.
* **Stock stays matched.** Every stock change in WooCommerce (sales, refunds, edits) is pushed to TikTok Shop, so a product that sells out on your website also sells out on TikTok.
* **Matched by SKU.** Products are matched by SKU, ignoring upper and lower case. If a TikTok SKU isn't found in WooCommerce, the order is still imported and a clear note explains what to fix.
* **See what happened.** Every import, stock update and error is logged in WooCommerce → Status → Logs.

Ordersmith is an independent plugin by SysRidge. It is not affiliated with, endorsed by or sponsored by TikTok or WooCommerce; TikTok, TikTok Shop and WooCommerce are trademarks of their respective owners.

**Free, with no product limits.** Connect your TikTok Shop with unlimited products and orders.

**Ordersmith Pro** is an optional add-on, sold separately: connect more than one TikTok Shop (for example a second brand), arrange shipments and print labels in bulk, get email alerts, cancel and refund TikTok Shop orders from WooCommerce, and send prices, titles and descriptions to TikTok Shop. Everything listed above works without it. [See Ordersmith Pro](https://www.sysridge.com.au/ordersmith/pro/)

**Requirements**

* WooCommerce 8.0 or newer (HPOS compatible)
* A TikTok Shop seller account in a supported market (currently the United Kingdom)
* Products that use the same SKU in WooCommerce and TikTok Shop

== Installation ==

1. Install and activate Ordersmith from Plugins → Add New.
2. Go to **WooCommerce → Ordersmith** and click **Connect TikTok Shop**.
3. Log in to TikTok Shop Seller Center and approve the connection.
4. Back in WordPress, click **Finish connecting**.
5. Click **Send all stock to TikTok** once to align stock levels.

From then on, orders and stock sync automatically.

== Frequently Asked Questions ==

= Why are some buyer addresses partly hidden (a***o)? =

For orders shipped with a TikTok Shop shipping label, TikTok Shop only shares a masked address with sellers. The full address is printed on the label. This is a TikTok Shop privacy rule, not a Ordersmith limitation.

= A product's stock isn't syncing. What should I check? =

The product must have **Manage stock** enabled and a SKU that matches the TikTok Shop seller SKU. Upper and lower case don't matter, but spaces and dashes do. Check WooCommerce → Status → Logs (source "ordersmith") for details.

= Do orders placed before I connected affect my stock? =

No. Orders from before you connected are imported for your records only, and stock is not changed for them, because you will already have handled them.

= New orders take up to an hour to appear =

Instant sync needs TikTok Shop's notifications to reach your website. If your site isn't reachable from the internet (for example a local or password-protected staging site), Ordersmith falls back to checking every 15 minutes. The Ordersmith settings page shows which mode is active.

= Are buyers emailed by WooCommerce? =

No. TikTok Shop does not allow sellers to contact buyers outside TikTok, so Ordersmith imports orders without the buyer's email address and WooCommerce sends them nothing. You still receive the usual "New order" email.

= What happens if I disconnect Ordersmith in TikTok Shop Seller Center? =

Syncing stops, and WordPress shows a notice with a **Reconnect TikTok Shop** link. Orders already imported stay in WooCommerce.

= What happens when a TikTok order is cancelled or refunded? =

A TikTok cancellation cancels the WooCommerce order and puts its stock back. A completed TikTok refund or return is recorded as a WooCommerce refund; returned items go back into stock, while refunds where the buyer keeps the item don't change stock.

Cancel and refund TikTok orders in TikTok Seller Center. If you cancel a TikTok order only in WooCommerce, its stock is held until it is also cancelled on TikTok Shop, so the item can't be sold twice. (Ordersmith Pro can cancel and refund on TikTok Shop for you, from the WooCommerce order screen.)

= Can I change a buyer's address? =

No. TikTok Shop only lets the buyer change their delivery address.

= Which markets are supported? =

The United Kingdom. More TikTok Shop markets will be added as they are approved.

== External services ==

Ordersmith connects to two external services. Both are needed for it to work.

**TikTok Shop Open API** (by TikTok)
Used to read your orders, products, returns and refunds, arrange shipments, fetch shipping labels, send tracking numbers, and update stock levels. Requests are sent from your website directly to `open-api.tiktokglobalshop.com` and `auth.tiktok-shops.com`, but only after you connect your shop, and only with the permissions you approve. They include order IDs, SKUs, stock quantities, tracking numbers and your shop's access token.
Terms: https://www.tiktok.com/legal/page/eea/terms-of-service/en
Privacy: https://www.tiktok.com/legal/page/eea/privacy-policy/en

**Ordersmith connection service** (by SysRidge, hosted in Germany)
TikTok Shop requires every API request to be signed with a secret that cannot be shipped inside a public plugin, so Ordersmith uses a small SysRidge service at `n8n.sysridge.com.au`. It:

* exchanges and refreshes your shop's access token when you connect and about once a week afterwards (the token passes through and is not stored),
* signs each API request: it receives the request path and parameters, such as order IDs, SKU quantities or tracking numbers, but **never TikTok's responses, so it never sees buyer details**,
* stores your shop ID, your site's notification address and a per-site secret, so it can forward TikTok Shop order notifications (order ID and status only) to your site for instant sync, plus a notice if you disconnect the app in TikTok Shop. This is removed when you disconnect.

The service is contacted only after you click Connect TikTok Shop.
Terms: https://www.sysridge.com.au/ordersmith/terms/
Privacy: https://www.sysridge.com.au/privacy-policy/#ordersmith

== Screenshots ==

1. Connect your TikTok Shop in one click.
2. A TikTok Shop order in WooCommerce, with the TikTok Shop panel for shipping labels and tracking.
3. Settings page showing instant sync status and stock tools.

== Changelog ==

= 1.0.0 =
* First release: instant order import, status updates, TikTok Shop labels and shipment arrangement, seller-shipped tracking, stock sync by SKU.
* Cancellations, refunds and returns sync to WooCommerce, with stock restored where the item comes back.
* Reconnect notice when the app is disconnected in TikTok Shop.
* Automatic retry when TikTok Shop is busy (rate limits).
