{
  "nodes": [
    {
      "id": "74a81d54-6cc9-4c17-88fe-aca27d491b73",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        640,
        40
      ],
      "parameters": {
        "path": "paypal-NVP-SOAP-Webhook",
        "options": {},
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "59caade5-a67d-4d22-822c-bec8bf9baf69",
      "name": "Event Capture Type",
      "type": "n8n-nodes-base.switch",
      "position": [
        1160,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "Payment",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "68917137-6042-4e47-9432-d006dca17872",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json.body.event_type }}",
                    "rightValue": "=PAYMENT.CAPTURE.COMPLETED"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "cba1ef91-2e34-4bd5-9972-565296137851",
      "name": "Get Order Details",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1360,
        0
      ],
      "parameters": {
        "url": "=https://api.paypal.com/v2/checkout/orders/{{ $json.body.resource.supplementary_data.related_ids.order_id }}",
        "options": {},
        "authentication": "genericCredentialType",
        "genericAuthType": "oAuth2Api"
      },
      "typeVersion": 4.2
    },
    {
      "id": "ecab1f76-8c53-459c-8c5f-26356ec9e675",
      "name": "Email Data",
      "type": "n8n-nodes-base.set",
      "position": [
        1540,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "8d56c774-9adb-4981-9295-6f6f2ec59749",
              "name": "First Name",
              "type": "string",
              "value": "={{ $json.payment_source.paypal.name.given_name }}"
            },
            {
              "id": "0f6136eb-f5e1-47b9-a829-f42dff2b7c9e",
              "name": "Last Name",
              "type": "string",
              "value": "={{ $json.payment_source.paypal.name.surname }}"
            },
            {
              "id": "f4da90dc-b4d5-4951-91b8-2ef4b2bf870d",
              "name": "EmaiID",
              "type": "string",
              "value": "={{ $json.payment_source.paypal.email_address }}"
            },
            {
              "id": "f7a31ec1-4305-4df0-8791-0f59a04f0c7e",
              "name": "Product Purchased",
              "type": "string",
              "value": "={{ $json.purchase_units[0].items[0].name }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "211fbba0-67b1-4ece-b6a7-79b7c5cd0f7a",
      "name": "Wait",
      "type": "n8n-nodes-base.wait",
      "position": [
        920,
        40
      ],
      "parameters": {},
      "typeVersion": 1.1
    },
    {
      "id": "c4b9bcab-42ab-4fca-b064-ab262cdcf05e",
      "name": "getJSON",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2060,
        0
      ],
      "parameters": {
        "url": "https://your-json-template-in-ase-you-are-sellig.json",
        "options": {}
      },
      "typeVersion": 4.2
    },
    {
      "id": "b92f72a4-25c2-4c6d-9cc1-366cd1dc2dd1",
      "name": "Event Capture Type1",
      "type": "n8n-nodes-base.switch",
      "position": [
        1760,
        0
      ],
      "parameters": {
        "rules": {
          "values": [
            {
              "outputKey": "SocialMedia",
              "conditions": {
                "options": {
                  "version": 2,
                  "leftValue": "",
                  "caseSensitive": true,
                  "typeValidation": "strict"
                },
                "combinator": "and",
                "conditions": [
                  {
                    "id": "68917137-6042-4e47-9432-d006dca17872",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "leftValue": "={{ $json[\"Product Purchased\"] }}",
                    "rightValue": "=AI-Powered Social Media Content Generator & Publisher"
                  }
                ]
              },
              "renameOutput": true
            }
          ]
        },
        "options": {}
      },
      "typeVersion": 3.2
    },
    {
      "id": "10f88f6c-1062-48c5-8a90-116c18954d95",
      "name": "Conver to File",
      "type": "n8n-nodes-base.code",
      "position": [
        2280,
        0
      ],
      "parameters": {
        "jsCode": "const content = JSON.stringify($json, null, 2); // Pretty-print JSON\n\nreturn [\n  {\n    binary: {\n      data: {\n        data: Buffer.from(content).toString('base64'),\n        mimeType: 'application/json',\n        fileName: 'data.json'\n      }\n    }\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "4c95905c-0c77-488a-8fb3-e8f4f4b83e54",
      "name": "Send Email",
      "type": "n8n-nodes-base.emailSend",
      "position": [
        2600,
        0
      ],
      "parameters": {
        "html": "=<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"UTF-8\">\n  <title>{{ $('Event Capture Type1').item.json['Product Purchased'] }}</title>\n</head>\n<body style=\"margin:0; padding:0; font-family: Arial, sans-serif; background-color: #f9f9f9;\">\n  <table align=\"center\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"max-width:600px; background-color:#ffffff; margin:20px auto; border-radius:8px; box-shadow:0 0 10px rgba(0,0,0,0.05);\">\n    <tr>\n      <td style=\"padding:30px; text-align:center;\">\n        <h2 style=\"color:#333;\">Hi {{ $('Event Capture Type1').item.json['First Name'] }} {{ $('Event Capture Type1').item.json['Last Name'] }} ,</h2>\n        <p style=\"font-size:16px; color:#555;\">Thank you for purchasing <strong> {{ $('Event Capture Type1').item.json['Product Purchased'] }}  - n8n workflow template</strong> from <strong>SyncBricks</strong>! \ud83d\ude80</p>\n        <p style=\"font-size:16px; color:#555;\">Your template is attached with this email. We hope it helps you build powerful automations with ease.</p>\n        <hr style=\"margin:30px 0; border:none; border-top:1px solid #eee;\">\n        <p style=\"font-size:16px; color:#555;\">Here are some helpful resources to take things further:</p>\n        <ul style=\"list-style:none; padding:0; font-size:16px; color:#333;\">\n          <li style=\"margin-bottom:10px;\"><a href=\"https://www.udemy.com/course/mastering-n8n-ai-agents-api-automation-webhooks-no-code/?referralCode=0309FD70BE2D72630C09\" style=\"color:#0066cc; text-decoration:none;\">\ud83d\udcd8 Enroll for the n8n Mastery Course</a></li>\n          <li style=\"margin-bottom:10px;\"><a href=\"https://lms.syncbricks.com/books/n8n/\" style=\"color:#0066cc; text-decoration:none;\">\ud83d\udcd6 Get the Book: Mastering n8n</a></li>\n          <li style=\"margin-bottom:10px;\"><a href=\"https://n8n.syncbricks.com\" style=\"color:#0066cc; text-decoration:none;\">\u2601\ufe0f Try n8n Cloud \u2013 Use Code <strong>AMJID10</strong> for Discount</a></li>\n        </ul>\n\n<p style=\"font-size:16px; color:#555;\">\ud83c\udfa5 Watch a quick guide on how to use your template:</p>\n<a href=\"https://www.youtube.com/watch?v=-Oc_HfreJJE\" target=\"_blank\" style=\"display:inline-block; text-decoration:none;\">\n  <img src=\"https://img.youtube.com/vi/-Oc_HfreJJE/hqdefault.jpg\" alt=\"Watch on YouTube\" style=\"width:100%; max-width:500px; border-radius:6px; box-shadow:0 0 10px rgba(0,0,0,0.1); margin:10px 0;\">\n</a>\n\n\n        <p style=\"font-size:14px; color:#999; margin-top:40px;\">Need help or have questions? Just reply to this email .</p>\n      </td>\n    </tr>\n  </table>\n</body>\n</html>\n",
        "options": {
          "attachments": "data",
          "appendAttribution": false
        },
        "subject": "=Your Order : {{ $('Get Order Details').item.json.purchase_units[0].items[0].name }}",
        "toEmail": "={{ $('Email Data').item.json.EmaiID }}",
        "fromEmail": "Syncbricks <info@syncbricks.com>"
      },
      "typeVersion": 2.1
    },
    {
      "id": "d859f5b9-db4f-4df8-a806-a806349092ee",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        580,
        -160
      ],
      "parameters": {
        "width": 520,
        "height": 500,
        "content": "Paypal \uc6f9\ud6c5\n\nPaypal Developer\ub85c \uc774\ub3d9\ud558\uc138\uc694\n\nApps and Credentials\ub97c \ud074\ub9ad\ud558\uc138\uc694\n\nNVP SOAP Webhooks\ub85c \uc774\ub3d9\ud558\uc138\uc694\n\n\uc774 \uc6f9\ud6c5\uc744 Paypal\uc5d0 \ucd94\uac00\ud558\uc138\uc694\n\n- \ub300\uae30 \ub178\ub4dc\ub294 \uac70\ub798\uac00 \uc644\ub8cc\ub418\uc5c8\uc74c\uc744 \ud655\uc778\ud558\uae30 \uc704\ud568\uc785\ub2c8\ub2e4"
      },
      "typeVersion": 1
    },
    {
      "id": "f4c545d8-f978-4b49-8cdb-3b6b427544f8",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        -180
      ],
      "parameters": {
        "color": 4,
        "width": 955,
        "height": 516,
        "content": "## Amjid Ali\uac00 \uac1c\ubc1c\ud568\n\n\uc774 \uc6cc\ud06c\ud50c\ub85c\uc6b0 \ud15c\ud50c\ub9bf\uc744 \uc0ac\uc6a9\ud574 \uc8fc\uc154\uc11c \uac10\uc0ac\ud569\ub2c8\ub2e4. \uc774\ub97c \uac1c\ubc1c\ud558\ub294 \ub370 \uc218\ub9ce\uc740 \uc2dc\uac04\uc758 \ub178\ub825, \uc5f0\uad6c, \uadf8\ub9ac\uace0 \ud5cc\uc2e0\uc774 \ub4e4\uc5c8\uc73c\uba70, \uadc0\ud558\uc758 \uc791\uc5c5\uc5d0 \uac00\uce58\ub97c \ub354\ud574\uc8fc\uae30\ub97c \uc9c4\uc2ec\uc73c\ub85c \ubc14\ub78d\ub2c8\ub2e4.\n\n\uc774 \ud15c\ud50c\ub9bf\uc774 \ub3c4\uc6c0\uc774 \ub418\uc2e0\ub2e4\uba74, \uc81c \ub178\ub825\uc744 \uc9c0\uc6d0\ud574 \uc8fc\uc2e4 \uac83\uc744 \ubd80\ud0c1\ub4dc\ub9bd\ub2c8\ub2e4. \uadc0\ud558\uc758 \uc9c0\uc6d0\uc740 \uc81c\uac00 \uac1c\uc120\uc744 \uacc4\uc18d\ud558\uace0 \ub354 \uac00\uce58 \uc788\ub294 \uc790\uc6d0\uc744 \ub9cc\ub4e4\ub3c4\ub85d \ub3c4\uc6b8 \uac83\uc785\ub2c8\ub2e4.\n\n\uc5ec\uae30\uc5d0\uc11c PayPal\uc744 \ud1b5\ud574 \uae30\ubd80\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:\n\nhttp://paypal.me/pmptraining\n\nERPNext \ub610\ub294 AI\ub97c \uc0ac\uc6a9\ud55c \uc790\ub3d9\ud654\uc5d0 \ub300\ud55c \uc804\uccb4 \ucf54\uc2a4\uc5d0 \ub300\ud574\uc11c\ub294 \uc544\ub798 \ub9c1\ud06c\ub97c \ub530\ub77c\uc8fc\uc138\uc694:\n\nhttp://lms.syncbricks.com\n\n\ub610\ud55c, \uc774 \ud15c\ud50c\ub9bf\uc744 \uacf5\uc720\ud560 \ub54c, \uc801\uc808\ud55c \ud06c\ub808\ub527\uc774 \uc8fc\uc5b4\uc9c0\ub3c4\ub85d \uc81c \uc6d0\ubcf8 \uc815\ubcf4\ub97c \ud3ec\ud568\ud574 \uc8fc\uc2dc\uba74 \uac10\uc0ac\ud558\uaca0\uc2b5\ub2c8\ub2e4.\n\n\uadc0\ud558\uc758 \uad00\ub300\ud568\uacfc \uc9c0\uc6d0\uc5d0 \uac10\uc0ac\ud569\ub2c8\ub2e4!\n\uc774\uba54\uc77c: amjid@amjidali.com\nhttps://linkedin.com/in/amjidali\nhttps://syncbricks.com\nhttps://youtube.com/@syncbricks"
      },
      "typeVersion": 1
    },
    {
      "id": "769fc3b3-0cbe-4334-a990-83c86a0e5fc2",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        -160
      ],
      "parameters": {
        "width": 580,
        "height": 500,
        "content": "## \uacb0\uc81c \uc138\ubd80 \uc0ac\ud56d\uc774 \uc120\ud0dd\ub428  \n**\uc6f9\ud6c5\uc740 \ubaa8\ub4e0 \uc774\ubca4\ud2b8\ub97c \uac00\uc838\uc624\uc9c0\ub9cc \uc5ec\uae30\uc11c\ub294 \uc8fc\ubb38\uc5d0 \ub300\ud574 \ubc1b\uc740 \uc9c0\ubd88\ub9cc \ud544\ud130\ub9c1\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.**  \n**\uace0\uac1d \uc774\ub984, \uc774\uba54\uc77c \uc8fc\uc18c \ubc0f \uace0\uac1d\uc774 \uad6c\ub9e4\ud55c \uc81c\ud488\uc744 \uac00\uc838\uc62c \uac83\uc785\ub2c8\ub2e4.**"
      },
      "typeVersion": 1
    },
    {
      "id": "835a6eb1-0b73-4d52-92b1-253fb1f150ac",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1720,
        -160
      ],
      "parameters": {
        "width": 280,
        "height": 500,
        "content": "\uc81c\ud488 \ud544\ud130\ub9c1  \n\uac01 \uc81c\ud488\uc740 \uc131\uacf5\uc801\uc778 \uad6c\ub9e4 \uc2dc \ub2e4\uc911 \uc81c\ud488 \ub9c1\ud06c\ub97c \uac00\uc9c8 \uc218 \uc788\uc2b5\ub2c8\ub2e4."
      },
      "typeVersion": 1
    },
    {
      "id": "54a284f2-566b-4dea-9e5f-6e55f5faefa4",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2020,
        -160
      ],
      "parameters": {
        "width": 420,
        "height": 500,
        "content": "n8n \ud15c\ud50c\ub9bf \ud310\ub9e4  \nn8n \ud15c\ud50c\ub9bf\uc744 \ud310\ub9e4\ud558\uace0 \uc788\uc73c\ubbc0\ub85c, JSON \ud30c\uc77c\uc744 \ub2e4\uc6b4\ub85c\ub4dc\ud560 \uac83\uc774\uace0 \uadf8\uac83\uc744 \ubc14\uc774\ub108\ub9ac \ud30c\uc77c\ub85c \ubcc0\ud658\ud560 \uac83\uc785\ub2c8\ub2e4"
      },
      "typeVersion": 1
    },
    {
      "id": "20645f67-af3d-4ebf-bab1-488937182205",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2460,
        -160
      ],
      "parameters": {
        "color": 4,
        "width": 420,
        "height": 500,
        "content": "\uc774\uba54\uc77c\uc744 \uace0\uac1d\uc5d0\uac8c \ubcf4\ub0b4\uae30: \ub2e4\uc6b4\ub85c\ub4dc \ud30c\uc77c\uc774 \ucca8\ubd80\ub418\uace0 \ub0b4 \ub9de\ucda4 \uc774\uba54\uc77c\uc774 \uace0\uac1d\uc5d0\uac8c \ubcf4\ub0b4\uc9d1\ub2c8\ub2e4."
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Wait": {
      "main": [
        [
          {
            "node": "Event Capture Type",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Webhook": {
      "main": [
        [
          {
            "node": "Wait",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "getJSON": {
      "main": [
        [
          {
            "node": "Conver to File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Email Data": {
      "main": [
        [
          {
            "node": "Event Capture Type1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Conver to File": {
      "main": [
        [
          {
            "node": "Send Email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Order Details": {
      "main": [
        [
          {
            "node": "Email Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Event Capture Type": {
      "main": [
        [
          {
            "node": "Get Order Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Event Capture Type1": {
      "main": [
        [
          {
            "node": "getJSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}