I am building a Custom Order Number app using Adobe App Builder (I/O Events) connected to Adobe Commerce (Magento 2.4.8).
The Goal:
When a customer places an order, I want the App Builder serverless action to intercept the checkout, generate a custom increment_id (e.g. MC-101), and update the order so that Magento’s native Order Confirmation Email gets sent out automatically with the custom increment_id instead of the default 000000001.
The Strict Constraints:
- I cannot add or modify any custom PHP code, modules, or
io_events.xmlon the Magento server. - I cannot simply turn off/disable the global “Sales Emails” setting in the Magento Admin UI. The solution must handle the intercept programmatically.
What I have successfully tried (But failed due to architecture):
- Asynchronous I/O Events: I connected my App Builder Runtime action to both
plugin.magento.sales.api.order_management.placeandobserver.sales_quote_save_aftervia Adobe I/O Events. While both events fire successfully and allow the Runtime action to correctly update the Order Increment ID via the Magento/V1/ordersREST API, the event triggers too late. By the time the Runtime action natively executes, Magento’s internal PHP checkout has already permanently sent the default Order Email containing the old000000001ID.
My Questions:
- Is there any native Adobe I/O mechanism that allows an App Builder Runtime action to natively pause/intercept the Magento checkout synchronously out-of-the-box (without writing custom
io_events.xmlPHP updates)? - If synchronous events are impossible without PHP codebase changes, is there any undocumented REST API endpoint to natively cancel/halt a queued Magento sales email from a Runtime action until the custom ID is safely injected?
If you have any idea or experience implementing this in Magento 2.4.8, please let me know.