{
  "name": "Log Stripe payments to Google Sheets and Slack",
  "nodes": [
    {
      "parameters": {
        "content": "## Stripe payments to Google Sheets\nEvery successful Stripe payment is added as a row in Google Sheets and announced in Slack.\n\n1. Add a Stripe credential with a **restricted key** that can read charges and manage webhook endpoints. n8n registers the webhook in Stripe for you.\n2. Connect Google Sheets and pick your sheet. Header row: date, amount, currency, email, description, payment_id.\n3. Connect Slack and pick a channel, or delete that node.\n4. Activate the workflow. Your n8n must be reachable over HTTPS.\n\nFree template by [serverserv](https://serverserv.com/n8n-templates.html). MIT licence.",
        "height": 360,
        "width": 440,
        "color": 7
      },
      "id": "f6ed5117-e8df-5cb8-8861-0927c1729421",
      "name": "Setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -140,
        -300
      ]
    },
    {
      "parameters": {
        "events": [
          "charge.succeeded"
        ]
      },
      "id": "e4e3449e-7de3-5c33-bf5b-cb28601996c5",
      "name": "Payment succeeded",
      "type": "n8n-nodes-base.stripeTrigger",
      "typeVersion": 1,
      "position": [
        0,
        120
      ],
      "webhookId": "7da0f4f0-5cc4-53ba-abeb-7a2417ea32ca"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a0",
              "name": "date",
              "value": "={{ DateTime.fromSeconds($json.data.object.created).toISO() }}",
              "type": "string"
            },
            {
              "id": "a1",
              "name": "amount",
              "value": "={{ $json.data.object.amount / 100 }}",
              "type": "number"
            },
            {
              "id": "a2",
              "name": "currency",
              "value": "={{ ($json.data.object.currency || '').toUpperCase() }}",
              "type": "string"
            },
            {
              "id": "a3",
              "name": "email",
              "value": "={{ $json.data.object.billing_details?.email || $json.data.object.receipt_email || '' }}",
              "type": "string"
            },
            {
              "id": "a4",
              "name": "description",
              "value": "={{ $json.data.object.description || '' }}",
              "type": "string"
            },
            {
              "id": "a5",
              "name": "payment_id",
              "value": "={{ $json.data.object.id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "33533b77-7c9d-5211-80a2-1198bca48333",
      "name": "Pick fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        220,
        120
      ]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": {
          "__rl": true,
          "mode": "url",
          "value": ""
        },
        "sheetName": {
          "__rl": true,
          "mode": "name",
          "value": "Sheet1"
        },
        "columns": {
          "mappingMode": "autoMapInputData",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "2d2c117c-af06-5ee0-8098-e1d3f2bc933d",
      "name": "Add row",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [
        440,
        120
      ]
    },
    {
      "parameters": {
        "select": "channel",
        "channelId": {
          "__rl": true,
          "mode": "name",
          "value": "#sales"
        },
        "text": "=New payment: {{ $('Pick fields').item.json.amount }} {{ $('Pick fields').item.json.currency }} from {{ $('Pick fields').item.json.email || 'unknown' }}",
        "otherOptions": {}
      },
      "id": "2c0cf964-1b72-51f7-8c09-8aedc7b99913",
      "name": "Announce in Slack",
      "type": "n8n-nodes-base.slack",
      "typeVersion": 2.3,
      "position": [
        660,
        120
      ]
    }
  ],
  "connections": {
    "Payment succeeded": {
      "main": [
        [
          {
            "node": "Pick fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Pick fields": {
      "main": [
        [
          {
            "node": "Add row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Add row": {
      "main": [
        [
          {
            "node": "Announce in Slack",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  },
  "tags": []
}