pleo

n8n community node for Pleo expense management - query expenses, receipts, and trigger on export events

Package Information

Released: 10 mo ago
Downloads: 11 weekly / 91 monthly
Latest Version: 0.1.0-beta.1
Author: Dimitri Pietersz

Documentation

n8n-nodes-pleo

n8n community node for Pleo expense management. Query expenses, check receipt status, and trigger workflows on export events. Integrates Pleo with 400+ apps via n8n automation.

npm version
License: MIT

Table of Contents

Features

  • Expenses Resource: Query single expenses or list many with filters
  • Receipts Resource: Access receipt data for any expense
  • Export Trigger: Receive webhook notifications when exports are created
  • Secure Webhooks: HMAC signature verification for webhook security
  • Tool Integration: Nodes are usable as AI tools in n8n

Installation

Community Nodes (Recommended)

  1. Open your n8n instance
  2. Go to Settings > Community Nodes
  3. Click Install a community node
  4. Enter n8n-nodes-pleo and click Install
  5. Restart n8n when prompted

Manual Installation

If you're running n8n with npm:

cd ~/.n8n/custom
npm install n8n-nodes-pleo

If you're running n8n with Docker, add to your n8n-custom-extensions volume:

npm install n8n-nodes-pleo

Then restart n8n.

Credentials

This package provides two credential types to support both Pleo APIs.

Pleo API Credential

Used for querying expenses and receipts via the Legacy API.

How to get your API Token:

  1. Log in to the Pleo Developer Portal
  2. Navigate to your application or create a new one
  3. Generate an API token with appropriate scopes
  4. Copy the Bearer token

Configuration:

Field Description
API Token Your Pleo Bearer token

The credential test will verify access to the expenses endpoint.

Pleo Webhook API Credential

Used for webhook subscriptions via the External API.

How to get your API Key and Signing Secret:

  1. Log in to the Pleo Developer Portal
  2. Navigate to Webhooks configuration
  3. Copy your API Key for authentication
  4. Copy your Signing Secret for webhook signature verification

Configuration:

Field Description
API Key Your Pleo API key (used in Basic auth header)
Signing Secret Secret for HMAC signature verification of incoming webhooks

Node Reference

Pleo Node

The Pleo node provides access to Pleo data through the Legacy API.

Resources

Expenses

Get

  • Retrieves a single expense by ID
  • Parameters:
    • expenseId (required): The ID of the expense to retrieve

Get Many

  • Retrieves multiple expenses with optional filters
  • Parameters:
    • Limit: Maximum number of expenses to return (1-100)
    • Filters (optional collection):
      • dateFrom: Filter expenses from this date
      • dateTo: Filter expenses until this date
      • types: Filter by expense types (CARD, PERSONAL_TRANSFER, INVOICE, ADJUSTMENT, MILEAGE, PER_DIEM)
      • status: Filter by status (NOT_EXPORTED, EXPORTING, EXPORTED, PENDING_APPROVAL, REJECTED)
      • accountId: Filter by account ID
      • tagId: Filter by tag ID
      • pageOffset: Pagination offset
Receipts

Get

  • Retrieves a single receipt
  • Parameters:
    • expenseId (required): The ID of the expense
    • receiptId (required): The ID of the receipt

Get Many

  • Retrieves all receipts for an expense
  • Parameters:
    • expenseId (required): The ID of the expense

Pleo Trigger Node

The Pleo Trigger node listens for webhook events from Pleo.

Events

Event Description
Export Job Created Triggers when an export job is created in Pleo

Webhook Security

The Pleo Trigger automatically verifies incoming webhook signatures using HMAC-SHA256. This ensures that webhook payloads are authentic and haven't been tampered with.

The signature verification uses:

  • webhook-id header
  • webhook-timestamp header
  • webhook-signature header (format: v1,{base64-signature})
  • Your signing secret from credentials

Usage Examples

Get a Single Expense

{
  "nodes": [
    {
      "name": "Pleo",
      "type": "n8n-nodes-pleo.pleo",
      "parameters": {
        "resource": "expense",
        "operation": "get",
        "expenseId": "abc123-expense-id"
      }
    }
  ]
}

Get Expenses with Filters

Retrieve card expenses from the last 30 days that haven't been exported:

