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 the cash-received endpoint)
    • Magento_Sales::cancel (required for the cash-decline endpoint)
    • 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:

ValueEnvironment variable
Consumer KeyCOMMERCE_CONSUMER_KEY
Consumer SecretCOMMERCE_CONSUMER_SECRET
Access TokenCOMMERCE_ACCESS_TOKEN
Access Token SecretCOMMERCE_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

# Required versions
node --version    # 18.x or later
npm --version     # any recent version

# Adobe I/O CLI
npm install -g @adobe/aio-cli

# Authenticate
aio login

# Select your project and workspace
aio app use
# Confirm the org, project, and workspace shown are correct

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), not increment_id (for example 000000042), 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:

node scripts/simulate-split-payment.mjs show 42

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: CheckoutPlugin throws 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 (default 100 in etc/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 login is complete and the correct workspace is selected with aio app use
  • [ ] Node.js 18 or later is installed and the aio CLI is installed
  • [ ] .env files are prepared per Split payment POC: environment variables reference (and your source package, if you use one)

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 event

Ask AI

Not sure where to start?
Ask me anything about Adobe products.

Type your question or pick a suggestion below.

Use of this AI chatbot is subject to Adobe's Privacy Policy. Don't share sensitive data. AI responses are not your Content, may be inaccurate, and any offers provided are non-binding. Generative AI Terms.

Ask AI