@zerodot/woocommerce 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # @zerodot/woocommerce
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Manage WooCommerce customers, orders, and products, and start a workflow when a coupon, customer, order, or product is created, updated, or deleted. Use it for store sync and order automation.
4
+
5
+ ## Install
6
+
7
+ In zerodot, go to **System > Nodes** and install **WooCommerce**.
8
+
9
+ Manual: install `@zerodot/woocommerce` where the web app and the worker run, and add it to `ZERODOT_NODE_PACKAGES`.
10
+
11
+ ## Nodes
12
+
13
+ ### WooCommerce (`woocommerce.api`)
14
+
15
+ Uses the WooCommerce REST API v3 (`/wp-json/wc/v3`).
16
+
17
+ - **Customer**: create, delete, get, get many, update
18
+ - **Order**: create, delete, get, get many, update
19
+ - **Product**: create, delete, get, get many, update
20
+
21
+ Details:
22
+
23
+ - **Delete** uses `force=true`, so the item is removed for always (not moved to the trash).
24
+ - **Get Many** can return all items (at most 5000) or a limit. The node reads pages of 100 items.
25
+ - **Customer** create and update take billing and shipping addresses, names, and metadata. Create also takes a username and a password. **Get Many** filters by email and sorts.
26
+ - **Product** create and update take the price, stock, status, type, sale dates, SKU, slug, descriptions, and more. **Dimensions**, **Images**, and **Metadata** are separate fields. **Categories**, **Tags**, **Cross Sell IDs**, and **Upsell IDs** are IDs with commas between, such as `12,15`. **Get Many** has the filters of the products list (search, SKU, category, tag, price range, status, stock status, and more).
27
+ - **Order** create and update take **Billing**, **Shipping**, **Coupon Lines**, **Fee Lines**, **Line Items**, **Shipping Lines**, and **Metadata**. Create also has **Set Paid**. **Get Many** filters by customer, product, status, dates, and search.
28
+ - **Category** and **Tag** fields (Product create, update, and get many) load their options from the store (`GET /products/categories`, `GET /products/tags`). You can also type IDs. The old text fields in the collections still work.
29
+ - A date is ISO 8601, such as `2025-01-31T10:00:00`.
30
+
31
+ When WooCommerce gives an error, the node fails with the message and the code of WooCommerce.
32
+
33
+ ### WooCommerce Trigger (`trigger.woocommerce`)
34
+
35
+ Starts a run on one event. Set **Event**:
36
+
37
+ - `coupon.created`, `coupon.updated`, `coupon.deleted`
38
+ - `customer.created`, `customer.updated`, `customer.deleted`
39
+ - `order.created`, `order.updated`, `order.deleted`
40
+ - `product.created`, `product.updated`, `product.deleted`
41
+
42
+ When the workflow is published, the trigger makes a webhook in the store (`POST /webhooks`) with a random secret that the trigger keeps in its state. When the workflow stops, the trigger removes the webhook. You do not set anything in WooCommerce. The address of the trigger must be reachable from the internet.
43
+
44
+ The trigger checks the `X-WC-Webhook-Signature` header: the base64 HMAC-SHA256 of the raw body, with the secret of the webhook. A request with a wrong or missing signature gets status 401 and starts no run. The ping that WooCommerce sends for a new webhook gets status 200 and starts no run. The output is the body of the event (the coupon, customer, order, or product).
45
+
46
+ ## Credential
47
+
48
+ **WooCommerce API** (`woocommerce.api`):
49
+
50
+ - `consumerKey` and `consumerSecret`: from **WooCommerce > Settings > Advanced > REST API > Add key**. Give the key read and write access. WooCommerce shows the secret one time only.
51
+ - `url`: the address of the store, such as `https://example.com`.
52
+ - `includeCredentialsInQuery`: set **Yes** when the server does not read the Authorization header (WooCommerce says "Consumer key is missing"). The key and the secret then go in the query of each call.
53
+
54
+ The **Test** button calls `GET /products/categories`. The store address must start with https://. The node refuses http:// addresses, because the keys must not travel in plain text.
55
+
56
+ ## License
57
+
58
+ AGPL-3.0-only