{
  "name": "Cake Merchant — Google Sheets Order Log",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "cakemerchant-sheets-log",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "c1b2c3d4-0003-4000-8000-000000000001",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [250, 300],
      "webhookId": "cakemerchant-sheets-log"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            { "id": "date", "name": "Date", "value": "={{ $json.body.data.confirmed_at }}", "type": "string" },
            { "id": "chargeId", "name": "Charge ID", "value": "={{ $json.body.data.id }}", "type": "string" },
            { "id": "amountUsd", "name": "Amount USD", "value": "={{ $json.body.data.amount }}", "type": "number" },
            { "id": "amountXmr", "name": "Amount XMR", "value": "={{ $json.body.data.amount_xmr }}", "type": "number" },
            { "id": "desc", "name": "Description", "value": "={{ $json.body.data.metadata.description }}", "type": "string" },
            { "id": "status", "name": "Status", "value": "={{ $json.body.data.status }}", "type": "string" }
          ]
        },
        "options": {}
      },
      "id": "c1b2c3d4-0003-4000-8000-000000000002",
      "name": "Format Fields",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [480, 300]
    },
    {
      "parameters": {
        "operation": "append",
        "documentId": { "__rl": true, "value": "YOUR_SPREADSHEET_ID", "mode": "id" },
        "sheetName": { "__rl": true, "value": "Sheet1", "mode": "list" },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Date": "={{ $json.Date }}",
            "Charge ID": "={{ $json['Charge ID'] }}",
            "Amount USD": "={{ $json['Amount USD'] }}",
            "Amount XMR": "={{ $json['Amount XMR'] }}",
            "Description": "={{ $json.Description }}",
            "Status": "={{ $json.Status }}"
          }
        },
        "options": {}
      },
      "id": "c1b2c3d4-0003-4000-8000-000000000003",
      "name": "Append to Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [710, 300],
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "CREDENTIAL_ID",
          "name": "Google Sheets — replace with your OAuth credentials"
        }
      }
    },
    {
      "parameters": {
        "respondWith": "text",
        "responseBody": "OK"
      },
      "id": "c1b2c3d4-0003-4000-8000-000000000004",
      "name": "Respond OK",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [940, 300]
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [{ "node": "Format Fields", "type": "main", "index": 0 }]
      ]
    },
    "Format Fields": {
      "main": [
        [{ "node": "Append to Sheet", "type": "main", "index": 0 }]
      ]
    },
    "Append to Sheet": {
      "main": [
        [{ "node": "Respond OK", "type": "main", "index": 0 }]
      ]
    }
  },
  "pinData": {},
  "settings": { "executionOrder": "v1" },
  "staticData": null,
  "tags": [],
  "triggerCount": 0,
  "updatedAt": "2026-02-15T00:00:00.000Z",
  "versionId": "1"
}
