2b. Enable store credit
Stores > Configuration > Customers > Customer Configuration > Store Credit Options
- Enable Store Credit Functionality: Yes
2c. Add store credit to your test customer
Customers > All Customers > [your test customer] > Store Credit > Update Balance
Add at least $50 in store credit. You will test with an order under $100 total.
2d. Create the Commerce integration
System > Integrations > Add New Integration
-
Name:
Split Payment App Builder(or any name you prefer) -
On the API tab, grant at minimum:
Magento_Sales::actions(required for thecash-receivedendpoint)Magento_Sales::cancel(required for thecash-declineendpoint)- Quote or cart management (full or a relevant subset)
- Customer balance (full or a relevant subset)
Select Save, then Activate.
Copy all four values; they are only shown once:
| Value | Environment variable |
|---|---|
| Consumer Key | COMMERCE_CONSUMER_KEY |
| Consumer Secret | COMMERCE_CONSUMER_SECRET |
| Access Token | COMMERCE_ACCESS_TOKEN |
| Access Token Secret | COMMERCE_ACCESS_TOKEN_SECRET |
Store these values securely. You need them in every App Builder .env file.
3. Adobe Developer Console and App Builder
- Access to an Adobe Developer Console organization
- An App Builder project (new or one you reuse)
- A workspace configured; the prompts assume Stage
- Adobe I/O Events added as a service to the workspace
- Commerce connected as an event provider for the workspace
The event code used in the proof of concept is: com.adobe.commerce.observer.sales_order_place_before
If you have not connected Commerce as an event provider, see Configure Commerce to emit events to Adobe I/O in the Commerce Extensibility guide.
4. Local development environment
5. Two project directories to know
This tutorial uses two separate directory roots. Keep them separate.
Commerce project root (your Magento git repository):
<commerce-root>/
└── app/code/Client/SplitPayment/ ← Module goes here
App Builder project root (the split-payment-orchestrator folder from the source package, or a new project you create):
split-payment-orchestrator/
├── app.config.yaml
├── package.json
├── .env ← Copy from .env.example, then fill in
└── actions/
6. entity_id compared to increment_id
Always use
entity_id(the numeric database ID), notincrement_id(for example000000042), in REST calls.
Find entity_id from the Commerce Admin order URL:
/admin/sales/order/view/order_id/42/ → entity_id = 42
Or from the simulation script:
7. The $100 threshold
The split payment UI and threshold guard target orders $100.00 or less. The flow behaves as follows:
- At or below $100: the split payment UI appears; the customer can set a cash plus store credit split
- Above $100:
CheckoutPluginthrows an error at the payment step
To test, build a cart whose subtotal, shipping, and tax are less than or equal to $100 (for example, a product under $90 so shipping and tax still fit under the cap).
The threshold is stored in:
- Commerce config:
split_payment/general/threshold(default100inetc/config.xml) - App Builder environment:
PAYMENT_THRESHOLD=100(must match Commerce)
8. Fastly (Commerce Cloud only)
App Builder actions call Commerce over REST (/rest/V1/split-payment/orders/...). If your Commerce Cloud project uses Fastly with IP allowlisting, the App Builder runtime egress IP addresses must be allowlisted.
How to check: Run the simulation script first (direct curl with OAuth signing). If that works but the App Builder action returns 403, Fastly is likely blocking the request.
Use Adobe’s current documentation for App Builder egress IP ranges and add them to your Fastly configuration as needed.
Verification checklist
Before you start the build prompts, confirm the following:
- [ ] Commerce version is 2.4.5 or later
- [ ] I/O eventing is enabled (Commerce Cloud) and deployed
- [ ] Cash on delivery is enabled with the title set exactly to
Cash - [ ] Store credit is enabled
- [ ] The test customer has at least $50 store credit
- [ ] The Commerce integration is created and activated, and all four OAuth values are saved
- [ ] The App Builder project has the I/O Events service and the Commerce event provider configured
- [ ]
aio loginis complete and the correct workspace is selected withaio app use - [ ] Node.js 18 or later is installed and the
aioCLI is installed - [ ]
.envfiles are prepared per Split payment POC: environment variables reference (and your source package, if you use one)
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.