WooCommerce
Products, variations, orders, customers, product updates and on-hold status agent opt-in (no prices, stock, completion, cancels or refunds), refunds node only
Beta v0.1.0 Node.js 12 actions
About
A Graphrt plugin for the WooCommerce REST API v3 of one store: products and variations, orders, customers and refunds. It is built with the declarative REST layer (definition.mjs) plus small agent-safety wrappers in lib/.
What it can do
- Products: list_products, get_product, list_product_variations, update_product
- Orders: list_orders, get_order, update_order_status, list_order_refunds, create_refund (node only)
- Customers: list_customers, get_customer
- api_request: any other endpoint under /wp-json/wc/v3 (agents: GET and allowlisted paths only), e.g. /reports/sales or /coupons
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- List products
woocommerce.list_products - Get product
woocommerce.get_product - List product variations
woocommerce.list_product_variations - Update product
woocommerce.update_product - List orders
woocommerce.list_orders - Get order
woocommerce.get_order - Update order status
woocommerce.update_order_status - List order refunds
woocommerce.list_order_refunds - Create refund
woocommerce.create_refund - List customers
woocommerce.list_customers
Show all 12 actions
- Get customer
woocommerce.get_customer - WooCommerce REST API request
woocommerce.api_request
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
WOOCOMMERCE_SITE_URLRequiredThe store's https URL, e.g. https://shop.example.com (a WordPress subdirectory like https://example.com/store works). http is refused -
WOOCOMMERCE_CONSUMER_KEYRequiredREST API consumer key (ck_...) -
WOOCOMMERCE_CONSUMER_SECRETRequiredREST API consumer secret (cs_...), sent with the key as Basic auth -
WOOCOMMERCE_TOOL_ALLOW_PRODUCTSOptional1 lets agent tools update products (not prices or stock) -
WOOCOMMERCE_TOOL_ALLOW_ORDER_STATUSOptional1 lets agent tools put an order on hold (on-hold only) -
WOOCOMMERCE_TOOL_API_EXTRA_PATHSOptionalMore GET paths agents may reach with api_request, comma-separated, * = one segment
How to use it
In Graphrt Desktop
- Open Plugins and search for WooCommerce.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install woocommerce workflow.yaml
- id: complete
type: woocommerce.update_order_status
order_id: "{{#start.order_id#}}"
status: completed
- id: refund
type: woocommerce.create_refund
order_id: "{{#start.order_id#}}"
amount: "25.00"
reason: Damaged in transit