{
  "name": "Automate QuickBooks invoicing & customer creation from Airtable sales orders",
  "nodes": [
    {
      "id": "db74e2e3-bc33-4277-89de-1b62bce61d6c",
      "name": "Get Customer Details",
      "type": "n8n-nodes-base.airtable",
      "position": [
        304,
        432
      ]
    },
    {
      "id": "ec49c44f-54fe-4f02-860f-2f492e46be18",
      "name": "QuickBooks - Find Customer",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        656,
        432
      ]
    },
    {
      "id": "5299c75c-d158-42eb-b9a6-16291eb83efd",
      "name": "Create a customer",
      "type": "n8n-nodes-base.quickbooks",
      "position": [
        1136,
        304
      ]
    },
    {
      "id": "f83c8c16-ac6e-4f02-8db9-83befb18abf0",
      "name": "Get Products",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1600,
        368
      ]
    },
    {
      "id": "dba10e50-b393-43d7-91ec-eac513be2ab7",
      "name": "Append Customers",
      "type": "n8n-nodes-base.merge",
      "position": [
        1424,
        784
      ]
    },
    {
      "id": "e56db207-580e-4ac9-affc-ed490d0674bb",
      "name": "Parse in HTTP",
      "type": "n8n-nodes-base.code",
      "position": [
        2416,
        352
      ]
    },
    {
      "id": "10f6d569-a928-41f8-a768-2c6646a4072d",
      "name": "Search Product ID",
      "type": "n8n-nodes-base.airtable",
      "position": [
        1872,
        368
      ]
    },
    {
      "id": "d4090bb0-4d0a-430d-8a9e-bee8860fc136",
      "name": "Create Invoice URL",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        2992,
        496
      ]
    },
    {
      "id": "9b6f19f2-ac4c-4baa-af6b-730b18cb2186",
      "name": "Loop Over Items1",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        2720,
        480
      ]
    },
    {
      "id": "dac5c7fa-a488-4f97-b8f0-aa8a56ca23ec",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -448,
        448
      ]
    },
    {
      "id": "d8e97ca6-608d-456b-af0c-01563c747444",
      "name": "If Invoice not Created",
      "type": "n8n-nodes-base.if",
      "position": [
        112,
        752
      ]
    },
    {
      "id": "05c1e7bc-bc42-415a-8052-50a852ccf19a",
      "name": "IF - Customer doesn't Exists?",
      "type": "n8n-nodes-base.if",
      "position": [
        992,
        784
      ]
    },
    {
      "id": "da33b092-a29d-4e07-8992-251c2e8d5cdd",
      "name": "Create Invoice record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        3280,
        496
      ]
    },
    {
      "id": "85f4579d-008c-469c-bfa0-085e17e33b80",
      "name": "Update Order record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        3568,
        496
      ]
    },
    {
      "id": "8b60a7d0-ecf8-4f7f-8c59-e40be0441b49",
      "name": "Update Customer Record",
      "type": "n8n-nodes-base.airtable",
      "position": [
        3872,
        496
      ]
    },
    {
      "id": "d459f712-afa2-48f2-b321-c8137508ee61",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -544,
        224
      ],
      "parameters": {
        "width": 294,
        "height": 416,
        "content": "## Purpose: Entry point. \n\n-Triggered automatically when a Sales Order is confirmed in Airtable.\n\n-Ensure your webhook URL is added in Airtable’s automation as a “POST request” when order status = Con"
      }
    },
    {
      "id": "f50402f8-8b25-4573-b67f-89827dabbd1a",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -192,
        224
      ],
      "parameters": {
        "width": 310,
        "height": 416,
        "content": "## Get Orders Records\n\n--Fetch details of the confirmed Sales Order using the record ID received from webhook.\n\n--Must have “Sales Order ID” field populated for linkage with Products and Customer."
      }
    },
    {
      "id": "09a7dae1-3f7f-4b5f-87ed-dd7a5d0f7b0f",
      "name": "Get Airtable Orders Records",
      "type": "n8n-nodes-base.airtable",
      "position": [
        -80,
        448
      ]
    },
    {
      "id": "83c2470f-4811-468d-bf32-802c7f19b397",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        16,
        688
      ],
      "parameters": {
        "width": 310,
        "height": 432,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Invoice record check\n\n--Skip records that already have a QuickBooks invoice created.\n\n--Checks if “Synced to QBO (A)” field in Airtable = FALSE.\n\n\n\n\n\n"
      }
    },
    {
      "id": "b5ef9066-d96b-4e04-92d6-388f6616795b",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        192,
        224
      ],
      "parameters": {
        "width": 294,
        "height": 416,
        "content": "## Get Customer Details\n\n--Retrieve customer info linked to this order.\n\n--Customer record must have fields like (Q) Customer Name, (Q) Email Address, etc.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "56e27b01-813d-45d5-8c2d-83d512350867",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        224
      ],
      "parameters": {
        "width": 278,
        "height": 416,
        "content": "## QuickBooks - Find Customer\n\n--Search customer in QuickBooks using DisplayName.\n\n--Ensures no duplicate customer creation in QBO.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "58bad121-7a39-4259-997e-47970f90f4d9",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        704
      ],
      "parameters": {
        "width": 310,
        "height": 432,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Customer doesn’t Exist?\n\n--Checks if customer was found in QBO.\n\n\n--True (Yes): Go to “Create a customer.”\n\n--False (No): Continue to next step.\n\n\n\n\n\n"
      }
    },
    {
      "id": "7b1b9432-76b1-47fb-9126-c93666dbbff4",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        112
      ],
      "parameters": {
        "width": 278,
        "height": 352,
        "content": "## Create a Customer\n\n--Creates new customer in QuickBooks if not found.\n\n--Pulls data from Airtable Customer table.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "ab0b82c5-c617-4b3e-b85c-be8c6cd1b293",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1280,
        704
      ],
      "parameters": {
        "width": 326,
        "height": 432,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Append Customers (Merge)\n\n--Combine both existing and newly created QBO customers for further mapping.\n\n\n--Merges both paths before processing invoices.\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "0cefbcce-7473-456b-96d5-7af70e22f66f",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1536,
        144
      ],
      "parameters": {
        "width": 230,
        "height": 368,
        "content": "## Get Products\n\n--Fetch order line items from “Order Lines” table.\n\n--Linked to Sales Order ID from “Confirmed Orders.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "f664dd69-7b76-4aea-b61c-ad03d36dec13",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        144
      ],
      "parameters": {
        "width": 230,
        "height": 368,
        "content": "## Search Product ID\n\n--Finds QBO Product/Service ID for each product line.\n\n--Uses “(Q) Product/Service Name” to match Airtable & QuickBooks.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "35215682-456e-47e1-93ea-67d96ea4fda2",
      "name": "Data Preparation",
      "type": "n8n-nodes-base.code",
      "position": [
        2144,
        368
      ]
    },
    {
      "id": "b9766711-fec2-45e0-a99f-4b5a748a2f91",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2080,
        96
      ],
      "parameters": {
        "width": 214,
        "height": 416,
        "content": "## Data Preparation\n\n--Core logic — combines orders, customers, and products to prepare structured invoice payload.\n\n--Handles mapping of IDs, email, and discount logic.\n\n-- Modify this if your Airtab"
      }
    },
    {
      "id": "179a4831-1293-4cfb-8fc9-40f9eab92ead",
      "name": "Sticky Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2352,
        96
      ],
      "parameters": {
        "width": 214,
        "height": 416,
        "content": "## Parse in HTTP\n\n--Converts JS objects into QuickBooks-compatible invoice JSON format.\n\n--Validate the payload before posting to QuickBooks.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "217fef97-8eb0-463a-b914-82d043de353a",
      "name": "Sticky Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2656,
        240
      ],
      "parameters": {
        "width": 214,
        "height": 384,
        "content": "## Split in Batches\n\n--Iterates through all prepared invoices to send one-by-one to QuickBooks API.\n\n--Keep batch size = 1 for better control and error handling.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "21ebba18-8bc2-456e-b856-75c9351ff269",
      "name": "Sticky Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2928,
        192
      ],
      "parameters": {
        "width": 230,
        "height": 464,
        "content": "## Create Invoice URL (QuickBooks API - HTTP)\n\n--Creates the invoice in QuickBooks Sandbox via HTTP POST.\n\n--Ensure Sandbox Company ID & version number (minorversion=75) are correct.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "356e57c9-8749-44e3-9200-b2b68f1df2b5",
      "name": "Sticky Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3200,
        224
      ],
      "parameters": {
        "width": 230,
        "height": 432,
        "content": "## Create Invoice Record\n\n--Logs created invoice details into “Invoices & Payments” table in Airtable.\n\n--Automatically captures Invoice Number, Amount, Due Date, etc.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "a831625c-2a53-4b29-a03f-de8773778ee1",
      "name": "Sticky Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3504,
        224
      ],
      "parameters": {
        "width": 230,
        "height": 432,
        "content": "## Update Order Record\n\n--Updates “Confirmed Orders” table with QBO Invoice ID and Number.\n\n--Keeps Airtable and QuickBooks in sync.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "7dfe52a2-7690-4351-b7d8-85b67d200dbe",
      "name": "Sticky Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3808,
        224
      ],
      "parameters": {
        "width": 230,
        "height": 432,
        "content": "## Update Customer Record\n\n--Updates existing Airtable Customer record with QBO Customer ID.\n\n--Ensures future syncs don’t recreate existing customers.\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
      }
    },
    {
      "id": "74257ded-c395-4861-8140-4d3d63ddaf0d",
      "name": "Sticky Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1184,
        128
      ],
      "parameters": {
        "width": 464,
        "height": 288,
        "content": "## Airtable Structure Requirements\n\n* [Airtable Streucture Requirement](https://drive.google.com/drive/folders/1dE4sXikesaTpLE-Pc-VU3mqg0fMZ8EDU)"
      }
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Get Airtable Orders Records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Products": {
      "main": [
        [
          {
            "node": "Search Product ID",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse in HTTP": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Append Customers": {
      "main": [
        [
          {
            "node": "Get Products",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Data Preparation": {
      "main": [
        [
          {
            "node": "Parse in HTTP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items1": {
      "main": [
        [],
        [
          {
            "node": "Create Invoice URL",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create a customer": {
      "main": [
        [
          {
            "node": "Append Customers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Search Product ID": {
      "main": [
        [
          {
            "node": "Data Preparation",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Invoice URL": {
      "main": [
        [
          {
            "node": "Create Invoice record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Order record": {
      "main": [
        [
          {
            "node": "Update Customer Record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Customer Details": {
      "main": [
        [
          {
            "node": "QuickBooks - Find Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Invoice record": {
      "main": [
        [
          {
            "node": "Update Order record",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "If Invoice not Created": {
      "main": [
        [
          {
            "node": "Get Customer Details",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update Customer Record": {
      "main": [
        [
          {
            "node": "Loop Over Items1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "QuickBooks - Find Customer": {
      "main": [
        [
          {
            "node": "IF - Customer doesn't Exists?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Airtable Orders Records": {
      "main": [
        [
          {
            "node": "If Invoice not Created",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "IF - Customer doesn't Exists?": {
      "main": [
        [
          {
            "node": "Create a customer",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Append Customers",
            "type": "main",
            "index": 1
          }
        ]
      ]
    }
  }
}