Skip to main content
Comprehensive real-world examples demonstrating JSON Path mapping in common business scenarios.

E-commerce Order Processing

Scenario: Process New Order

You receive an order from an API and need to transform it for your system.
{
  "get_order": {
    "orderId": "ORD-2025-001",
    "customer": {
      "id": "CUST-123",
      "firstName": "Sarah",
      "lastName": "Chen",
      "email": "sarah.chen@example.com",
      "phone": "+1-555-0123"
    },
    "items": [
      {
        "sku": "WIDGET-001",
        "name": "Premium Widget",
        "quantity": 2,
        "price": 49.99,
        "discount": 0.1
      },
      {
        "sku": "GADGET-005",
        "name": "Smart Gadget",
        "quantity": 1,
        "price": 129.99,
        "discount": 0
      }
    ],
    "shipping": {
      "method": "express",
      "address": {
        "street": "123 Main St",
        "city": "San Francisco",
        "state": "CA",
        "zip": "94105"
      },
      "cost": 12.50
    },
    "payment": {
      "method": "credit_card",
      "last4": "4242",
      "status": "authorized"
    },
    "timestamps": {
      "created": "2025-10-08T10:30:00Z",
      "updated": "2025-10-08T10:35:00Z"
    }
  }
}
Key Techniques Used:
  • Pipe operator for full name concatenation
  • Pipe operator for formatted address
  • Array wildcard [*] to get all product names
  • Filter ?(@.discount>0) to find discounted items
  • .length to count items
  • Array indexing [0] for first item

User Management & Authorization

Scenario: User Profile Enrichment

Combine user data from multiple API calls to create a complete profile.
{
  "get_user": {
    "userId": "USER-456",
    "username": "jsmith",
    "email": "john.smith@company.com",
    "status": "active",
    "createdAt": "2024-01-15T08:00:00Z"
  },
  "get_permissions": {
    "roles": ["editor", "reviewer"],
    "permissions": [
      {"resource": "articles", "actions": ["read", "write", "publish"]},
      {"resource": "comments", "actions": ["read", "moderate"]},
      {"resource": "analytics", "actions": ["read"]}
    ],
    "restrictions": {
      "maxFileSize": 10485760,
      "allowedFileTypes": ["jpg", "png", "pdf", "docx"]
    }
  },
  "get_activity": {
    "lastLogin": "2025-10-08T09:15:00Z",
    "loginCount": 247,
    "recentActions": [
      {"action": "published_article", "timestamp": "2025-10-08T09:20:00Z", "articleId": "ART-123"},
      {"action": "edited_article", "timestamp": "2025-10-08T08:45:00Z", "articleId": "ART-122"},
      {"action": "moderated_comment", "timestamp": "2025-10-07T16:30:00Z", "commentId": "COM-789"}
    ]
  }
}
Advanced Pattern: This example shows how to combine data from three different API calls (get_user, get_permissions, get_activity) into a single enriched user profile.

CRM & Sales Pipeline

Scenario: Lead Scoring & Qualification

Score leads based on activity, engagement, and company data.
{
  "get_lead": {
    "leadId": "LEAD-789",
    "contact": {
      "name": "Michael Rodriguez",
      "title": "VP of Engineering",
      "email": "m.rodriguez@techcorp.com",
      "phone": "+1-555-0199"
    },
    "company": {
      "name": "TechCorp Solutions",
      "industry": "Software",
      "size": "500-1000",
      "revenue": "50M-100M",
      "website": "https://techcorp.com"
    },
    "engagement": {
      "score": 85,
      "activities": [
        {"type": "email_open", "count": 12, "lastDate": "2025-10-08"},
        {"type": "link_click", "count": 5, "lastDate": "2025-10-07"},
        {"type": "form_submit", "count": 2, "lastDate": "2025-10-06"},
        {"type": "demo_request", "count": 1, "lastDate": "2025-10-05"}
      ],
      "pageViews": [
        {"page": "pricing", "visits": 8},
        {"page": "features", "visits": 5},
        {"page": "case-studies", "visits": 3}
      ]
    },
    "sourceInfo": {
      "channel": "organic_search",
      "campaign": "Q4_Enterprise",
      "firstTouch": "2025-09-15T14:30:00Z"
    }
  }
}
Scoring Logic: Use filters to identify hot leads (score>=80), demo requests, and recent activity to prioritize sales follow-up.

