販売税計算 API と Google Sheets を使って販売税の自動計算

中級

これはInvoice Processing, Multimodal AI分野の自動化ワークフローで、9個のノードを含みます。主にCode, FormTrigger, HttpRequest, GoogleSheetsなどのノードを使用。 売上税計算APIとGoogle Sheetsを使った自動売上税計算の実装

前提条件
  • ターゲットAPIの認証情報が必要な場合あり
  • Google Sheets API認証情報
ワークフロープレビュー
ノード接続関係を可視化、ズームとパンをサポート
ワークフローをエクスポート
以下のJSON設定をn8nにインポートして、このワークフローを使用できます
{
  "meta": {
    "instanceId": "60c025075753afcab9f803964b4caaca9402f435deb4efafbb8e3b93b54d8752",
    "templateCredsSetupCompleted": true
  },
  "nodes": [
    {
      "id": "cfc7a7c6-8ac4-4c18-a0f2-f30572e393f1",
      "name": "フォーム送信時",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        0,
        0
      ],
      "webhookId": "a85a8033-1f39-498d-901e-0392e2bff50b",
      "parameters": {
        "options": {},
        "formTitle": "Sales Tax Calculator",
        "formFields": {
          "values": [
            {
              "fieldLabel": "street",
              "placeholder": "321 Birch Road, Suite 400",
              "requiredField": true
            },
            {
              "fieldLabel": "city",
              "placeholder": "Saint Paul",
              "requiredField": true
            },
            {
              "fieldLabel": "state",
              "placeholder": "MN",
              "requiredField": true
            },
            {
              "fieldLabel": "zip",
              "placeholder": "55102"
            }
          ]
        },
        "formDescription": "Sales Tax Calculator"
      },
      "typeVersion": 2.2
    },
    {
      "id": "a1416047-5dc9-4514-b83d-d0b76f4ce92e",
      "name": "販売税を計算",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        280,
        0
      ],
      "parameters": {
        "url": "https://sales-tax-calculator5.p.rapidapi.com/salestax.php",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "contentType": "multipart-form-data",
        "sendHeaders": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "street",
              "value": "={{ $json.street }}"
            },
            {
              "name": "city",
              "value": "={{ $json.city }}"
            },
            {
              "name": "state",
              "value": "={{ $json.state }}"
            },
            {
              "name": "zip",
              "value": "={{ $json.zip }}"
            }
          ]
        },
        "headerParameters": {
          "parameters": [
            {
              "name": "x-rapidapi-host",
              "value": "sales-tax-calculator5.p.rapidapi.com"
            },
            {
              "name": "x-rapidapi-key",
              "value": "your key"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "27ad345c-347e-4b57-a6be-b9d610163013",
      "name": "再フォーマット",
      "type": "n8n-nodes-base.code",
      "position": [
        580,
        0
      ],
      "parameters": {
        "jsCode": "let rows = [];\nlet totalTaxRate = 0;\n\n// Iterate over the rate_details in the input data\n$input.first().json.rate_details.forEach(tax => {\n  // Push each row with the necessary columns (Tax Agency, Tax Rate, Overall Tax Rate)\n  rows.push([\n    tax.tax_agency,  // Tax Agency\n    tax.tax_rate,    // Tax Rate\n    tax.tax_rate     // Overall Tax Rate (same for each agency in this case)\n  ]);\n\n  // Accumulate the overall tax rate for the total\n  totalTaxRate += tax.tax_rate;\n});\n\n// Add the total row at the end\nrows.push([\n  \"Total\",               // Label for Total\n  \"\",                    // Empty field for Tax Rate\n  totalTaxRate           // Sum of all Tax Rates\n]);\n\n// Return the rows so they can be used by the next node\nreturn [{ json: { rows } }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "8c9c5b39-9e87-47e5-8883-ab0d389feef2",
      "name": "Googleスプレッドシートに追加",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        860,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "rows": "={{ $json.rows }}"
          },
          "schema": [
            {
              "id": "rows",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "rows",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "rows"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": "Sales tax"
        },
        "authentication": "serviceAccount"
      },
      "credentials": {
        "googleApi": {
          "id": "Rt0RWApx8PL9t0RF",
          "name": "Google Docs account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "8c3b0d7d-724d-46a1-afad-8667e5e285dc",
      "name": "付箋",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -980,
        -220
      ],
      "parameters": {
        "width": 840,
        "height": 740,
        "content": "# Sales Tax Calculator Automation Workflow for Accurate Tax Calculation\n\n## Description:\nThis automation workflow calculates and stores sales tax rates based on user-provided address information using a form submission. It integrates with the Sales Tax API, processes the data, and stores results in a Google Sheet for easy access.\n\n---\n\n## 1. **On Form Submission: Capture User Data**\n   - Triggers when a user submits the sales tax form, capturing essential address information (street, city, state, zip).\n\n## 2. **Calculate Sales Tax: Fetch Tax Rates from API**\n   - Sends a POST request to the Sales Tax API to fetch the tax rates based on the submitted address data.\n\n## 3. **Reformat API Response: Structure Tax Data**\n   - Processes and reformats the API response into a structured format with tax agencies, rates, and total tax calculations.\n\n## 4. **Append to Google Sheets: Store Tax Information**\n   - Appends the processed tax rate data into a Google Sheets document for easy storage and future use.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "9559eeaf-51c1-4152-81e6-30ec41313f39",
      "name": "付箋1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "**On Form Submission: Capture User Data**\n   - Triggers when a user submits the sales tax form, capturing essential address information (street, city, state, zip).\n"
      },
      "typeVersion": 1
    },
    {
      "id": "3cfb2193-a954-46cd-9415-bfb7dec61cd2",
      "name": "付箋2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        220,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": " **Calculate Sales Tax: Fetch Tax Rates from API**\n   - Sends a POST request to the Sales Tax API to fetch the tax rates based on the submitted address data.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cdaf7d69-c546-4635-993d-e1ac04c78c31",
      "name": "付箋3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "**Reformat API Response: Structure Tax Data**\n   - Processes and reformats the API response into a structured format with tax agencies, rates, and total tax calculations.\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2a795c35-837b-4c30-85f3-38fd1681129f",
      "name": "付箋4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        -160
      ],
      "parameters": {
        "height": 320,
        "content": "**Append to Google Sheets: Store Tax Information**\n   - Appends the processed tax rate data into a Google Sheets document for easy storage and future use."
      },
      "typeVersion": 1
    }
  ],
  "pinData": {},
  "connections": {
    "27ad345c-347e-4b57-a6be-b9d610163013": {
      "main": [
        [
          {
            "node": "8c9c5b39-9e87-47e5-8883-ab0d389feef2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "cfc7a7c6-8ac4-4c18-a0f2-f30572e393f1": {
      "main": [
        [
          {
            "node": "a1416047-5dc9-4514-b83d-d0b76f4ce92e",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "a1416047-5dc9-4514-b83d-d0b76f4ce92e": {
      "main": [
        [
          {
            "node": "27ad345c-347e-4b57-a6be-b9d610163013",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
よくある質問

このワークフローの使い方は?

上記のJSON設定コードをコピーし、n8nインスタンスで新しいワークフローを作成して「JSONからインポート」を選択、設定を貼り付けて認証情報を必要に応じて変更してください。

このワークフローはどんな場面に適していますか?

中級 - 請求書処理, マルチモーダルAI

有料ですか?

このワークフローは完全無料です。ただし、ワークフローで使用するサードパーティサービス(OpenAI APIなど)は別途料金が発生する場合があります。

関連ワークフロー

トップクラスのリバーシブルリンクチェッカーAPIを使ってサイトのリバーシブルリンクを分析し、Google Sheetsに記録
トップクラスのバックリンクチェッカーAPIを使ってサイトのバックリンクを分析し、Google Sheetsに記録
Code
Form Trigger
Http Request
+
Code
Form Trigger
Http Request
13 ノードSk developer
市場調査
RapidAPIとGoogle SheetsでSEOキーワード分析を自動化
RapidAPIとGoogle シートを使ったSEOキーワード分析の自動化
Code
Form Trigger
Http Request
+
Code
Form Trigger
Http Request
9 ノードSk developer
市場調査
ドメイン権威指標をバッチで確認し、結果をGoogleテーブルに記録
RapidAPI を使用してドメイン権威性指標をバッチで確認し、Google スプレッドシートに記録
Code
Form Trigger
Http Request
+
Code
Form Trigger
Http Request
9 ノードSk developer
市場調査
Sora GPT、Google Drive、Sheetsを使ってAI画像を生成して保存
Sora GPT、Google Drive、Sheets を使用して AI 画像を生成して保存
Code
Form Trigger
Google Drive
+
Code
Form Trigger
Google Drive
11 ノードSk developer
コンテンツ作成
RapidAPI と Google Sheets を使用した自動類似度検出とメールリポート
RapidAPI と Google スプレッドシートで自動類似チェックとメールリポート
If
Code
Email Send
+
If
Code
Email Send
19 ノードSk developer
コンテンツ作成
RapidAPI統合を通じてSlideshareプレゼンテーションをGoogleドライブにダウンロード
RapidAPI統合でSlideshareのプレゼンテーションをGoogleデリカレントダウンロード
If
Wait
Form Trigger
+
If
Wait
Form Trigger
17 ノードSk developer
ファイル管理
ワークフロー情報
難易度
中級
ノード数9
カテゴリー2
ノードタイプ5
難易度説明

経験者向け、6-15ノードの中程度の複雑さのワークフロー

外部リンク
n8n.ioで表示

このワークフローを共有

カテゴリー

カテゴリー: 34