Repository navigation
feat(ecommerce): add WooCommerce store source - #1671
Merged
Merged
Conversation
Mirror a connected WooCommerce store's products, variations, stock, coupons and orders over its REST API, read-only in ChatbotX, next to Shopify. Shopify-only names become shared by both external stores (externalCheckoutMethod, externalAutoApplyDiscounts, externalStoreManaged); the old checkout keys are still accepted. The store currency follows the connected store, and switching the store source to one queues a full sync.
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
* feat(ecommerce): add WooCommerce store source Mirror a connected WooCommerce store's products, variations, stock, coupons and orders over its REST API, read-only in ChatbotX, next to Shopify. Shopify-only names become shared by both external stores (externalCheckoutMethod, externalAutoApplyDiscounts, externalStoreManaged); the old checkout keys are still accepted. The store currency follows the connected store, and switching the store source to one queues a full sync. * refactor(woocommerce): drop the unused page count in list pagination --------- Co-authored-by: Deathgiver <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
main: the store currency now follows the connected store (it stayed on our own setting, so prices showed in$and orders were charged in the wrong currency), and switching the store source to Shopify or WooCommerce queues a full sync of it.Changes
IntegrationWoocommercetable;storeSource/orderSourcegainwoocommerce. Migration20261109031056_woocommerce_store_sourceis hand-edited to renameshopifyCheckoutMethod→externalCheckoutMethod,shopifyAutoApplyDiscounts→externalAutoApplyDiscountsand the Shopify status enums (drizzle generated drop/create, which would lose saved settings). Shopify's catalog writes move to a sharedexternalStoreRepositorywith asourceparameter.integrations/woocommerce(new) — REST client (Basic auth, query-string fallback for hosts that stripAuthorization, no redirects followed), products/variations/coupons/orders/webhooks APIs, Web Crypto webhook signature check.packages/business/src/woocommerce(new) — connect (SSRF-checked on connect and before every use of the keys), sync, mappers, webhooks, checkout. Web Checkout creates a pending WooCommerce order and returns its payment page; it is mirrored only once paid, so an abandoned payment tells nobody anything. In-App places a cash-on-delivery order.packages/business/src/external-store(new) — shared contact lookup, cart clean-up, status ordering,externalStoreManagedException.externalCheckoutMethod/externalAutoApplyDiscounts(the oldshopify*keys are still accepted on update, deprecated); switching to an unconnected store is refused (externalStoreNotConnected); switching takes the store's currency and queues a full sync.woocommerceSync/woocommerceWebhookjobs underwithBlockedOwnerGuard.woocommerce.*public API (/v1/woocommerce), webhook route/api/woocommerce/[workspaceId]/webhook, Settings → WooCommerce form, products/orders buttons and dialogs moved tofeatures/external-storeand shared by both stores, i18n in all 21 locales.woocommerceis a singleton CLI resource;apps/cli/README.md, newdocs/woocommerce.md, updateddocs/shopify.md,docs/ecommerce.md,AGENTS.md.Breaking changes
shopifyManaged→externalStoreManaged(data.storenames the store).shopifyCheckoutMethod/shopifyAutoApplyDiscounts→externalCheckoutMethod/externalAutoApplyDiscounts(input still accepts the old names).Migration note
Runs after
20261109000000_ai_file_queued_run_index; the snapshot chain is re-rooted there (db:check-driftclean;db:fix-chainreports only the two issues already onmain). Workspaces already selling from Shopify get their currency corrected by Sync Now.Test plan
pnpm lint(incl.db:check-drift,check:invariants)pnpm check-typespnpm test— 67/67 suites (new: WooCommerce mappers, webhooks, sync, public API, currency, store-source switch, legacy settings keys)invariant-guardagent — no violations