Inventory Management

Scenario: Stock Level Monitoring

Track inventory across multiple warehouses and trigger reorder alerts.
{
  "get_inventory": {
    "productId": "PROD-2025",
    "sku": "LAPTOP-PRO-15",
    "name": "Professional Laptop 15\"",
    "category": "Electronics",
    "warehouses": [
      {
        "id": "WH-EAST",
        "location": "New York",
        "quantity": 45,
        "reserved": 12,
        "available": 33,
        "reorderPoint": 25,
        "reorderQuantity": 50
      },
      {
        "id": "WH-WEST",
        "location": "Los Angeles",
        "quantity": 18,
        "reserved": 5,
        "available": 13,
        "reorderPoint": 20,
        "reorderQuantity": 50
      },
      {
        "id": "WH-CENTRAL",
        "location": "Chicago",
        "quantity": 62,
        "reserved": 8,
        "available": 54,
        "reorderPoint": 30,
        "reorderQuantity": 75
      }
    ],
    "supplier": {
      "name": "TechSupply Co",
      "leadTime": 14,
      "minOrderQuantity": 25
    },
    "pricing": {
      "cost": 850,
      "retail": 1299,
      "margin": 0.346
    }
  }
}
Smart Filtering: Identify warehouses below reorder points, critical stock levels, or high inventory for redistribution decisions.

Customer Support Ticket Routing

Scenario: Intelligent Ticket Assignment

Route support tickets based on priority, customer tier, and agent expertise.
{
  "get_ticket": {
    "ticketId": "TKT-10234",
    "subject": "API Integration Issues",
    "description": "Getting 429 rate limit errors on webhook endpoints",
    "priority": "high",
    "category": "technical",
    "tags": ["api", "webhooks", "rate-limiting"],
    "customer": {
      "id": "CUST-5678",
      "name": "Acme Corp",
      "tier": "enterprise",
      "plan": "professional",
      "accountManager": "AM-123"
    },
    "reportedBy": {
      "name": "Tom Anderson",
      "email": "tom@acme.com",
      "role": "CTO"
    },
    "timestamps": {
      "created": "2025-10-08T10:15:00Z",
      "firstResponse": null,
      "resolved": null
    },
    "metadata": {
      "affectedUsers": 45,
      "businessImpact": "high",
      "slaDeadline": "2025-10-08T14:15:00Z"
    }
  },
  "get_team": {
    "agents": [
      {
        "id": "AGENT-001",
        "name": "Sarah Kim",
        "expertise": ["api", "integrations", "webhooks"],
        "currentLoad": 3,
        "maxCapacity": 5,
        "available": true
      },
      {
        "id": "AGENT-002",
        "name": "Mike Johnson",
        "expertise": ["billing", "accounts"],
        "currentLoad": 4,
        "maxCapacity": 5,
        "available": true
      },
      {
        "id": "AGENT-003",
        "name": "Lisa Chen",
        "expertise": ["api", "infrastructure", "performance"],
        "currentLoad": 2,
        "maxCapacity": 5,
        "available": true
      }
    ]
  }
}
Intelligent Routing: This example demonstrates complex filtering to find the best-matched agent based on expertise (api AND webhooks), availability, and current workload.

Marketing Campaign Analysis

Scenario: Multi-Channel Campaign Performance

