Manage WooCommerce stores — products, orders, customers, and coupons via the REST API.
Manage products, orders, and customers via the WooCommerce REST API.
WOOCOMMERCE_URL - Store URL (e.g. https://mystore.com)WOOCOMMERCE_KEY - Consumer keyWOOCOMMERCE_SECRET - Consumer secretcurl -s -u "$WOOCOMMERCE_KEY:$WOOCOMMERCE_SECRET" \
"$WOOCOMMERCE_URL/wp-json/wc/v3/products?per_page=10" | jq '.[] | {id, name, status, price, stock_quantity}'
curl -s -X POST -u "$WOOCOMMERCE_KEY:$WOOCOMMERCE_SECRET" \
-H "Content-Type: application/json" \
"$WOOCOMMERCE_URL/wp-json/wc/v3/products" \
-d '{"name":"New Product","type":"simple","regular_price":"29.99","description":"Product description","sku":"SKU-001"}' | jq '{id, name}'
curl -s -u "$WOOCOMMERCE_KEY:$WOOCOMMERCE_SECRET" \
"$WOOCOMMERCE_URL/wp-json/wc/v3/orders?per_page=10" | jq '.[] | {id, status, total, billing_email: .billing.email}'
curl -s -X PUT -u "$WOOCOMMERCE_KEY:$WOOCOMMERCE_SECRET" \
-H "Content-Type: application/json" \
"$WOOCOMMERCE_URL/wp-json/wc/v3/orders/ORDER_ID" \
-d '{"status":"completed"}' | jq '{id, status}'
curl -s -u "$WOOCOMMERCE_KEY:$WOOCOMMERCE_SECRET" \
"$WOOCOMMERCE_URL/wp-json/wc/v3/customers?per_page=10" | jq '.[] | {id, email, first_name, last_name, orders_count, total_spent}'