New in 2.0
- API keys: create and delete them in the admin; a key is shown once and only its hash is kept. A key can be tied to websites. A switch makes a key compulsory.
- CORS: list the websites whose pages may call the API.
- Caching: public answers carry Cache-Control and ETag, so an unchanged answer costs a 304.
- MCP server (AI agents): tools shop_info, list_categories, search_products, get_product, get_reviews, price_cart and create_checkout_link. Streamable HTTP, one JSON answer per POST. The agent cannot order or pay: the checkout link opens your own checkout for the buyer. The key may be sent as "Authorization: Bearer mk_...". Switch it off in the settings if you do not want it.
Calls (json)
info, layout, categories, products, product, reviews, review, register, login, logout, me, orders, order, wishlist, wish, cart, checkout, device, mcp. Cart prices come from your shop's own cart, and checkout hands off to your own checkout page, so your payment and shipping methods keep working. Push messages are sent from the admin page.
Security
Passwords are checked by the shop; repeated wrong logins are held back; only hashes of tokens and keys are stored; customers see only their own orders; disabled products are never shown.
UPDATING FROM 1.x
Upload the new zip over the old one, then open the settings page once (it creates the key table). Settings and app logins stay.
For OpenCart 2.3, 3.0, 4.0 and 4.1.
How it was tested
Installed through the real admin installer on all four versions and exercised over HTTP (177 / 177 / 172 / 174 checks on 4.1 / 4.0 / 3.0 / 2.3), plus a browser check of the key screen (8 checks on each). The MCP server was tested with hand-written protocol requests, not yet with a live AI assistant. Push was tested against a stand-in service.
Not included
A ready-made Next.js front end; payment inside the API.