Best practice for passing nested arrays from AJO Custom Actions to ACC? | Community
Skip to main content
Level 2
May 3, 2026
Question

Best practice for passing nested arrays from AJO Custom Actions to ACC?

  • May 3, 2026
  • 1 reply
  • 15 views

Hi community,

I’m working on an AJO → ACC integration and running into a limitation with nested arrays in event payloads, such as cart items or receipt line items.

From what I can tell, AJO Custom Action mapping handles flat fields well, but not nested collections cleanly.

The options I’m aware of are:

  • serialize the array upstream and parse it in ACC
  • use middleware to reshape the payload before ACC
  • send an ID and let ACC retrieve the full data separately

My main question:
What approach are teams actually using in production for this, and which one has proven most scalable and maintainable?

If there is a native way to pass nested arrays through AJO Custom Actions directly, I’d love to know.

Thanks.

1 reply

Mayank_Gandhi
Adobe Employee
Adobe Employee
May 4, 2026

@Ankith Menon 

 

For AJO → ACC, the production pattern I'd recommend is:

  1. Use native AJO custom action mapping only if your payload is a single-level array of objects
    Example: ctx.items[] where each item is flat or only contains scalar subfields you can define up front.

  2. Use middleware for truly nested/dynamic collections
    This is the most common and safest production pattern when you have cart lines with child collections, receipt lines with taxes/modifiers, or any payload that must preserve a strict downstream JSON shape.

  3. Use "send ID, fetch full payload in ACC" when the object is large, reused, or mutable
    This is often the most scalable architecture, but only if ACC has a reliable way to resolve the ID in real time.

The key nuance

AJO does support collections in custom action request payloads, including arrays of objects (listObject). So if your use case is just:

Copy

{
"ctx": {
"items": [
{ "sku": "A1", "qty": 2, "price": 10.5 },
{ "sku": "B2", "qty": 1, "price": 5.0 }
]
}
}

that can be done natively in AJO.

Where teams run into trouble is when they need:

  • nested arrays inside those objects
  • root-level array payload
  • a payload whose shape must remain strictly dynamic and deeply nested