How JSON Flows Through Automations
Understanding Webhook JSON
When a service like Stripe, Shopify, or GitHub triggers a webhook, it sends a JSON payload to your URL:
Stripe payment webhook payload (simplified)json
1{2 "id": "evt_1abc123",3 "type": "payment_intent.succeeded",4 "data": {5 "object": {6 "id": "pi_xyz789",7 "amount": 2999,8 "currency": "usd",9 "customer": "cus_abc",10 "metadata": {11 "order_id": "ORD-1234"12 },13 "receipt_email": "[email protected]"14 }15 }16}Tip
The payment amount
2999 means $29.99 — Stripe stores amounts in the smallest currency unit (cents). This is a common pattern in payment and e-commerce APIs. Always check the API docs for how numbers are formatted.Key Concepts for Non-Developers
| JSON Concept | What It Means | Example |
|---|---|---|
| Object { } | A group of labeled values | {"name": "Alice", "email": "[email protected]"} |
| Array [ ] | A list of items | ["email", "sms", "push"] |
| Nested object | An object inside another object | {"customer": {"name": "Alice"}} |
| Key | The label/name (always in quotes) | "email" in {"email": "[email protected]"} |
| Value | The data (text, number, true/false, null) | "[email protected]" or 2999 or true |
| null | Intentionally empty / no value | "bio": null means bio is not set |
Zapier — Working with JSON
Incoming Webhooks
Zapier's “Webhooks by Zapier” trigger automatically parses JSON and shows each field as a selectable value in subsequent steps:
- Create a new Zap with trigger Webhooks by Zapier → Catch Hook
- Copy the webhook URL Zapier gives you
- Send a test JSON payload to that URL (from your service or manually)
- Click Test trigger — Zapier shows all parsed fields
- Use those fields in your action step (e.g., “Send Email” with the customer email)
Handling Nested Data in Zapier
Accessing nested valuestext
1Given this webhook JSON:2{3 "customer": {4 "name": "Alice",5 "addresses": [6 { "city": "New York", "zip": "10001" }7 ]8 }9}1011In Zapier field mapping:12 customer__name → "Alice"13 customer__addresses → (shows as array — use Formatter to extract)1415In Code by Zapier (JavaScript):16 const data = JSON.parse(inputData.rawBody);17 return { city: data.customer.addresses[0].city }; // "New York"n8n — Full JSON Control
n8n expression examplesjson
1// Access a simple field2{{ $json.customer.email }}34// Access array item5{{ $json.data.items[0].name }}67// Conditional value8{{ $json.status === 'paid' ? 'Complete' : 'Pending' }}910// Format a price (cents to dollars)11{{ ($json.amount / 100).toFixed(2) }}Tip
n8n shows you the raw JSON at every step. Click any node's output to see the exact JSON structure. Use this to build your expressions — you can see exactly which keys exist and what their values are.
Make (Integromat) — Mapping JSON
Make uses a visual mapper to connect JSON fields between modules:
- 1.Add a Webhooks → Custom webhook trigger
- 2.Send a test payload — Make auto-detects the JSON structure
- 3.Click the data structure button to see all available fields
- 4.Use the Set Variable module for transformations
- 5.For arrays, use an Iterator module to loop through items
Real-World Webhook Examples
Shopify Order Webhook
Shopify order created (simplified)json
1{2 "id": 5678,3 "email": "[email protected]",4 "total_price": "49.99",5 "currency": "USD",6 "line_items": [7 { "title": "Blue T-Shirt", "quantity": 2, "price": "19.99" },8 { "title": "Cap", "quantity": 1, "price": "9.99" }9 ],10 "shipping_address": {11 "city": "New York",12 "zip": "10001",13 "country": "US"14 }15}GitHub Push Webhook
GitHub push event (simplified)json
1{2 "ref": "refs/heads/main",3 "repository": {4 "name": "my-project",5 "full_name": "alice/my-project"6 },7 "commits": [8 {9 "message": "Fix login bug",10 "author": { "name": "Alice", "email": "[email protected]" },11 "timestamp": "2026-04-02T14:30:00Z"12 }13 ]14}Debugging Failed Webhooks
| Symptom | Likely Cause | Fix |
|---|---|---|
| Webhook not received | Wrong URL or firewall blocking | Check URL, test with a simple POST tool |
| "Invalid JSON" error | Malformed payload or wrong Content-Type | Ensure Content-Type: application/json |
| Fields showing as empty | JSON structure changed (fields renamed) | Re-test webhook trigger to update field mapping |
| Array data missing | Tool does not auto-expand arrays | Use Iterator (Make) or Code step (Zapier) |
| Numbers wrong | Amount in cents, not dollars | Divide by 100 in a Formatter/Code step |
Try It — Validate a Webhook Payload
Try It Yourself
A typical webhook JSON payload — validate before using in your automation
Try These Tools
Continue Learning
Frequently Asked Questions
What is a webhook payload?
A webhook payload is the JSON data that a service (like Stripe, Shopify, or GitHub) sends to your URL when an event happens. For example, when a customer completes a purchase, Shopify sends a JSON object containing the order details, customer info, and line items to your webhook URL.
How do I use JSON in Zapier?
Zapier automatically parses incoming webhook JSON into individual fields you can map. For nested data, use dot notation in the Formatter step (e.g., "customer.email"). For complex transformations, use the Code by Zapier step with JavaScript to reshape the JSON before passing it to the next step.
What is the difference between n8n and Zapier for JSON?
n8n gives you full access to the raw JSON and lets you transform it with JavaScript expressions, JSON Path, or built-in nodes like Set, Merge, and Split. Zapier abstracts JSON away and shows you field names instead. n8n is more powerful for complex JSON transformations; Zapier is easier for simple field mapping.
Why is my webhook not working?
Common causes: (1) The webhook URL is wrong or unreachable, (2) The receiving tool expects a different Content-Type header, (3) The JSON structure does not match what your automation expects (a field was renamed or nested differently), (4) Authentication headers are missing. Check the webhook delivery logs in the sending service first.
How do I extract a value from nested JSON in Zapier?
For simple nesting, Zapier flattens the JSON automatically and you can select "customer email" from the dropdown. For deeper nesting (arrays, nested arrays), use the Code by Zapier step: inputData.body = JSON.parse(inputData.rawBody); return { email: inputData.body.customer.addresses[0].email };