{
  "nodes": [
    {
      "name": "Pleo",
      "type": "n8n-nodes-pleo.pleo",
      "parameters": {
        "resource": "expense",
        "operation": "getAll",
        "limit": 50,
        "filters": {
          "types": ["CARD"],
          "status": "NOT_EXPORTED",
          "dateFrom": "={{ $now.minus(30, 'days').toISO() }}",
          "dateTo": "={{ $now.toISO() }}"
        }
      }
    }
  ]
}

Get Receipts for an Expense

{
  "nodes": [
    {
      "name": "Pleo",
      "type": "n8n-nodes-pleo.pleo",
      "parameters": {
        "resource": "receipt",
        "operation": "getAll",
        "expenseId": "abc123-expense-id"
      }
    }
  ]
}

Trigger on Export Events

The Pleo Trigger node activates when export events occur:

{
  "nodes": [
    {
      "name": "Pleo Trigger",
      "type": "n8n-nodes-pleo.pleoTrigger",
      "parameters": {
        "event": "v2.export.job-created"
      },
      "webhookId": "auto-generated"
    }
  ]
}

Example Workflows

Missing Receipt Alert

Create a workflow that alerts your team about expenses missing receipts:

[Schedule Trigger] -> [Pleo: Get Expenses] -> [Filter: No Receipts] -> [Slack: Send Alert]

Workflow JSON:

{
  "name": "Missing Receipt Alert",
  "nodes": [
    {
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "parameters": {
        "rule": {
          "interval": [{ "field": "days", "daysInterval": 1 }]
        }
      },
      "position": [250, 300]
    },
    {
      "name": "Get Expenses",
      "type": "n8n-nodes-pleo.pleo",
      "parameters": {
        "resource": "expense",
        "operation": "getAll",
        "limit": 100,
        "filters": {
          "status": "NOT_EXPORTED",
          "types": ["CARD"]
        }
      },
      "position": [450, 300],
      "credentials": {
        "pleoApi": "Pleo API"
      }
    },
    {
      "name": "Filter No Receipts",
      "type": "n8n-nodes-base.filter",
      "parameters": {
        "conditions": {
          "boolean": [
            {
              "value1": "={{ $json.receiptIds.length }}",
              "operation": "equals",
              "value2": 0
            }
          ]
        }
      },
      "position": [650, 300]
    },
    {
      "name": "Slack Alert",
      "type": "n8n-nodes-base.slack",
      "parameters": {
        "channel": "#expense-alerts",
        "text": "Missing receipt alert: {{ $json.merchant }} - {{ $json.amount.value }} {{ $json.amount.currency }}"
      },
      "position": [850, 300],
      "credentials": {
        "slackApi": "Slack API"
      }
    }
  ],
  "connections": {
    "Schedule Trigger": {
      "main": [[{ "node": "Get Expenses", "type": "main", "index": 0 }]]
    },
    "Get Expenses": {
      "main": [[{ "node": "Filter No Receipts", "type": "main", "index": 0 }]]
    },
    "Filter No Receipts": {
      "main": [[{ "node": "Slack Alert", "type": "main", "index": 0 }]]
    }
  }
}

Export Notification to Slack

Notify your accounting team when exports are ready:

[Pleo Trigger: Export Created] -> [Slack: Post Message]

Workflow JSON:

{
  "name": "Export Notification",
  "nodes": [
    {
      "name": "Pleo Trigger",
      "type": "n8n-nodes-pleo.pleoTrigger",
      "parameters": {
        "event": "v2.export.job-created"
      },
      "position": [250, 300],
      "credentials": {
        "pleoWebhookApi": "Pleo Webhook API"
      }
    },
    {
      "name": "Slack",
      "type": "n8n-nodes-base.slack",
      "parameters": {
        "channel": "#accounting",
        "text": "New Pleo export ready! Export ID: {{ $json.data.id }}"
      },
      "position": [450, 300],
      "credentials": {
        "slackApi": "Slack API"
      }
    }
  ],
  "connections": {
    "Pleo Trigger": {
      "main": [[{ "node": "Slack", "type": "main", "index": 0 }]]
    }
  }
}

Resources

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone the repository
git clone https://github.com/dpietersz/n8n-nodes-pleo.git

# Install dependencies
npm install

# Build the node
npm run build

# Run tests
npm test

# Run linting
npm run lint

License

MIT - see the LICENSE.md file for details.


Made with care by Dimitri Pietersz

Discussion