Skip to main content

WooCommerce ExecModule

Overview

WooCommerceModule connects ValkyrAI workflows to the WooCommerce REST API v3 through the native map I/O ExecModule ABI. It covers the same customer, order, and product action families emphasized by n8n while enforcing ValkyrAI's IntegrationAccount, validation, retry, redaction, and observability contracts.

The module provides 15 operations: create, get, list, update, and guarded permanent delete for customers, orders, and products. Collection reads support bounded filters and page traversal. GET requests retry transient failures conservatively; creates, updates, and deletes are single-attempt because a transport failure can leave their provider outcome ambiguous.

Usage

  1. Enable WordPress permalinks and the WooCommerce REST API on the target store.
  2. Create a dedicated WooCommerce REST API key with only the read or read/write permissions the workflow needs.
  3. Store the consumer key in encrypted IntegrationAccount.apiKey, the consumer secret in encrypted IntegrationAccount.password, and the HTTPS store origin in IntegrationAccount.accountId.
  4. Set the account status to READY and bind it through ExecModuleConfig.authConfig.integrationAccount.
  5. Choose one documented operation and supply only its typed resource ID, record, filters, and pagination controls.
  6. Require a human or policy approval before setting confirmDelete: true.

Credentials, authorization headers, arbitrary HTTP methods, and alternate API paths cannot come from workflow input.

Inputs

NameTypeRequirementDefaultDescription and constraints
operationstringRequiredNoneOne of the 15 documented operations.
storeUrlstringRequired unless account supplies itIntegrationAccount.accountIdHTTPS public-DNS store origin, optionally with a bounded WordPress subdirectory path. Credentials, custom ports, query strings, fragments, localhost, and IP literals are rejected.
resourceIdintegerGet/update/deleteNonePositive customer, order, or product ID.
recordobject or JSON stringCreate/updateNoneNon-empty, resource-specific allowlisted fields; at most 80 properties and 256 KiB. Credential-like fields are rejected.
queryobject or JSON stringOptional list filter{}Up to 20 resource-specific filters with bounded scalar or scalar-array values.
pageintegerOptional list start1First provider page, 1–100,000.
perPageintegerOptional100WooCommerce page size, 1–100.
returnAllbooleanOptionalfalseFollow pages until exhaustion or the 10,000-item safety cap.
confirmDeletebooleanDelete onlyfalseMust be true; the module sends WooCommerce force=true.
timeoutMsintegerOptional30000Total/connect/read/write timeout, 100–300,000 ms.

Create requirements include a bounded email for customers, a bounded name for products, and either line_items or customer_id for orders. Customer password creation is intentionally deferred so workflow payloads cannot carry credential-like fields.

Outputs

NameTypeWhen presentDescription
statusstringAlwayssuccess or error.
operationstringAlwaysNormalized operation name.
resourcestringValid operationcustomers, orders, or products.
data / idobject / integerSingle-resource successProvider resource and verified positive ID.
items / countarray / integerList successBounded collection resources and emitted count.
hasMore / nextPageboolean / integerList successProvider pagination state.
httpStatusintegerSingle-resource provider responseWooCommerce HTTP status.
attemptsintegerAlwaysTotal provider attempts, including page reads.
errorobjectFailureSafe {code, message, retryable} details.

Consumer keys, consumer secrets, Basic authorization values, and credential-bearing provider text are redacted from errors and outputs.

IntegrationAccount Requirements

SettingRequirement
ProviderWooCommerce REST API v3 store
accountNameHuman-readable automation identity
accountIdHTTPS store origin, for example https://store.example.com
apiKeyEncrypted WooCommerce consumer key, normally ck_...
passwordEncrypted WooCommerce consumer secret, normally cs_...
statusREADY; every other status fails closed
Permissionread for get/list-only workflows or read/write for approved mutations

WooCommerce REST API keys inherit the WordPress user's capabilities. Use a dedicated minimum-access user, rotate the key through the IntegrationAccount lifecycle, and never place either credential in workflow JSON.

Configuration

{
"version": "1.0.0",
"authConfig": {
"authStrategy": 1,
"integrationAccount": "integration-account:woocommerce-production-store"
},
"retryPolicy": {
"maxAttempts": 3,
"backoffStrategy": "EXPONENTIAL",
"initialDelayMs": 1000,
"maxDelayMs": 5000,
"jitter": false
},
"executionConfig": {"timeoutMs": 30000},
"payloadConfig": {
"parameters": "{\"operation\":\"list_orders\",\"perPage\":50,\"query\":{\"status\":\"processing\"}}"
}
}

The integration-account value is symbolic. Persisted workflows use the generated relationship, not embedded credentials.

Operations

