{
  "name": "Create or find Stripe customers and automatically generate invoices",
  "nodes": [
    {
      "id": "6f5abd7f-51a7-488f-9fdc-0dc7b9b94b45",
      "name": "Get Stripe Customer",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -460,
        100
      ]
    },
    {
      "id": "3e000064-f370-4229-a46c-eb93ab34cfae",
      "name": "Customer exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        -260,
        100
      ]
    },
    {
      "id": "82014597-3859-4762-a9b3-10e1e9d9aeda",
      "name": "Create customer",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        0,
        200
      ]
    },
    {
      "id": "0f95b863-e1f7-4732-9e9d-3e3c2deae76b",
      "name": "Create invoice",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        280,
        100
      ]
    },
    {
      "id": "abcdc761-c7d2-4eaf-8cbd-c4fe80cc47ad",
      "name": "Finalize invoice",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        700,
        100
      ]
    },
    {
      "id": "a90c9731-8fea-4037-a6c4-04bc52ad4eac",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -860,
        100
      ]
    },
    {
      "id": "5a3478f0-a0d3-493f-9420-126cbcde535d",
      "name": "Set invoice data",
      "type": "n8n-nodes-base.set",
      "position": [
        -660,
        100
      ]
    },
    {
      "id": "eb49ed91-bd3b-4752-8932-327457c6ae72",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1480,
        -40
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": ""
      }
    },
    {
      "id": "923b2c54-eeb8-4605-b0fd-fc24939f11ff",
      "name": "Set customer id",
      "type": "n8n-nodes-base.set",
      "position": [
        0,
        0
      ]
    },
    {
      "id": "250a7a35-2079-45fc-b192-dd8a012bbb97",
      "name": "Add item to invoice",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        500,
        100
      ]
    }
  ],
  "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
          }
        ]
      ]
    }
  }
}