{
  "name": "Vantra - Order Status Webhook Demo",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "vantra-order-status",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "3c9e038b-438a-446b-8ace-51eb08a083f7",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -620,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $json.body ?? $json;\nreturn [{\n  json: {\n    orderId: String(body.orderId ?? '').trim().toUpperCase(),\n    email: String(body.email ?? '').trim().toLowerCase()\n  }\n}];"
      },
      "id": "eb86e70b-bb95-40a1-9dc7-d371c3bffe0c",
      "name": "Normalize Input",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -380,
        0
      ]
    },
    {
      "parameters": {
        "jsCode": "const request = $json;\nconst demoOrders = [\n  { orderId: 'VAN-1001', email: 'ana@example.com', status: 'processing', updatedAt: '2026-07-30' },\n  { orderId: 'VAN-1002', email: 'luis@example.com', status: 'shipped', updatedAt: '2026-07-29' }\n];\nconst order = demoOrders.find(\n  item => item.orderId === request.orderId && item.email === request.email\n);\nif (!order) {\n  return [{\n    json: {\n      ok: false,\n      found: false,\n      message: 'No matching demo order was found. Do not reveal whether an order ID exists without identity verification.'\n    }\n  }];\n}\nreturn [{\n  json: {\n    ok: true,\n    found: true,\n    orderId: order.orderId,\n    status: order.status,\n    updatedAt: order.updatedAt\n  }\n}];"
      },
      "id": "5eabd5f8-7e2b-4984-8953-68dae8a4ec0f",
      "name": "Process Request",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -120,
        0
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ $json }}",
        "options": {
          "responseCode": 200
        }
      },
      "id": "8941eba7-b05f-4bf3-a098-47cff6379ab3",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        140,
        0
      ]
    },
    {
      "parameters": {
        "content": "### Test payload\n```json\n{\n  \"orderId\": \"VAN-1001\",\n  \"email\": \"ana@example.com\"\n}\n```\n\nSend this body to the Webhook test URL.",
        "height": 300,
        "width": 360
      },
      "id": "ea1083b9-924b-4db4-8392-1b0f8ac7b3a0",
      "name": "How to test",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -620,
        -360
      ]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Normalize Input",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Normalize Input": {
      "main": [
        [
          {
            "node": "Process Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Process Request": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "68f2e2a7-6a22-49d3-b793-f357642262b6",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "tags": []
}