OperationWooCommerce behaviorSide effect
create_customerCreates a customer with a bounded email and allowlisted profile/address metadata.Customer write; single attempt.
get_customerReads one customer by ID.Read-only; safe retries.
list_customersLists customers with search, email, role, ordering, and ID filters.Read-only; paginated safe retries.
update_customerUpdates allowlisted customer fields.Customer write; single attempt.
delete_customerPermanently deletes one customer with force=true.Destructive; confirmation required.
create_orderCreates an order from typed customer, line-item, address, payment, shipping, fee, coupon, and metadata fields.Order write; single attempt.
get_orderReads one order by ID.Read-only; safe retries.
list_ordersLists orders by status, customer, product, time, parent, search, and ordering filters.Read-only; paginated safe retries.
update_orderUpdates allowlisted order fields.Order write; single attempt.
delete_orderPermanently deletes one order with force=true.Destructive; confirmation required.
create_productCreates a product with bounded catalog, price, stock, shipping, media, category, attribute, and metadata fields.Product write; single attempt.
get_productReads one product by ID.Read-only; safe retries.
list_productsLists products by catalog, stock, category, tag, price, SKU, time, and ordering filters.Read-only; paginated safe retries.
update_productUpdates allowlisted product fields.Product write; single attempt.
delete_productPermanently deletes one product with force=true.Destructive; confirmation required.

Errors and Failure Modes

CodeTypical causeRetryableResolution
VALIDATION_ERRORInvalid store origin, credential, ID, payload, filter, timestamp, pagination, or delete acknowledgement.NoCorrect the named field; no unsafe request was sent.
UNSUPPORTED_OPERATIONUnknown operation.NoSelect a documented operation.
INTEGRATION_ACCOUNT_REQUIREDNo bound account.NoBind a WooCommerce IntegrationAccount.
INTEGRATION_ACCOUNT_NOT_READYAccount is not READY.NoRepair or reconnect the account.
WOOCOMMERCE_WOOCOMMERCE_REST_*WooCommerce returned a structured API error.Depends on HTTP statusCorrect permissions, resource state, or payload.
WOOCOMMERCE_HTTP_401 / 403Key is invalid, expired, or under-scoped.NoRotate the key or grant the minimum required capability.
WOOCOMMERCE_HTTP_404Resource or REST route is absent.NoVerify permalinks, WooCommerce activation, version, and resource ID.
WOOCOMMERCE_HTTP_429 / 5xxRate limit or transient store failure.Yes for readsHonor Retry-After; reconcile mutations before repeating them.
NETWORK_ERRORDNS, TLS, timeout, or connectivity failure.Yes for readsVerify the store; never blindly retry an ambiguous mutation.
RESPONSE_TOO_LARGEOne response exceeded 5 MiB.NoNarrow filters or lower perPage.

Example

List paid orders waiting for fulfillment:

{
"operation": "list_orders",
"storeUrl": "https://store.example.com",
"perPage": 50,
"returnAll": false,
"query": {
"status": "processing",
"orderby": "date",
"order": "asc"
}
}

Expected result:

{
"status": "success",
"operation": "list_orders",
"resource": "orders",
"count": 2,
"hasMore": false,
"attempts": 1,
"items": [
{"id": 1042, "status": "processing"},
{"id": 1048, "status": "processing"}
]
}

Notes

  • Pagination: list operations set page and per_page, consume X-WP-TotalPages, stop after the requested page unless returnAll is enabled, and cap aggregate results at 10,000.
  • Rate limits: GET operations retry HTTP 408, 429, 500, 502, 503, and 504 up to three attempts with bounded backoff and integer Retry-After. Mutations never retry automatically.
  • API limits: every response is capped at 5 MiB, every record at 256 KiB and 80 fields, filters at 20 fields, page size at 100, and aggregate results at 10,000. Store origins, strings, arrays, IDs, and timestamps are validated before dispatch.
  • Idempotency: get/list operations are safe reads. Create, update, and delete are not assumed idempotent; a timeout is ambiguous and requires provider reconciliation before a manual retry. Use stable SKU, email, transaction, and caller correlation data where the business process supports it.
  • Destructive behavior: all exposed delete operations send force=true, are permanent, and require confirmDelete: true. This version does not expose batch deletion.
  • Privacy: customer and order responses can contain personal and transactional data. Limit downstream propagation, logging, retention, and workflow audiences to the governing policy.
  • Routing: production requests use the validated HTTPS store origin plus the fixed /wp-json/wc/v3 API root. HTTP downgrade, embedded credentials, custom ports, arbitrary paths, localhost, and IP literals are rejected.
  • External verification: request construction, Basic authentication, pagination, validation, retry safety, response mapping, identity checks, redaction, and metadata discovery are deterministic local tests. Live WordPress capabilities, plugin configuration, proxies, extensions, rate limits, and store data require separately authorized WooCommerce credentials and are not exercised in repository tests.
  • Deferred operations: coupons, product variations, categories, tags, attributes, shipping zones, tax classes, refunds, notes, reviews, reports, webhooks/triggers, batch endpoints, OAuth lifecycle, customer password setting, and arbitrary raw requests.
  • Functional references: n8n WooCommerce integration and WooCommerce REST API documentation.