{
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.telegram.org/bot{{ $('edit_bot_token').item.json.bot_token }}/sendInvoice",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Content-Type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"chat_id\": \"{{ $('webhook_node').item.json.body.message.chat.id }}\",\n  \"title\": \"your summary\",\n  \"description\": \"Get your sammary\",\n  \"provider_token\": \"\",\n  \"payload\": \"[{{ $('webhook_node').item.json.body.message.message_id }}]\",\n  \"currency\": \"XTR\",\n  \"prices\": [\n    { \"label\": \"Summary\", \"amount\": 1 }\n  ],\n  \"start_parameter\": \"summary\"\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -6640,
        -880
      ],
      "id": "32ac9168-9527-4a04-bb97-f6467ff0febe",
      "name": "send_invoice",
      "retryOnFail": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "=https://api.telegram.org/bot{{ $('edit_bot_token').item.json.bot_token }}/answerPreCheckoutQuery ",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"pre_checkout_query_id\": \"{{ $node[\"webhook_node\"].json[\"body\"][\"pre_checkout_query\"][\"id\"] }}\",\n  \"ok\": true\n}\n\n",
        "options": {
          "response": {
            "response": {}
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -7216,
        96
      ],
      "id": "14e3142b-f09b-4947-a36e-879a6d0b4adf",
      "name": "send_pre_checkout_query"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $node[\"webhook_node\"].json[\"body\"][\"message\"][\"text\"]}}",
                    "rightValue": "^\\/",
                    "operator": {
                      "type": "string",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "id": "c49e1462-7622-4df6-872d-876af8b69eab"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "text"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "loose",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "db3d3bf7-45a5-4361-a1f6-b923379da448",
                    "leftValue": "={{ $node[\"webhook_node\"].json[\"body\"][\"message\"][\"successful_payment\"][\"invoice_payload\"] }}",
                    "rightValue": "",
                    "operator": {
                      "type": "boolean",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "successful_payment"
            }
          ]
        },
        "looseTypeValidation": true,
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -7216,
        -864
      ],
      "id": "2ed75ec5-54fb-40fe-9e67-4aac97ff17e5",
      "name": "switch_message_type"
    },
    {
      "parameters": {
        "content": "## Receives incoming HTTP POST requests from Telegram Bot API \n\n## \u041f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 HTTP POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 Telegram Bot API\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Input:\nHTTP POST requests with Telegram webhook data \n\nHTTP POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 Telegram\n\n### Output:\nJSON data containing the webhook payload with message/update information\n\nJSON \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438/\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438\n\n### Configuration\nMethod: POST\nPath: /<bot_token>/webhook<br>\nResponse mode: Response Node\n\n### Usage:\nAdd the bot token to the path instead of <your_bot_token>\n\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430 \u0432 path \u0432\u043c\u0435\u0441\u0442\u043e <your_bot_token>\n\n\n",
        "height": 832,
        "width": 560,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -9344,
        -736
      ],
      "id": "c0e57732-bbbf-4a89-9982-03d0360aeb59",
      "name": "Sticky Note",
      "disabled": true
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "/<your_bot_token>/webhook",
        "responseMode": "responseNode",
        "options": {}
      },
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -9120,
        -496
      ],
      "id": "03940ef6-2c1c-44b3-8be3-6ae974c70f83",
      "name": "webhook_node"
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "{\n  \"name\": \"Respond to Webhook\",\n  \"type\": \"n8n-nodes-base.respondToWebhook\",\n  \"typeVersion\": 1,\n  \"position\": [\n    500,\n    300\n  ],\n  \"parameters\": {\n    \"responseMode\": \"onReceived\",\n    \"responseCode\": 200,\n    \"responseData\": {\n      \"type\": \"json\",\n      \"json\": {\n        \"status\": \"ok\"\n      }\n    }\n  }\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.4,
      "position": [
        -7824,
        112
      ],
      "id": "81dee6ce-773b-4cf2-8c8d-22733d180854",
      "name": "respond_to_webhook"
    },
    {
      "parameters": {
        "content": "## Sends immediate HTTP response back to Telegram to acknowledge webhook receipt\n\n## \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 HTTP \u043e\u0442\u0432\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 Telegram \u0434\u043b\u044f \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u0435\u0431\u0445\u0443\u043a\u0430\n\n\n\n\n\n\n\n\n\n\n\n\n### Input: \nWebhook data from WebhookNode\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u0438\u0437 WebhookNode\n\n### Output: \nHTTP 200 response with JSON status\nHTTP 200 \u043e\u0442\u0432\u0435\u0442 \u0441 JSON \u0441\u0442\u0430\u0442\u0443\u0441\u043e\u043c\n\n### Configuration: \nResponse: JSON \nFormat: Status: 200 OK\nBody: {\"status\": \"ok\"}\n",
        "height": 688,
        "width": 512,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -8000,
        -144
      ],
      "id": "11e64b35-0b94-47ec-b0de-d92b651dcec2",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "b0e7ce75-632b-497b-b7b9-670e1593e1c0",
                    "leftValue": "={{ $node[\"webhook_node\"].json[\"body\"][\"message\"]}}",
                    "rightValue": "",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "message"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "c8102204-db9c-4156-a45b-c8d8ffb29543",
                    "leftValue": "={{ $node[\"webhook_node\"].json[\"body\"][\"pre_checkout_query\"]}}",
                    "rightValue": "",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "pre_checkout_query"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -7792,
        -848
      ],
      "id": "a3495be7-5b92-40ca-a3e1-7649f6b01204",
      "name": "switch_event_type"
    },
    {
      "parameters": {
        "content": "## Routes workflow based on Telegram event type (message vs pre_checkout_query)\n\n## \u041d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f Telegram (\u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0442\u0438\u0432 pre_checkout_query)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Input: \nWebhook data from WebhookNode\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u0438\u0437 WebhookNode\n\n### Output: \nTwo possible paths:\n\u2022 message - when regular message exists\n\u2022 pre_checkout_query - when payment pre-checkout query exists\n\n\u0414\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0443\u0442\u0438:\n\u2022 message - \u043a\u043e\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435\n\u2022 pre_checkout_query - \u043a\u043e\u0433\u0434\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043b\u0430\u0442\u0435\u0436\u0430\n\n### Logic: \n\u2022 Checks if $node[\"WebhookNode\"].json[\"body\"][\"message\"] exists\n\u2022 Checks if $node[\"WebhookNode\"].json[\"body\"][\"pre_checkout_query\"] exists\n\n\u2022 \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 $node[\"WebhookNode\"].json[\"body\"][\"message\"]\n\n\u2022 \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 $node[\"WebhookNode\"].json[\"body\"][\"pre_checkout_query\"]",
        "height": 864,
        "width": 512,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -8000,
        -1088
      ],
      "id": "2b6d742d-0b6c-4348-a299-6700a4c7b436",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## Further routes messages based on content type (text command vs successful payment)\n\n## \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 (\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0440\u043e\u0442\u0438\u0432 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0442\u0435\u0436\u0430)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Input: \nMessage data from switch_event_type\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438\u0437 switch_event_type\n\n### Output: \nTwo possible paths:\n\u2022 text - when message contains text (command)\n\u2022 successful_payment - when message contains successful payment data\n\n\u0414\u0432\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u0443\u0442\u0438:\n\u2022 text - \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u0435\u043a\u0441\u0442 (\u043a\u043e\u043c\u0430\u043d\u0434\u0443)\n\u2022 successful_payment - \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043f\u043b\u0430\u0442\u0435\u0436\u0435\n\n### Logic: \n\u2022 Checks if message text exists (for commands starting with \"/\")\n\u2022 Checks if successful_payment.invoice_payload exists\n\n\u2022 \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f (\u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \"/\")\n\u2022 \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 successful_payment.invoice_payload",
        "height": 864,
        "width": 528
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -7424,
        -1088
      ],
      "id": "78e92130-dd27-43a1-ac11-d9862267cdd1",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "## Approves pre-checkout query to allow payment completion \n\n## \u041e\u0434\u043e\u0431\u0440\u044f\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0435\u0436\u0430\n\n\n\n\n\n\n\n\n\n\n\n### Input: \nPre-checkout query data with query ID\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441 ID \u0437\u0430\u043f\u0440\u043e\u0441\u0430\n\n### Output: \nTelegram API confirmation of pre-checkout approval\n\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 Telegram API \u043e\u0431 \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u0438\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438\n\n### Configuration: \n\u2022 Method: POST\n\u2022 URL: https://api.telegram.org/bot{token}/answerPreCheckoutQuery\n\u2022 Response: {\"ok\": true} to approve payment (\u0434\u043b\u044f \u043e\u0434\u043e\u0431\u0440\u0435\u043d\u0438\u044f \u043f\u043b\u0430\u0442\u0435\u0436\u0430)",
        "height": 688,
        "width": 528
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -7424,
        -144
      ],
      "id": "7bf77edf-b83c-4d37-bc2c-f6553c2e1b37",
      "name": "Sticky Note4"
    },
    {
      "parameters": {
        "content": "## Sends payment invoice to Telegram user using Stars currency\n\n## \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0447\u0435\u0442 \u043d\u0430 \u043e\u043f\u043b\u0430\u0442\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e Telegram \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u0430\u043b\u044e\u0442\u0443 Stars\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### Input: \nMessage data containing chat ID and message ID\n\u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 chat ID \u0438 message ID\n\n### Output: \nTelegram API response confirming invoice sent\n\u041e\u0442\u0432\u0435\u0442 Telegram API \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0449\u0438\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0443 \u0441\u0447\u0435\u0442\u0430\n\n### Configuration: \n\u2022 Method: POST\n\u2022 URL: https://api.telegram.org/bot{token}/sendInvoice\n\u2022 Currency: XTR (Telegram Stars)\n\u2022 Price: 1 Star\n\u2022 Title: \"your summary\"\n\u2022 Description: \"Description text message / \u0422\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u043a\u0443\u043f\u043a\u0438\"\n\n",
        "height": 752,
        "width": 544,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -6832,
        -1088
      ],
      "id": "deaf7cae-3ac1-439d-91d0-4c4827ed042b",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "content": "## This workflow handles Telegram Stars payments through a bot, processing incoming webhooks and managing the payment flow from invoice creation to completion.\n\n## \u042d\u0442\u043e\u0442 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u043b\u0430\u0442\u0435\u0436\u0438 Telegram Stars \u0447\u0435\u0440\u0435\u0437 \u0431\u043e\u0442\u0430, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432\u0435\u0431\u0445\u0443\u043a\u0438 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439 \u043e\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0447\u0435\u0442\u0430 \u0434\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f.\n\n\n## [Telegram Channel](https://t.me/vibe_bus)\n## [Telegram Chat](https://t.me/vibe_bus_chat)\n## [YouTube Channel](https://www.youtube.com/@vibe_business)  \n",
        "height": 448,
        "width": 3056,
        "color": 5
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -9344,
        -1568
      ],
      "id": "c5044242-5436-4552-b7a3-68b263033be6",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "87e4368f-20be-44ea-9c9c-42fade5d2c72",
              "name": "bot_token",
              "value": "<your_bot_token>",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -8448,
        -560
      ],
      "id": "f1344187-6d0e-421a-ac4d-56f2064ee6ac",
      "name": "edit_bot_token"
    },
    {
      "parameters": {
        "content": "## Allows easy editing of bot token in workflow without changing multiple nodes\n## \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430 \u0432 \u0432\u043e\u0440\u043a\u0444\u043b\u043e\u0443 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043d\u043e\u0434\n\n\n\n\n\n\n\n\n\n### Input: \nNo input data required - static configuration node\n\u0412\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f - \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043d\u043e\u0434\u0430\n\n### Output: \nBot token string for use in other nodes\n\u0421\u0442\u0440\u043e\u043a\u0430 \u0442\u043e\u043a\u0435\u043d\u0430 \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u043e\u0434\u0430\u0445\n\n### Logic: \n\u2022 Stores bot token as a workflow variable or expression\n\u2022 Provides centralized token management\n\u2022 Eliminates need to update token in multiple HTTP request nodes\n\n\u2022 \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430 \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0432\u043e\u0440\u043a\u0444\u043b\u043e\u0443 \u0438\u043b\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\n\u2022 \u041e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0435\u043d\u043e\u043c\n\u2022 \u0423\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u043e\u043a\u0435\u043d\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 HTTP request \u043d\u043e\u0434\n\n### Usage:\nReference this node's output in other nodes: `{{ $node[\"edit_bot_token\"].json.token }}`\nPlease note that the token must be inserted separately into the first webhook.\n\n\u0421\u0441\u044b\u043b\u0430\u0439\u0442\u0435\u0441\u044c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434 \u044d\u0442\u043e\u0439 \u043d\u043e\u0434\u044b \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u043e\u0434\u0430\u0445: `{{ $node[\"edit_bot_token\"].json.token }}`\n\u0423\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0435\u0431\u0445\u0443\u043a \u0442\u043e\u043a\u0435\u043d \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e",
        "height": 832,
        "width": 720
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -8752,
        -736
      ],
      "id": "9a5b38db-28a1-4f25-be36-cb1096dea611",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "content": "# Changing Currency in Telegram Bot Payments\n# \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u0430\u043b\u044e\u0442\u044b \u0432 Telegram Bot Payments\n\n## All Supported Currencies\n## \u0412\u0441\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0432\u0430\u043b\u044e\u0442\u044b\n\n### Telegram Stars\n### Telegram Stars\n- **XTR** - Telegram Stars (no external provider required)\n- **XTR** - Telegram Stars (\u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430)\n\n### Fiat Currencies (all require payment provider) | Fiat \u0432\u0430\u043b\u044e\u0442\u044b (\u0432\u0441\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442 payment provider)\nUSD (US Dollar), EUR (Euro), RUB (Russian Ruble), GBP (British Pound), UAH (Ukrainian Hryvnia), BYN (Belarusian Ruble), KZT (Kazakhstani Tenge), UZS (Uzbekistani Som), GEL (Georgian Lari), TJS (Tajikistani Somoni), AMD (Armenian Dram), KGS (Kyrgyzstani Som), MDL (Moldovan Leu), AZN (Azerbaijani Manat), TRY (Turkish Lira), ILS (Israeli Shekel), JPY (Japanese Yen), CNY (Chinese Yuan), INR (Indian Rupee), BRL (Brazilian Real), MXN (Mexican Peso), CAD (Canadian Dollar), AUD (Australian Dollar), CHF (Swiss Franc), SEK (Swedish Krona), NOK (Norwegian Krone), DKK (Danish Krone), PLN (Polish Zloty), CZK (Czech Koruna), HUF (Hungarian Forint)\n\n## Payment Providers by Currency | Payment Providers \u043f\u043e \u0432\u0430\u043b\u044e\u0442\u0430\u043c\n\n### Stripe - USD, EUR, GBP, CAD, AUD, CHF, SEK, NOK, DKK, PLN, CZK, HUF\n### Yoomoney (\u042eMoney) - RUB\n### Sberbank - RUB\n### Tranzzo - UAH\n### Fondy - UAH, USD, EUR\n\n## Documentation | \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\n\n**Official Telegram Bot API Documentation:** | **\u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f Telegram Bot API:**\n- [Payments API](https://core.telegram.org/bots/api#payments)\n- [sendInvoice method](https://core.telegram.org/bots/api#sendinvoice)\n- [Supported currencies](https://core.telegram.org/bots/payments#supported-currencies)\n\n## Why Use HTTP Request Instead of Standard Telegram Nodes? | \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f HTTP Request \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 Telegram \u043d\u043e\u0434?\n\n### 1. **Limited Functionality of Standard Nodes** | **\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043d\u043e\u0434**\n- Standard Telegram nodes in n8n don't support all Telegram Bot API methods\n- Payments API appeared relatively recently and is missing from standard nodes\n- HTTP Request provides full control over all API parameters\n\n- \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 Telegram \u043d\u043e\u0434\u044b n8n \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b Telegram Bot API\n- Payments API \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u043d\u043e\u0434\u0430\u0445\n- HTTP Request \u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0432\u0441\u0435\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 API\n\n### 2. **Payment Processing** | **\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439**\n- Webhooks are critical for payments - need to handle:\n  - `pre_checkout_query` - pre-checkout verification\n  - `successful_payment` - successful payment\n- Standard nodes don't support these specific events\n\n- Webhook'\u0438 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b \u0434\u043b\u044f payments - \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c:\n  - `pre_checkout_query` - \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430\n  - `successful_payment` - \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u043f\u043b\u0430\u0442\u0435\u0436\n- \u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u044d\u0442\u0438 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\n\n### 3. **Customization** | **\u041a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u044f**\n```json\n// Full control over the request | \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c\n{\n  \"chat_id\": \"{{ $('webhook_node').item.json.body.message.chat.id }}\",\n  \"title\": \"Custom Title\",\n  \"description\": \"Custom Description\", \n  \"provider_token\": \"custom_token\",\n  \"currency\": \"USD\",\n  \"prices\": [{\"label\": \"Item\", \"amount\": 100}],\n  \"photo_url\": \"https://example.com/image.jpg\",\n  \"need_email\": true,\n  \"send_email_to_provider\": true\n}\n```\n\n## Webhook Configuration | \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f Webhook\n\n### Input:\n### \u0412\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:\nHTTP POST requests with Telegram webhook data\nHTTP POST \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 Telegram\n\n### Output:\n### \u0418\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:\nJSON data containing the webhook payload with message/update information\nJSON \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438/\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438\n\n### Configuration | \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f\nMethod: POST\nPath: /<bot_token>/webhook\nResponse mode: Response Node\n\n### Usage | \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435:\nAdd the bot token to the path instead of <your_bot_token>\n\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u043e\u043a\u0435\u043d \u0431\u043e\u0442\u0430 \u0432 path \u0432\u043c\u0435\u0441\u0442\u043e <your_bot_token>",
        "height": 2336,
        "width": 1312,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -10720,
        -1568
      ],
      "id": "495e2993-6988-418c-93c8-5a3890c1f94c",
      "name": "Sticky Note8"
    }
  ],
  "connections": {
    "switch_message_type": {
      "main": [
        [
          {
            "node": "send_invoice",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "webhook_node": {
      "main": [
        [
          {
            "node": "edit_bot_token",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "switch_event_type": {
      "main": [
        [
          {
            "node": "switch_message_type",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "send_pre_checkout_query",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "edit_bot_token": {
      "main": [
        [
          {
            "node": "switch_event_type",
            "type": "main",
            "index": 0
          },
          {
            "node": "respond_to_webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}