E-commerce 0.6.0: Product search, assistant carts and an admin API for prices
E-commerce 0.6.0 opens the PhoenixKit shop to outside systems and AI assistants: public tools to search the catalogue and build a cart, and admin tools to change prices, availability and images.
Public search and product tools
With core’s public API switched on, anonymous callers get five read tools over REST and MCP: product search, batch search, product cards, the category tree and similar products. Search runs on a new index with full-text search per language, filters, facets and a typo-tolerant fallback when the database has the pg_trgm extension. The index follows catalogue and shop changes through jobs on a new shop_search queue and is rebuilt every night. Draft, inactive and deleted products, and products in hidden categories, are never shown.
Carts built by an assistant
The same switch turns on seven cart tools. An assistant can fill a cart, choose shipping and hand the buyer a one-time checkout link. The link opens a page that says An assistant prepared this cart for you. If the buyer already has a cart, they choose Replace my cart or Add these items to my cart, then finish on the site’s own checkout. The tools never take an order, a payment or an address.
The shop settings page gets an Assistant carts card: how many days before an idle assistant cart is abandoned, how long a checkout link works, and caps on the notifications these carts send.
Admin API for prices, availability and images
Outside systems with an admin API key can read and set prices, set availability and attach or detach images on catalogue products. The keys need the owner’s catalogue permission. A price move larger than the Confirmation threshold for price changes (%) on the settings page is held until it is confirmed; a price set to zero is always held.
Other changes
- Shopify sync writes no prices and creates no priced products while the shop has no base currency, and the sync page says why. Only one Shopify sync runs at a time.
- Catalogue option values are stored by key, with a label snapshot on cart and order lines. Existing cart lines keep their selection and price.
- Warehouse can use shop orders as a source.
Upgrading
Run mix phoenix_kit.update: it applies migrations V4 (the search index) and V5 (checkout links) and adds the shop_search queue and the nightly rebuild to your Oban config. Without that queue the search index stays empty. The public tools stay off until core’s public API is switched on, and on an older core that does not carry the shop API. The module now needs req ~> 0.7.
Full release notes: E-commerce 0.6.0
0.6.0 · 17 October 2026
Added
-
Admin and public API tools (#93), offered to a PhoenixKit core that carries the shop API (they stay off on an older core):
- admin tools
ecommerce.get_prices,set_prices,set_availability,attach_imagesanddetach_images, catalogue source only, with a confirmation gate for large price moves, row-level locking and writes limited to thedatapaths a row changes; - public read tools over a new search index (full-text per language,
typo-tolerant with
pg_trgm, facets, product cards, category tree, similar products), kept fresh bySearch.Subscriberand theSearchReindexWorker/SearchRebuildWorkeron theshop_searchqueue; - an assistant cart: seven anonymous write tools that fill a cart and hand
the buyer to the site’s checkout through a one-time claim link
(
/checkout/claim/:token), with three cron workers ondefault(ApiCartSweepWorker,ApiCartPruneWorker,ApiClaimPruneWorker); - the
shop_ordersource kind offered to Warehouse.
- admin tools
-
Migrations V4 and V5:
phoenix_kit_shop_search_indexandphoenix_kit_shop_cart_claims(runmix phoenix_kit.update; theshop_searchqueue must be configured in the host). -
The image downloader connects to the address its private-network guard checked, through a per-request Mint connection (
Services.PinnedAdapter). -
New settings
api_cart_idle_days,api_checkout_claim_ttl_minutes,api_signal_per_cart_per_hour,api_signal_global_per_hourandapi_confirm_price_change_pct, edited on the shop settings page. -
Migrations.up/1honours:version(#90):up(version: N)applies V1 through VN and stamps N, leaves a database already past N alone, and raises on a target outside the chain. With no:versionthe SQL is unchanged. -
Whole-set option values (#90): an attribute set attached with an empty selection offers the set’s published values.
-
mix phoenix_kit_ecommerce.list_unstamped_prices(#90): read-only list of catalogue items that carry a price but no currency stamp. -
PhoenixKitEcommerce.base_currency_change_supported/0(#90): the refusalreprice_for_base_change/3would give, askable before a confirmation step.
Changed
- Shopify prices need a base currency (#90): with none, the sync writes no price and creates no priced item (other fields still apply); the sync page says why and links to the currency settings.
- One Shopify sync at a time (#90):
ShopifyMediaSyncWorkeris unique across kinds andperform/1snoozes behind an earlier run. - Catalogue option values are identified by key (#90): the picker submits
value keys and a cart line stores them with a label snapshot
(
metadata["selection"]); order lines keep labels and gain"selected_spec_keys". Existing cart lines keep their stored selection and price. - The
compat/namespace is marked@deprecatedwith each replacement (#90).
Fixed
- Review of #93: deleting one category now rebuilds the search index (its
products’ category is set to NULL, so the subtree job found nothing), and a
committed currency change rebuilds it too (the index held old-base prices);
merged assistant carts are pruned with the abandoned ones; the pinned image
downloader no longer retries on a 429/503 (Req slept for an uncapped
Retry-After);set_pricesrefuses a row while neither the shop nor the product has a currency;set_availabilitywrites under the item lock and re-plans the row, likeset_prices; the list-item output schema requires onlyid(thefieldsoption drops the rest); the warehouse source kind queries the catalogue table under the schema prefix; a partly written assistant-cart settings form audits what was stored and shows the stored values. - Second review of #93: the admin write tools also require the key owner’s
live
cataloguepermission (as the catalogue editor does), a slow image origin can no longer renew the download timeout indefinitely (one deadline covers headers and body), a non-finite stored price no longer aborts a search rebuild, and the catalogue test-dependency bridge overrides transitive paths.
E-commerce 0.6.0. Install or update: {:phoenix_kit_ecommerce, "~> 0.6"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.