E-commerce 0.7.0: Order export tools, delivery service choice and country limits
E-commerce 0.7.0 lets an external system read your PhoenixKit shop’s orders, lets buyers pick a delivery service when a shipping method offers several, and lets each shipping method name the countries it serves.
Orders for an external system
An accounting or fulfilment system can now read orders through the API. It gets a feed of orders in the order they changed, filtered by status, change time and sync state, and can look orders up by id or number. Each order comes as one map with its product lines and the options the buyer picked. The buyer’s contacts are only given to a key that also holds the customer permission, and internal notes never are. The system can then mark each order as synced. If the order changed after it was read, the mark is refused and the order stays pending.
A new Manage orders sub-permission guards reading customers and marking orders as synced. The tools appear only with Billing 0.23.0 or later.
Delivery services and country limits
A calculated shipping method can now offer several delivery services. On the method form, tick them under Services offered to the buyer; the first is the default. When a method offers two or more, the shipping picker in the cart and checkout lets the buyer choose, and the choice drives the rate, the quote and the order.
Under Limit by country, a method now has Deliver only to and Never deliver to lists. A country cannot be in both. The shipping methods list shows the codes, and when only one country is served, checkout picks it by default.
Smaller changes
- A cart or checkout line whose product has no photo can show a picture you supply, through
config :phoenix_kit_ecommerce, :item_image_fallback, {Mod, :fun, args}. - The new-order notification links to the order’s Billing page for staff with billing access.
- The public API is documented under
/api/public/v1and/mcp/public;/api/shop/v1and/mcp/shopstill work but are deprecated. - The product page’s thumbnail strip no longer widens the page when a product has many pictures.
- During a carrier outage, cart changes no longer wait out the service lookup twice.
Upgrading
No migration. Update the dependency; the core (>= 2.43.0) and Billing (~> 0.20) requirements are unchanged, and the order tools switch on once Billing is 0.23.0 or later. Existing shipping methods with one service work as before. The module now declares mint ~> 1.6 itself.
Full release notes: E-commerce 0.7.0
0.7.0 · 24 October 2026
Added
- Order tools for an external system (#95):
ecommerce.list_orders(a feed in(updated_at, uuid)order with an opaque cursor, filtered by status, change time and sync state; a limit above 100 is refused),get_orders(by id or number),get_order_customersandset_order_sync(records the external system’s mark per row against the revision it read; an out-of-date row answersstale_revisionand stays pending).API.OrderExport.serialize/2/serialize_many/2give an order as one JSON-ready map, with each product line’soptions(the buyer’s selection) andsku_at_orderwhen the SKU moved; the buyer’s contacts only for a key that also holdsecommerce.orders:customer, never internal notes or session data. A newshop.manage_orderssub-permission guardsget_order_customersandset_order_sync. The tools are offered only with a billing that hasPhoenixKitBilling.put_order_sync/2andOrder.sync/1, i.e.phoenix_kit_billing0.23.0 or later; with an older billing they are not listed. - Several delivery services per calculated shipping method (#107): the
admin form ticks the services a method offers (the first is the default), and
when a method offers two or more the cart and checkout shipping picker lets
the shopper choose; the choice (
set_cart_shipping_service/2,cart.metadata["shipping_service"]) drives the rate request, the quote and the order’sshipping_provider.service. Existing methods with oneservicebehave as before, with no data migration. - Shipping method country lists (#94): “Deliver only to” and “Never deliver
to” on the method form (checkboxes in a scrolling box), shown on the methods
list;
Shop.checkout_countries/0, and the default checkout country follows a single served one. A provider setting can be a:pickup_pointfield chosen from the carrier’s branch list for the picked city. - Cart line picture fallback (#108):
config :phoenix_kit_ecommerce, :item_image_fallback, {Mod, :fun, args}supplies an image URL for a cart or checkout line whose product has no photo (ItemImage.url/1). A fallback that raises, exits or throws logs a warning and keeps the icon. - Public API (#99):
facets: falseonsearch_products/search_products_batchleaves the facet block out and skips building it;unknown_option_key/unknown_option_valuewarnings for a typo in the options filter;attribute_label/value_labelon every cart line option (in the request’s language) and labelled options on the claim page; apriceper value of anaffects_priceoption on the product card.
Changed
- The public API is documented under core’s neutral paths (#104):
/api/public/v1and/mcp/public;/api/shop/v1and/mcp/shopare deprecated aliases until core 3.0.0. The cart tools declarecart_tokenas their client token and the checkout link as a credential, the module declares its four cart error codes (api_problems/0), and a new cart is charged to core’s shared new-rows quota (check_new_rows/1,check_cart_rows/1on an older core). Each is set only against a core that supports it. shop.create_cartandshop.get_checkout_linkno longer offer an idempotency key (replay: false, where core supports it): neither has anything a replay could return.- Product and category URLs in API answers use the domain of the answer’s
language when the host maps languages to domains (
:canonical_host_resolver, core’sRoutes.canonical_absolute_or_nil/2); otherwise the request’s host (#96). - The new-order admin notification links to the order’s Billing page for recipients with billing access (the carts list while Billing is off or for others), and an operator who placed the order is notified as an operator too (#106).
mint ~> 1.6is a declared requirement:Services.PinnedAdaptercallsMint.HTTPdirectly and had relied on it arriving through Req and Finch.- The carriers’ integrations are offered only while the shop is switched on.
- Dependencies refreshed to PhoenixKit 2.64.1 and phoenix_kit_ai 0.26.1. The
phoenix_kit(>= 2.43.0) andphoenix_kit_billing(~> 0.20) requirements are unchanged; the newer-core and newer-billing features above switch on where they are available.
Fixed
shipping_quote_snapshot/2no longer asks the carrier for the method’s service list a second time (for thechoices) when the first listing for the cart failed: during a carrier outage every cart change waited out the lookup timeout twice.- A picked destination records the service it was picked for, so changing a method’s default service cannot reinterpret it; a legacy destination without a recorded service asks to be confirmed again.
- The product page’s thumbnail strip stays inside the gallery column (a product with many pictures widened the page and squeezed the buy box) (#98).
- A 409
revision_mismatchcart carries its option labels in the request’s language. - The assistant cart settings labels wrap instead of running into the next column (#105).
E-commerce 0.7.0. Install or update: {:phoenix_kit_ecommerce, "~> 0.7"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.