{
  "schema_version": "1.0.0",
  "id": "xero-invoice-ar-log",
  "title": "Log new Xero invoices and add a due-date reminder",
  "category": "finance",
  "difficulty": "beginner",
  "featured": false,
  "description": "Copy every new Xero sales invoice into a receivables sheet and put a reminder on the calendar for the day it falls due.",
  "tags": [
    "xero",
    "accounts-receivable",
    "google-sheets",
    "google-calendar"
  ],
  "apps": [
    "Xero",
    "Google Sheets",
    "Google Calendar"
  ],
  "plan": {
    "minimum": "Professional",
    "reasons": [
      "multi-step Zap: 2 steps after the trigger",
      "premium app: Xero"
    ]
  },
  "tasks": {
    "typical": 2,
    "max": 2
  },
  "trigger": {
    "app": "Xero",
    "event": "New Sales Invoice",
    "kind": "polling",
    "title": "New sales invoice",
    "why": "Fires when a sales invoice is created in Xero.",
    "config": {
      "Organization": "YOUR_XERO_ORGANISATION"
    },
    "outputs": [
      "invoice_id",
      "invoice_number",
      "contact_name",
      "contact_email",
      "total",
      "currency_code",
      "date",
      "due_date",
      "status"
    ],
    "sample": "sample-trigger.json"
  },
  "steps": [
    {
      "key": "log",
      "kind": "action",
      "app": "Google Sheets",
      "event": "Create Spreadsheet Row",
      "title": "Add it to the receivables sheet",
      "why": "The sheet is the collections list: one row per invoice, with a paid column you tick.",
      "fields": {
        "Drive": "My Google Drive",
        "Spreadsheet": "Receivables",
        "Worksheet": "Invoices",
        "Columns": {
          "invoice_number": "{{trigger.invoice_number}}",
          "client": "{{trigger.contact_name}}",
          "contact_email": "{{trigger.contact_email}}",
          "amount": "{{trigger.total}}",
          "currency": "{{trigger.currency_code}}",
          "issued": "{{trigger.date}}",
          "due_date": "{{trigger.due_date}}",
          "paid": "no"
        }
      },
      "outputs": [
        "id",
        "row_number"
      ]
    },
    {
      "key": "remind",
      "kind": "action",
      "app": "Google Calendar",
      "event": "Quick Add Event",
      "title": "Add a due-date reminder",
      "why": "Quick Add reads plain English, so the reminder lands at 9am on the due date.",
      "fields": {
        "Calendar": "YOUR_CALENDAR",
        "Describe Event": "Check payment: {{trigger.contact_name}} invoice {{trigger.invoice_number}} ({{trigger.total}} {{trigger.currency_code}}) on {{trigger.due_date}} at 9am"
      },
      "outputs": [
        "id",
        "html_link"
      ]
    }
  ]
}
