{
  "name": "WhatsApp Order Confirmation via GHL (abuusof.com)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "order-paid",
        "options": {}
      },
      "id": "6c4f5d43-4444-4d04-6f04-d4e5f6a7b801",
      "name": "Order paid (Webhook)",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [0, 0],
      "webhookId": "order-paid"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://services.leadconnectorhq.com/contacts/upsert",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer YOUR_PRIVATE_INTEGRATION_TOKEN" },
            { "name": "Version", "value": "2021-07-28" },
            { "name": "Content-Type", "value": "application/json" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ locationId: 'YOUR_LOCATION_ID', email: $json.body.email, phone: $json.body.phone, firstName: $json.body.firstName, tags: ['ordered'] }) }}",
        "options": {}
      },
      "id": "6c4f5d43-4444-4d04-6f04-d4e5f6a7b802",
      "name": "Upsert contact",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://services.leadconnectorhq.com/conversations/messages",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            { "name": "Authorization", "value": "Bearer YOUR_PRIVATE_INTEGRATION_TOKEN" },
            { "name": "Version", "value": "2021-07-28" },
            { "name": "Content-Type", "value": "application/json" }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={{ JSON.stringify({ type: 'WhatsApp', contactId: $json.contact.id, message: 'Thanks ' + ($('Order paid (Webhook)').first().json.body.firstName || '') + '! Your order #' + $('Order paid (Webhook)').first().json.body.orderId + ' is confirmed and being prepared. We\\'ll message you when it\\'s ready.' }) }}",
        "options": {}
      },
      "id": "6c4f5d43-4444-4d04-6f04-d4e5f6a7b803",
      "name": "Send WhatsApp confirmation",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [440, 0]
    }
  ],
  "connections": {
    "Order paid (Webhook)": { "main": [[{ "node": "Upsert contact", "type": "main", "index": 0 }]] },
    "Upsert contact": { "main": [[{ "node": "Send WhatsApp confirmation", "type": "main", "index": 0 }]] }
  },
  "pinData": {},
  "settings": { "executionOrder": "v1" },
  "meta": {
    "notes": "Requires GHL's native WhatsApp integration to be active on the sub-account (the contact must be reachable on WhatsApp; outbound outside the 24h window needs an approved template). POST { email, phone, firstName, orderId } to the webhook. Replace token (scopes: contacts.write, conversations/message.write) + location ID. From abuusof.com/gohighlevel-whatsapp-integration/"
  }
}
