Stripe到KlickTipp自动化:通过标签发送购买确认邮件

中级

这是一个Social Media领域的自动化工作流,包含 8 个节点。主要使用 Klicktipp、Stripe、HttpRequest、StripeTrigger 等节点。 Stripe到KlickTipp自动化:通过标签发送购买确认邮件

前置要求
  • Stripe API Key
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "95b3ab5a70ab1c8c1906357a367f1b236ef12a1409406fd992f60255f0f95f85",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "f53d9572-2100-4dbb-83af-6a663bc9ecbb",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -380
      ],
      "parameters": {
        "color": 4,
        "width": 860,
        "height": 440,
        "content": "## 通过 Webhook 和 HTTP 请求接收和收集数据"
      },
      "typeVersion": 1
    },
    {
      "id": "51b80673-c272-4c2c-8fc3-969fe4a0cc6a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        100,
        -380
      ],
      "parameters": {
        "width": 320,
        "height": 440,
        "content": "## 将结账数据写入联系人记录"
      },
      "typeVersion": 1
    },
    {
      "id": "e19bea0c-f8d7-49f2-8b6f-a13bed1c465d",
      "name": "将买家订阅到 KlickTipp",
      "type": "CUSTOM.klicktipp",
      "notes": "Subscribes the buyer to the KlickTipp list using their payment data.",
      "position": [
        200,
        -180
      ],
      "parameters": {
        "email": "={{ $json.billing_details.email }}",
        "tagId": "13201265",
        "fields": {
          "dataFields": [
            {
              "fieldId": "field219541",
              "fieldValue": "={{ $json.amount }}"
            },
            {
              "fieldId": "field220266",
              "fieldValue": "={{ $json.receipt_url }}"
            },
            {
              "fieldId": "field219542",
              "fieldValue": "={{ $('New checkout session completed').item.json.data.object.id }}"
            },
            {
              "fieldId": "fieldFirstName",
              "fieldValue": "={{ \n  // Access the full name string from the JSON input\n  $json.billing_details.name\n  \n  // Remove any leading/trailing whitespace\n  ?.trim()\n  \n  // Split the name string into an array using one or more whitespace characters (handles multiple spaces)\n  .split(/\\s+/)\n  \n  // Select the first word from the array (typically the first name)\n  [0] \n}}\n"
            },
            {
              "fieldId": "fieldLastName",
              "fieldValue": "={{ \n  // Access the full name from the input JSON\n  $json.billing_details.name\n\n  // Remove any leading/trailing whitespace\n  ?.trim()\n\n  // Split the string into an array of words using any whitespace\n  .split(/\\s+/)\n\n  // Get the last word in the array — typically the last name\n  .at(-1) \n}}"
            },
            {
              "fieldId": "field219540",
              "fieldValue": "={{ $('Getting line items').item.json.data.map(item => item.description) }}\n"
            }
          ]
        },
        "listId": "358895",
        "resource": "subscriber",
        "operation": "subscribe"
      },
      "credentials": {
        "klickTippApi": {
          "id": "K9JyBdCM4SZc1cXl",
          "name": "DEMO KlickTipp account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "6a72557d-32df-4928-8816-6eddbc0f45ba",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -680,
        80
      ],
      "parameters": {
        "color": 7,
        "width": 980,
        "height": 1600,
        "content": "### 简介"
      },
      "typeVersion": 1
    },
    {
      "id": "26f6a896-68ce-491f-9e7e-92a667aff2a5",
      "name": "获取发票链接",
      "type": "n8n-nodes-base.stripe",
      "notes": "This node gets the details from the payment in order to identify the line items and amount of the payment.",
      "position": [
        -60,
        -180
      ],
      "parameters": {
        "chargeId": "={{ $json.latest_charge }}",
        "resource": "charge"
      },
      "credentials": {
        "stripeApi": {
          "id": "0eu6Lo5OpkxqR4o0",
          "name": "Dev Testing Stripe account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    },
    {
      "id": "d16814e5-7255-4da3-ac0c-64b80e4fc72c",
      "name": "获取收费 ID",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "This node gets the charge ID from the checkout completion in order to be able to fetch the receipt url.",
      "position": [
        -280,
        -180
      ],
      "parameters": {
        "url": "=https://api.stripe.com/v1/payment_intents/{{ $('New checkout session completed').item.json.data.object.payment_intent }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "authorization",
              "value": "Basic <YOURKEY>"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "815f0790-be2c-455f-a3ad-02b2b118a3ff",
      "name": "获取订单项",
      "type": "n8n-nodes-base.httpRequest",
      "notes": "This node gets the line items from the checkout session.",
      "position": [
        -480,
        -180
      ],
      "parameters": {
        "url": "=https://api.stripe.com/v1/checkout/sessions/{{ $json.data.object.id }}/line_items",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Stripe-Version",
              "value": "2025-05-28.basil"
            },
            {
              "name": "authorization",
              "value": "Basic <YOURKEY>"
            }
          ]
        }
      },
      "notesInFlow": true,
      "typeVersion": 4.2
    },
    {
      "id": "e719d079-0065-44a2-a2c1-c59ded09b388",
      "name": "新的结账会话已完成",
      "type": "n8n-nodes-base.stripeTrigger",
      "notes": "This trigger listens to successful checkout completions from Stripe.",
      "position": [
        -700,
        -180
      ],
      "webhookId": "0d270008-d22c-486b-8ba1-e7d68b942512",
      "parameters": {
        "events": [
          "checkout.session.completed"
        ]
      },
      "credentials": {
        "stripeApi": {
          "id": "0eu6Lo5OpkxqR4o0",
          "name": "Dev Testing Stripe account"
        }
      },
      "notesInFlow": true,
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Getting charge ID": [
      {
        "id": "pi_3Rjf3pQkZguNehl70kVEzRm6",
        "amount": 150,
        "object": "payment_intent",
        "review": null,
        "source": null,
        "status": "succeeded",
        "created": 1752233053,
        "currency": "eur",
        "customer": null,
        "livemode": false,
        "metadata": {},
        "shipping": null,
        "processing": null,
        "application": null,
        "canceled_at": null,
        "description": null,
        "next_action": null,
        "on_behalf_of": null,
        "client_secret": "pi_3Rjf3pQkZguNehl70kVEzRm6_secret_9sLvV8mG1ICyHPM4ZkEPRyo8j",
        "latest_charge": "ch_3Rjf3pQkZguNehl70eSFbnCK",
        "receipt_email": null,
        "transfer_data": null,
        "amount_details": {
          "tip": {}
        },
        "capture_method": "automatic_async",
        "payment_method": "pm_1Rjf3oQkZguNehl7jypt7So1",
        "transfer_group": null,
        "amount_received": 150,
        "amount_capturable": 0,
        "last_payment_error": null,
        "setup_future_usage": null,
        "cancellation_reason": null,
        "confirmation_method": "automatic",
        "payment_method_types": [
          "card"
        ],
        "statement_descriptor": null,
        "application_fee_amount": null,
        "payment_method_options": {
          "card": {
            "network": null,
            "installments": null,
            "mandate_options": null,
            "request_three_d_secure": "automatic"
          }
        },
        "automatic_payment_methods": null,
        "statement_descriptor_suffix": null,
        "payment_method_configuration_details": null
      }
    ],
    "Getting line items": [
      {
        "url": "/v1/checkout/sessions/cs_test_b1Fl0epwqTK8fAqYvYzztLyRcecJIVtgoopYddqXFmPQj9rUPwVWZOGqlZ/line_items",
        "data": [
          {
            "id": "li_1Rjf3WQkZguNehl75fO6IpjF",
            "price": {
              "id": "price_1RUUxHQkZguNehl7V6Mr6IKG",
              "type": "one_time",
              "active": true,
              "object": "price",
              "created": 1748619287,
              "product": "prod_SPJaNisODiYpFh",
              "currency": "eur",
              "livemode": false,
              "metadata": {},
              "nickname": null,
              "recurring": null,
              "lookup_key": null,
              "tiers_mode": null,
              "unit_amount": 50,
              "tax_behavior": "unspecified",
              "billing_scheme": "per_unit",
              "custom_unit_amount": null,
              "transform_quantity": null,
              "unit_amount_decimal": "50"
            },
            "object": "item",
            "currency": "eur",
            "quantity": 1,
            "amount_tax": 0,
            "description": "Kuh Foto",
            "amount_total": 50,
            "amount_discount": 0,
            "amount_subtotal": 50
          },
          {
            "id": "li_1Rjf3WQkZguNehl7GOGkpHQU",
            "price": {
              "id": "price_1RUTtwQkZguNehl74yCjgQea",
              "type": "one_time",
              "active": true,
              "object": "price",
              "created": 1748615236,
              "product": "prod_SPIUE7NLhgaiws",
              "currency": "eur",
              "livemode": false,
              "metadata": {},
              "nickname": null,
              "recurring": null,
              "lookup_key": null,
              "tiers_mode": null,
              "unit_amount": 100,
              "tax_behavior": "unspecified",
              "billing_scheme": "per_unit",
              "custom_unit_amount": null,
              "transform_quantity": null,
              "unit_amount_decimal": "100"
            },
            "object": "item",
            "currency": "eur",
            "quantity": 1,
            "amount_tax": 0,
            "description": "Testprodukt Foto Welle",
            "amount_total": 100,
            "amount_discount": 0,
            "amount_subtotal": 100
          }
        ],
        "object": "list",
        "has_more": false
      }
    ],
    "Getting invoice link": [
      {
        "id": "ch_3Rjf3pQkZguNehl70eSFbnCK",
        "paid": true,
        "order": null,
        "amount": 150,
        "object": "charge",
        "review": null,
        "source": null,
        "status": "succeeded",
        "created": 1752233053,
        "dispute": null,
        "outcome": {
          "type": "authorized",
          "reason": null,
          "risk_level": "normal",
          "risk_score": 32,
          "advice_code": null,
          "network_status": "approved_by_network",
          "seller_message": "Payment complete.",
          "network_advice_code": null,
          "network_decline_code": null
        },
        "captured": true,
        "currency": "eur",
        "customer": null,
        "disputed": false,
        "livemode": false,
        "metadata": {},
        "refunded": false,
        "shipping": null,
        "application": null,
        "description": null,
        "destination": null,
        "receipt_url": "https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xUlVSOGlRa1pndU5laGw3KPKs48MGMgb_9G8oAiM6LBaSlaISDbpeI4lQrVfFF87U7EVFa6tsqlWBlO7t0KZV_j9MU2JgT3SeU1FY",
        "failure_code": null,
        "on_behalf_of": null,
        "fraud_details": {},
        "radar_options": {},
        "receipt_email": null,
        "transfer_data": null,
        "payment_intent": "pi_3Rjf3pQkZguNehl70kVEzRm6",
        "payment_method": "pm_1Rjf3oQkZguNehl7jypt7So1",
        "receipt_number": null,
        "transfer_group": null,
        "amount_captured": 150,
        "amount_refunded": 0,
        "application_fee": null,
        "billing_details": {
          "name": "Ricardo Klünter",
          "email": "test@klicktipptest.com",
          "phone": null,
          "tax_id": null,
          "address": {
            "city": null,
            "line1": null,
            "line2": null,
            "state": null,
            "country": "PT",
            "postal_code": null
          }
        },
        "failure_message": null,
        "source_transfer": null,
        "balance_transaction": "txn_3Rjf3pQkZguNehl70Gtm3hqM",
        "statement_descriptor": null,
        "application_fee_amount": null,
        "payment_method_details": {
          "card": {
            "brand": "visa",
            "last4": "4242",
            "checks": {
              "cvc_check": "pass",
              "address_line1_check": null,
              "address_postal_code_check": null
            },
            "wallet": null,
            "country": "US",
            "funding": "credit",
            "mandate": null,
            "network": "visa",
            "exp_year": 2026,
            "exp_month": 8,
            "fingerprint": "BMFeaVRQMJD9EMGx",
            "overcapture": {
              "status": "unavailable",
              "maximum_amount_capturable": 150
            },
            "installments": null,
            "multicapture": {
              "status": "unavailable"
            },
            "network_token": {
              "used": false
            },
            "three_d_secure": null,
            "regulated_status": "unregulated",
            "amount_authorized": 150,
            "authorization_code": "307994",
            "extended_authorization": {
              "status": "disabled"
            },
            "network_transaction_id": "667770101978682",
            "incremental_authorization": {
              "status": "unavailable"
            }
          },
          "type": "card"
        },
        "failure_balance_transaction": null,
        "statement_descriptor_suffix": null,
        "calculated_statement_descriptor": "Stripe"
      }
    ],
    "New checkout session completed": [
      {
        "id": "evt_1Rjf3qQkZguNehl7U9GaCI8h",
        "data": {
          "object": {
            "id": "cs_test_b1Fl0epwqTK8fAqYvYzztLyRcecJIVtgoopYddqXFmPQj9rUPwVWZOGqlZ",
            "url": null,
            "mode": "payment",
            "locale": "auto",
            "object": "checkout.session",
            "status": "complete",
            "consent": null,
            "created": 1752233035,
            "invoice": null,
            "ui_mode": "hosted",
            "currency": "eur",
            "customer": null,
            "livemode": false,
            "metadata": {},
            "discounts": [],
            "cancel_url": "https://stripe.com",
            "expires_at": 1752319434,
            "custom_text": {
              "submit": null,
              "after_submit": null,
              "shipping_address": null,
              "terms_of_service_acceptance": null
            },
            "permissions": null,
            "submit_type": "auto",
            "success_url": "https://stripe.com",
            "amount_total": 150,
            "payment_link": "plink_1RUUxuQkZguNehl71P5ptXlR",
            "setup_intent": null,
            "subscription": null,
            "automatic_tax": {
              "status": null,
              "enabled": false,
              "provider": null,
              "liability": null
            },
            "client_secret": null,
            "custom_fields": [],
            "shipping_cost": null,
            "total_details": {
              "amount_tax": 0,
              "amount_discount": 0,
              "amount_shipping": 0
            },
            "customer_email": null,
            "origin_context": null,
            "payment_intent": "pi_3Rjf3pQkZguNehl70kVEzRm6",
            "payment_status": "paid",
            "recovered_from": null,
            "wallet_options": null,
            "amount_subtotal": 150,
            "adaptive_pricing": {
              "enabled": true
            },
            "after_expiration": null,
            "customer_details": {
              "name": "Ricardo Klünter",
              "email": "test@klicktipptest.com",
              "phone": null,
              "address": {
                "city": null,
                "line1": null,
                "line2": null,
                "state": null,
                "country": "PT",
                "postal_code": null
              },
              "tax_ids": [],
              "tax_exempt": "none"
            },
            "invoice_creation": {
              "enabled": false,
              "invoice_data": {
                "footer": null,
                "issuer": null,
                "metadata": {},
                "description": null,
                "custom_fields": null,
                "account_tax_ids": null,
                "rendering_options": null
              }
            },
            "shipping_options": [],
            "customer_creation": "if_required",
            "consent_collection": {
              "promotions": "none",
              "terms_of_service": "none",
              "payment_method_reuse_agreement": null
            },
            "client_reference_id": null,
            "currency_conversion": null,
            "payment_method_types": [
              "card",
              "bancontact",
              "eps",
              "klarna",
              "link"
            ],
            "allow_promotion_codes": false,
            "collected_information": null,
            "payment_method_options": {
              "card": {
                "request_three_d_secure": "automatic"
              }
            },
            "phone_number_collection": {
              "enabled": false
            },
            "payment_method_collection": "if_required",
            "billing_address_collection": "auto",
            "shipping_address_collection": null,
            "saved_payment_method_options": null,
            "payment_method_configuration_details": {
              "id": "pmc_1RUR9FQkZguNehl74mFAbws3",
              "parent": null
            }
          }
        },
        "type": "checkout.session.completed",
        "object": "event",
        "created": 1752233054,
        "request": {
          "id": null,
          "idempotency_key": null
        },
        "livemode": false,
        "api_version": "2025-04-30.basil",
        "pending_webhooks": 3
      }
    ]
  },
  "connections": {
    "Getting charge ID": {
      "main": [
        [
          {
            "node": "Getting invoice link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Getting line items": {
      "main": [
        [
          {
            "node": "Getting charge ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Getting invoice link": {
      "main": [
        [
          {
            "node": "Subscribe buyer to KlickTipp",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "New checkout session completed": {
      "main": [
        [
          {
            "node": "Getting line items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

这是一个中级难度的工作流,适用于Social Media等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量8
分类1
节点类型5
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
KlickTipp

KlickTipp

@KlickTipp

Reach more people. 100% GDPR compliant. Quickly create automated email campaigns, SMS and marketing automations. Market your knowledge independently of Google & Co., sell lucrative products and activate your customers.

外部链接
在 n8n.io 上查看 →

分享此工作流