JSON All-in-OneJSON All-in-One
Site navigation
English

JQ / API response filter

Filter paid orders from a JSON API response

Start with a synthetic orders response, run one JQ filter, and confirm the paid-order JSON result before adapting the filter to your API data.

Reproducible trace

Keep only paid orders and return the order id, total, and customer tier.

Input / agents/orders-api-response.json
{
  "orders": [
    {"id": "ord_1001", "status": "paid", "total": 128.4, "customer": {"tier": "pro"}},
    {"id": "ord_1002", "status": "draft", "total": 64, "customer": {"tier": "free"}},
    {"id": "ord_1003", "status": "paid", "total": 42.5, "customer": {"tier": "free"}}
  ]
}
Operation / JQ filter
.orders | map(select(.status == "paid") | {id, total, tier: .customer.tier})
Expected output / paid-orders.expected.json
[
  {"id": "ord_1001", "total": 128.4, "tier": "pro"},
  {"id": "ord_1003", "total": 42.5, "tier": "free"}
]

How to use this workflow

  1. Download or copy the input. The fixture is synthetic and designed for this exact operation.
  2. Run the operation. Use the linked JSON All-in-One tool, or reproduce the operation in your own environment when the syntax matches.
  3. Compare the expected output. The expected result is the acceptance target for this fixture, not a general product guarantee.

Notes and limits

  • The fixture is synthetic and contains example.test email addresses.
  • The result checks the shape of this operation; it is not a benchmark or a ranking claim.

For broader examples, return to the JSON task workflows hub or browse all JSON tools.