Analyze campaign performance across email, social, and paid channels.
{
  "get_campaign": {
    "campaignId": "CAMP-Q4-2025",
    "name": "Q4 Product Launch",
    "startDate": "2025-10-01",
    "endDate": "2025-12-31",
    "budget": 50000,
    "channels": [
      {
        "name": "email",
        "sent": 25000,
        "delivered": 24500,
        "opened": 9800,
        "clicked": 2450,
        "converted": 245,
        "revenue": 122500,
        "cost": 5000
      },
      {
        "name": "social",
        "impressions": 500000,
        "engagement": 15000,
        "clicks": 7500,
        "converted": 150,
        "revenue": 75000,
        "cost": 12000
      },
      {
        "name": "paid_search",
        "impressions": 750000,
        "clicks": 22500,
        "converted": 675,
        "revenue": 337500,
        "cost": 18000
      }
    ],
    "topPages": [
      {"url": "/product", "visits": 45000, "conversionRate": 0.025},
      {"url": "/pricing", "visits": 32000, "conversionRate": 0.045},
      {"url": "/demo", "visits": 18000, "conversionRate": 0.085}
    ]
  }
}
{
  "campaignName": "Campaign: |$.get_campaign.name| (|$.get_campaign.campaignId|)",
  "campaignPeriod": "$.get_campaign.startDate| to |$.get_campaign.endDate",
  "totalBudget": "Budget: $|$.get_campaign.budget",
  "channelNames": "$.get_campaign.channels[*].name",
  "emailPerformance": "Emails: |$.get_campaign.channels[?(@.name==='email')].sent| sent, |$.get_campaign.channels[?(@.name==='email')].opened| opened",
  "emailConversions": "$.get_campaign.channels[?(@.name==='email')].converted",
  "emailRevenue": "$.get_campaign.channels[?(@.name==='email')].revenue",
  "emailROI": "$.get_campaign.channels[?(@.name==='email')].revenue",
  "topPerformer": "$.get_campaign.channels[?(@.revenue===@max(@..revenue))].name",
  "highROIChannels": "$.get_campaign.channels[?(@.revenue>@.cost*5)]",
  "totalConversions": "$.get_campaign.channels[*].converted",
  "totalRevenue": "$.get_campaign.channels[*].revenue",
  "totalSpend": "$.get_campaign.channels[*].cost",
  "bestConvertingPage": "$.get_campaign.topPages[?(@.conversionRate===@max(@..conversionRate))].url",
  "highTrafficPages": "$.get_campaign.topPages[?(@.visits>=30000)]",
  "demoPageStats": "$.get_campaign.topPages[?(@.url==='/demo')]"
}
{
  "campaignName": "Campaign: Q4 Product Launch (CAMP-Q4-2025)",
  "campaignPeriod": "2025-10-01 to 2025-12-31",
  "totalBudget": "Budget: $50000",
  "channelNames": ["email", "social", "paid_search"],
  "emailPerformance": "Emails: 25000 sent, 9800 opened",
  "emailConversions": [245],
  "emailRevenue": [122500],
  "emailROI": [122500],
  "topPerformer": ["paid_search"],
  "highROIChannels": [
    {
      "name": "email",
      "sent": 25000,
      "delivered": 24500,
      "opened": 9800,
      "clicked": 2450,
      "converted": 245,
      "revenue": 122500,
      "cost": 5000
    },
    {
      "name": "paid_search",
      "impressions": 750000,
      "clicks": 22500,
      "converted": 675,
      "revenue": 337500,
      "cost": 18000
    }
  ],
  "totalConversions": [245, 150, 675],
  "totalRevenue": [122500, 75000, 337500],
  "totalSpend": [5000, 12000, 18000],
  "bestConvertingPage": ["/demo"],
  "highTrafficPages": [
    {"url": "/product", "visits": 45000, "conversionRate": 0.025},
    {"url": "/pricing", "visits": 32000, "conversionRate": 0.045}
  ],
  "demoPageStats": [
    {"url": "/demo", "visits": 18000, "conversionRate": 0.085}
  ]
}
Performance Analysis: Use filters to identify top-performing channels (revenue===@max), high-ROI channels (revenue>cost*5), and best converting pages.

Healthcare Patient Management

Scenario: Patient Appointment Coordination

