8
n8n 中文网amn8n.com

创建或查找Stripe客户并自动生成发票

中级

这是一个Finance, IT Ops领域的自动化工作流,包含 10 个节点。主要使用 If, Set, HttpRequest, ManualTrigger 等节点。 创建或查找Stripe客户并自动生成发票

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "meta": {
    "instanceId": "568298fde06d3db80a2eea77fe5bf45f0c7bb898dea20b769944e9ac7c6c5a80"
  },
  "nodes": [
    {
      "id": "6f5abd7f-51a7-488f-9fdc-0dc7b9b94b45",
      "name": "获取 Stripe 客户",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -460,
        100
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "3e000064-f370-4229-a46c-eb93ab34cfae",
      "name": "客户是否存在?",
      "type": "n8n-nodes-base.if",
      "position": [
        -260,
        100
      ],
      "parameters": {},
      "typeVersion": 2.2
    },
    {
      "id": "82014597-3859-4762-a9b3-10e1e9d9aeda",
      "name": "创建客户",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        200
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "0f95b863-e1f7-4732-9e9d-3e3c2deae76b",
      "name": "创建发票",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        280,
        100
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "abcdc761-c7d2-4eaf-8cbd-c4fe80cc47ad",
      "name": "最终确认发票",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        100
      ],
      "parameters": {},
      "typeVersion": 4.2
    },
    {
      "id": "a90c9731-8fea-4037-a6c4-04bc52ad4eac",
      "name": "点击“测试工作流”时",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -860,
        100
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "5a3478f0-a0d3-493f-9420-126cbcde535d",
      "name": "设置发票数据",
      "type": "n8n-nodes-base.set",
      "position": [
        -660,
        100
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "eb49ed91-bd3b-4752-8932-327457c6ae72",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1480,
        -40
      ],
      "parameters": {
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "923b2c54-eeb8-4605-b0fd-fc24939f11ff",
      "name": "设置客户ID",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        0
      ],
      "parameters": {},
      "typeVersion": 3.4
    },
    {
      "id": "250a7a35-2079-45fc-b192-dd8a012bbb97",
      "name": "添加项目到发票",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        500,
        100
      ],
      "parameters": {},
      "typeVersion": 4.2
    }
  ],
  "pinData": {},
  "connections": {
    "Create invoice": {
      "main": [
        [
          {
            "node": "Add item to invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create customer": {
      "main": [
        [
          {
            "node": "Create invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set customer id": {
      "main": [
        [
          {
            "node": "Create invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Customer exists?": {
      "main": [
        [
          {
            "node": "Set customer id",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Create customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set invoice data": {
      "main": [
        [
          {
            "node": "Get Stripe Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add item to invoice": {
      "main": [
        [
          {
            "node": "Finalize invoice",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Stripe Customer": {
      "main": [
        [
          {
            "node": "Customer exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set invoice data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 财务, IT 运维

需要付费吗?

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

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

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

作者
Audun

Audun

@xqus

Transforming complexity into simplicity.

外部链接
在 n8n.io 查看

分享此工作流