Step 2 — Connect a Real ERP
The accept/decline flow in this PoC is driven by a human clicking a button. In production, this is driven by your ERP, CRM, or payment processor.
The integration pattern:
- Your ERP system captures cash and calls
POST /payment-accept(the App Builder web action URL) with{ orderId: <entity_id> } - App Builder validates the call (bearer token or API key — add auth middleware to
payment-accept) - App Builder calls Commerce REST
cash-received - Commerce invoices and ships the order
No PHP changes required. The REST surface is already there. The App Builder action just needs a secure caller instead of a dashboard button.
Authentication options for the ERP caller:
- Adobe I/O Runtime supports
require-adobe-auth: truefor IMS tokens (if your ERP can get an IMS token) - For non-Adobe systems: add a simple API key check in the
payment-acceptaction (check a header against a secret stored in the action’s env)
Step 3 — Add API Mesh as a Broker Layer
Currently, App Builder calls Commerce REST directly with OAuth 1.0a credentials. For larger deployments, Adobe API Mesh provides a managed gateway layer between App Builder and Commerce.
Benefits:
- Centralized credential management — API Mesh holds the Commerce credentials; App Builder calls API Mesh
- Request transformation — map App Builder payloads to Commerce REST shapes without changing the App Builder action
- Rate limiting and caching — protect Commerce from high-volume event traffic
The pattern:
- Replace
createCommerceClient(params, logger)calls with calls to your API Mesh endpoint - API Mesh handles OAuth signing toward Commerce
Step 4 — Reduce the PHP Footprint
The current PHP module handles five things that must stay in-process (see Split payment POC: architecture and design decisions). As Adobe Commerce’s API surface matures, some of these may become movable:
Potentially movable in the future:
- The store credit REST API is evolving — future versions may support applying credit post-order or to inactive carts
- As more Commerce operations become async-safe, the threshold guard may be movable to a pre-order API Mesh resolver
Not movable (architectural constraints):
- Quote manipulation before
placeOrder()will always require in-process code unless Commerce exposes a clean hook via an API-first extension point - The REST endpoints (
/V1/split-payment/*) are specific to this feature; they live in Commerce because they call Commerce-internal services
Step 5 — Add More Workflow to App Builder
The current PoC does one thing: listen for order placement, then enable accept/decline. Natural extensions:
Fraud scoring before accept:
In payment-orchestrator, after recording cash pending, call a fraud scoring API before the orchestration result is considered final. If the score is above a threshold, auto-decline instead of waiting for operator action.
Notification emails:
When payment-accept succeeds, trigger an email (via Adobe Campaign, SendGrid, or any HTTPS API) notifying the customer that their cash payment was confirmed.
Loyalty point awards:
After cash is confirmed, call a loyalty API to award points. This is pure App Builder — no PHP required.
Timeout handling:
Add a scheduled App Builder action (using cron in app.config.yaml) that scans for orders with split_cash_status = 'pending' older than X days and auto-declines them.
Step 6 — Deploy to Production
The PoC is configured for Stage workspace. Moving to production:
Checklist for production readiness:
- [ ]
DEMO_UI_SECRETset (or demo dashboard replaced with Experience Cloud UI) - [ ]
LOG_LEVEL=warnorerrorin production (notdebug) - [ ]
PAYMENT_THRESHOLDmatches Commerce production config - [ ] Commerce Integration credentials in
.envare for a dedicated production integration (not staging) - [ ] Fastly IP allowlist updated with App Builder production egress IPs (Commerce Cloud)
- [ ] I/O Event registration confirmed in production workspace
Architecture Evolution Diagram
Key References
All resources in this series
Reference resources
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe Commerce Roadmap Webinar - Americas & EMEA
Preview the Adobe Commerce roadmap for agentic commerce and ask the team questions.
Adobe Commerce Roadmap Webinar - Americas & APAC
Preview the Adobe Commerce roadmap for agentic commerce and ask the team questions.