{
  "nodes": [
    {
      "id": "8690a0d3-8280-47f4-b60e-20f3046bebc1",
      "name": "New Payout",
      "type": "n8n-nodes-base.stripeTrigger",
      "position": [
        0,
        0
      ],
      "parameters": {
        "events": [
          "payout.paid"
        ]
      },
      "credentials": {
        "stripeApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3b7c1c9c-7384-48ef-a4f5-fe1bdd8ec1b9",
      "name": "Record in Wave Accounting",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        280,
        0
      ],
      "parameters": {
        "url": "https://gql.waveapps.com/graphql/public",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n    \"query\": \"mutation ($input: MoneyTransactionCreateInput!) { moneyTransactionCreate(input: $input) { didSucceed inputErrors { path message code } transaction { id } } }\",\n    \"variables\": {\n      \"input\": {\n        \"businessId\": \"BUSINESS ID HERE\",\n        \"externalId\": \"stripe-payout-{{ $json.created.toDateTime('s').format('yyyy-MM-dd') }}\",\n        \"date\": \"{{ $json.created.toDateTime('s').format('yyyy-MM-dd') }}\",\n        \"description\": \"Payout from Stripe - ${{ ($json.data.object.amount / 100).toFixed(2) }} total\",\n        \"anchor\": {\n          \"accountId\": \"ANCHOR ACCOUNT ID HERE\",\n          \"amount\": {{ ($json.data.object.amount / 100).toFixed(2) }},\n          \"direction\": \"DEPOSIT\"\n        },\n        \"lineItems\": [\n          {\n            \"accountId\": \"DEPOSIT ACCOUNT ID HERE\",\n            \"amount\": {{ ($json.data.object.amount / 100).toFixed(2) }},\n            \"balance\": \"INCREASE\",\n            \"taxes\": [\n              {\n                \"salesTaxId\": \"SALES TAX ACCOUNT ID HERE - EXAMPLE BELOW IS 5% TAX BAKED INTO TOTAL AMOUNT\",\n                \"amount\": {{ (($json.data.object.amount / 100) - (($json.data.object.amount / 100) / 1.05)).toFixed(2) }}\n              }\n            ]\n          }\n        ]\n      }\n    }\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer YOUR_TOKEN_HERE"
            }
          ]
        }
      },
      "typeVersion": 4.2
    }
  ],
  "connections": {
    "New Payout": {
      "main": [
        [
          {
            "node": "Record in Wave Accounting",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}