Coordinate patient appointments across multiple departments and providers.
{
  "get_patient": {
    "patientId": "PAT-9876",
    "firstName": "Emma",
    "lastName": "Wilson",
    "dob": "1985-03-15",
    "mrn": "MRN-123456",
    "insurance": {
      "provider": "HealthCare Plus",
      "policyNumber": "HCP-9876543",
      "groupNumber": "GRP-001",
      "status": "active"
    },
    "primaryCare": {
      "provider": "Dr. James Chen",
      "providerId": "PROV-456",
      "department": "Internal Medicine"
    },
    "conditions": [
      {"name": "Hypertension", "status": "controlled"},
      {"name": "Type 2 Diabetes", "status": "managed"}
    ],
    "allergies": ["Penicillin", "Latex"],
    "medications": [
      {"name": "Lisinopril", "dosage": "10mg", "frequency": "daily"},
      {"name": "Metformin", "dosage": "500mg", "frequency": "twice daily"}
    ]
  },
  "get_appointments": {
    "upcoming": [
      {
        "appointmentId": "APT-001",
        "date": "2025-10-15",
        "time": "09:00",
        "provider": "Dr. James Chen",
        "department": "Internal Medicine",
        "type": "follow-up",
        "status": "confirmed"
      },
      {
        "appointmentId": "APT-002",
        "date": "2025-10-22",
        "time": "14:30",
        "provider": "Dr. Sarah Martinez",
        "department": "Endocrinology",
        "type": "consultation",
        "status": "pending"
      },
      {
        "appointmentId": "APT-003",
        "date": "2025-11-05",
        "time": "10:00",
        "provider": "Lab Services",
        "department": "Laboratory",
        "type": "lab_work",
        "status": "scheduled"
      }
    ],
    "past": [
      {
        "appointmentId": "APT-000",
        "date": "2025-09-20",
        "provider": "Dr. James Chen",
        "notes": "Blood pressure stable, continue current medications"
      }
    ]
  }
}
HIPAA Compliance: When working with healthcare data, ensure all JSON path mappings comply with privacy regulations. Never log or expose PHI in non-compliant systems.

Financial Transaction Processing

Scenario: Payment Reconciliation

Match payments across multiple payment processors and accounts.
{
  "get_transactions": {
    "accountId": "ACC-2025-456",
    "period": "2025-10",
    "transactions": [
      {
        "id": "TXN-001",
        "date": "2025-10-08",
        "type": "payment_received",
        "amount": 1299.00,
        "currency": "USD",
        "method": "credit_card",
        "processor": "Stripe",
        "processorId": "ch_3Abc123",
        "customer": "CUST-789",
        "status": "completed",
        "fees": 39.57
      },
      {
        "id": "TXN-002",
        "date": "2025-10-08",
        "type": "refund_issued",
        "amount": -99.00,
        "currency": "USD",
        "method": "credit_card",
        "processor": "Stripe",
        "processorId": "re_3Def456",
        "customer": "CUST-456",
        "status": "completed",
        "fees": -2.97
      },
      {
        "id": "TXN-003",
        "date": "2025-10-07",
        "type": "payment_received",
        "amount": 4999.00,
        "currency": "USD",
        "method": "wire_transfer",
        "processor": "Bank",
        "processorId": "WIRE-789",
        "customer": "CUST-123",
        "status": "pending",
        "fees": 25.00
      },
      {
        "id": "TXN-004",
        "date": "2025-10-07",
        "type": "payment_received",
        "amount": 299.00,
        "currency": "USD",
        "method": "paypal",
        "processor": "PayPal",
        "processorId": "PAY-456789",
        "customer": "CUST-321",
        "status": "completed",
        "fees": 8.97
      },
      {
        "id": "TXN-005",
        "date": "2025-10-06",
        "type": "chargeback",
        "amount": -1299.00,
        "currency": "USD",
        "method": "credit_card",
        "processor": "Stripe",
        "processorId": "cb_3Ghi789",
        "customer": "CUST-555",
        "status": "under_review",
        "fees": 15.00
      }
    ]
  }
}
Reconciliation Tips: Use filters to separate transaction types, identify pending items, flag disputes, and calculate totals by processor for financial reporting.

Next Steps

Reference Guide

Complete syntax tables and troubleshooting

Advanced Techniques

Performance optimization and best practices

Filters & Expressions

Review filtering techniques

Basic Syntax

Return to fundamentals
Practice Makes Perfect: Try recreating these examples in your own flows. Start with simple mappings and gradually add filters and advanced patterns.