n8n-nodes-pleo
v0.1.0-beta.1
Published
n8n community node for Pleo expense management - query expenses, receipts, and trigger on export events
Maintainers
Readme
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.
Table of Contents
- Features
- Installation
- Credentials
- Node Reference
- Usage Examples
- Example Workflows
- Resources
- Contributing
- License
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)
- Open your n8n instance
- Go to Settings > Community Nodes
- Click Install a community node
- Enter
n8n-nodes-pleoand click Install - Restart n8n when prompted
Manual Installation
If you're running n8n with npm:
cd ~/.n8n/custom
npm install n8n-nodes-pleoIf you're running n8n with Docker, add to your n8n-custom-extensions volume:
npm install n8n-nodes-pleoThen 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:
- Log in to the Pleo Developer Portal
- Navigate to your application or create a new one
- Generate an API token with appropriate scopes
- 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:
- Log in to the Pleo Developer Portal
- Navigate to Webhooks configuration
- Copy your API Key for authentication
- 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 datedateTo: Filter expenses until this datetypes: 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 IDtagId: Filter by tag IDpageOffset: Pagination offset
Receipts
Get
- Retrieves a single receipt
- Parameters:
expenseId(required): The ID of the expensereceiptId(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-idheaderwebhook-timestampheaderwebhook-signatureheader (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
- Pleo Developer Portal - API documentation and credential management
- n8n Community Nodes Documentation - How to use community nodes
- n8n Workflows - Discover workflow templates
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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 lintLicense
MIT - see the LICENSE.md file for details.
Made with care by Dimitri Pietersz
