For developers
Custom connector reference
Connect public products, native cart actions and verified customer tools through your own website backend.
Register capabilities before the embed
Register the connector under window.AskmerioConnectors[websiteId] before loading the embed script. Capabilities include cart, orders and returns. The service configuration must allow the same actions; a browser declaration alone cannot enable them.
Callbacks run on the merchant page and use its own cookies and CSRF protection. Frame/origin checks restrict RPC to the installed assistant. Never put an operator key or a server API credential in the connector.
Live products and cart
product({id}) returns currency, title, optional description/image, requiresSellingPlan and variants. Each variant needs an opaque string id, title, integer minor-unit price and boolean available. Optional fields include same-store url, image, compareAtPrice and priceKnown. Currency must match the imported catalog.
Set priceKnown to false when pricing must be confirmed on the product page; do not invent a free price. Native choices such as special subscriptions can require the product page instead of generic add-to-cart.
addToCart({id,quantity},{requestId}) must validate the item and current availability on the merchant backend and return {ok:true} only after a confirmed native cart addition. Persist idempotency for the request ID. A timeout is an uncertain outcome; never blindly retry a cart mutation.
Private customer workflow
orders(action,{requestId}) accepts list, return-items, prepare and confirm. Return the matching view: orders with owned orders and optional shipments; return-items with eligible items/reasons; confirm with an expiring draft token and review summary; submitted with a nonempty reference only after persistence.
The backend must derive the customer from a verified session, check ownership on every operation and recheck eligibility and quantities. Never trust customer IDs from chat. Confirmation is a distinct request with confirmed:true and an owner-bound token. Repeating that token must return the same receipt instead of submitting again.
With customerKind set to bookings, the same interface uses booking and cancellation-request wording. Your backend must actually integrate the booking system. A request receipt is not approval, cancellation or a refund. Private responses stay out of AI prompts and public chat storage.
Automated catalog ingestion
A server-side integration uses PUT /integration/:site/catalog with a per-tenant bearer key and a body containing revision and products. Generate the monotonic revision before collecting the snapshot. Only a successful complete import replaces the catalog; older revisions cannot overwrite newer ones.
Use stable IDs, public descriptions/specifications and same-store product links. The pilot limit is 2,000 variants / 8 MB and two-decimal currencies. Management credentials can update appearance, approved FAQs and compatibility but cannot grant AI spending or subscription entitlements.
Validation before launch
Test authenticated and anonymous customers, foreign order IDs, removed products, unavailable variants, stale snapshots, expired confirmation tokens, duplicate mutations and uncertain network outcomes. Verify your native cart/account after each action.
A custom connector is an integration contract, not an automatic native app for every site vendor. Askmerio support can help map your backend to the interface; actual platform acceptance testing is still required.