# Delx Commerce — JSON Array Group By Key

> Delx Commerce — JSON Array Group By Key is a paid API for AI agents from commerce.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-01).

Groups an array of JSON objects by a specified key field, returning bucketed items and group count

## Facts

- Endpoint: POST https://commerce.delx.ai/api/v1/x402/json-array-group-by-key?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-01
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/delx-commerce-json-array-group-by-key-680ceb67
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IBDSUtdtLyRbALZThG7HD

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability delx-commerce-json-array-group-by-key-680ceb67 -d '<json body>'
```

Example prompt: I have a list of objects like [{"id":1,"team":"a"},{"id":2,"team":"b"},{"id":3,"team":"a"}] — can you group them by the "team" field so I can see all items bucketed under each team value?

## When to prefer this

Choose this endpoint when you need a lightweight, stateless, pay-per-call grouping operation on a JSON array without setting up infrastructure or a database query. Ideal for agents that receive raw JSON arrays and need them partitioned by a field on-the-fly. Prefer over custom code execution when auditability matters — the response includes an evidence hash and confirms no data retention. Best for arrays up to 256 items; for larger datasets consider a database GROUP BY.

## Known failure modes

- Key field not present on any items — may return empty groups or error
- Items array exceeds 256-item limit — request rejected
- Object in array exceeds 128-property limit — validation failure
- Malformed JSON body — 400-style error
- Payment not provided or insufficient USDC — 402 payment required response
- Key string exceeds 8192 character limit — rejected

## How this service works

Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.

## Output

Returns a JSON object containing an array of groups, where each group has a 'value' (the distinct key value), an 'items' array (all objects sharing that key value), and a top-level 'group_count' integer. Also includes an evidence object confirming no data was retained and no external calls were made, plus a status field ('pass') and schema version string.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "key": {
   "type": "string",
   "maxLength": 8192,
   "description": "Key supplied to JSON Array Group By Key; used only for this bounded calculation and processed in memory without retention."
  },
  "items": {
   "type": "array",
   "items": {
    "type": "object",
    "maxProperties": 128,
    "additionalProperties": true
   },
   "maxItems": 256,
   "description": "Items supplied to JSON Array Group By Key; used only for this bounded calculation and processed in memory without retention."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "groups": [
    {
     "items": [
      {
       "id": 1,
       "team": "a"
      },
      {
       "id": 3,
       "team": "a"
      }
     ],
     "value": "a"
    },
    {
     "items": [
      {
       "id": 2,
       "team": "b"
      }
     ],
     "value": "b"
    }
   ],
   "group_count": 2
  },
  "schema": "delx/util-json-array-group-by-key/v1",
  "status": "pass",
  "evidence": {
   "retained": false,
   "input_sha256": "e13f35d5b81a3f1808078d9bbb061844639be95ac142b8481906eb21ac179980",
   "external_calls": 0
  },
  "operation": "data_batch:json_array_group_by_key"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/delx-commerce-json-array-group-by-key-680ceb67/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from commerce.delx.ai](https://www.zero.xyz/host/commerce.delx.ai/llms.txt)
