Getting started with Pinch n8n integration
This guide will walk you through setting up and using the Pinch Payments nodes in your n8n workflows.
Prerequisites
Before you begin, you'll need:
- An n8n instance (self-hosted or n8n Cloud)
- A Pinch Payments account
- API credentials from your Pinch dashboard
Step 1: Install the Pinch Nodes
- Go to Settings → Community Nodes
- Click Install a community node
- Enter
n8n-nodes-pinchand click Install - Restart n8n if prompted
Step 2: Get Your Pinch API Credentials
- Log in to your Pinch Dashboard
- Navigate to API Keys
- Create a new Application (if you haven't already)
- Copy your Application ID and Secret Key
Important: Use Development keys for testing and Live keys for production. Development keys work with the test API and won't process real payments.
Step 3: Configure Credentials in n8n
- In n8n, go to Credentials → Add Credential
- Search for and select Pinch API
- Enter your credentials:
- Application ID: Your Pinch Application ID
- Secret Key: Your Pinch Secret Key
- Environment: Select
Testfor development orLivefor production
- Click Save - n8n will automatically test the connection
Step 4: Create Your First Workflow
Example 1: Create a Payer and Payment Link
This workflow creates a new payer and generates a payment link for them.
- Create a new workflow
- Add a Manual Trigger node (or any trigger you prefer)
- Add a Pinch node and configure:
- Credential: Select your Pinch API credential
- Resource: Payer
- Operation: Create
- Full Name: Enter the payer's name (e.g.,
John Smith) - Email Address: Enter their email (e.g.,
[email protected])
- Add another Pinch node connected to the first:
- Resource: Payment Link
- Operation: Create
- Amount: Enter amount in cents (e.g.,
5000for $50.00) - Payer ID: Use expression
{{ $json.id }}to reference the created payer - Description:
Invoice Payment - Return URL: Your thank-you page URL
- Allowed Payment Methods: Select Credit Card and/or Bank Account
- Execute the workflow
The output will include a url field - this is the payment link you can send to your customer.
Example 2: Listen for Payment Events
This workflow triggers when payments are processed.
- Create a new workflow
- Add a Pinch Trigger node:
- Credential: Select your Pinch API credential
- Events: Select
Realtime PaymentandBank Results
- Add any nodes to process the payment data (e.g., send email, update database)
- Activate the workflow
Once activated, n8n will automatically register a webhook with Pinch. When payments are processed, your workflow will receive the event data.
Example 3: Retrieve Payer Information
This workflow looks up a payer and their payment history.
- Create a new workflow
- Add a trigger (Manual, Schedule, Webhook, etc.)
- Add a Pinch node:
- Resource: Payer
- Operation: Get
- Payer ID: The payer's ID (e.g.,
pyr_abc123)
- Add another Pinch node:
- Resource: Payment
- Operation: For Payer
- Payer ID:
{{ $json.id }}or the same payer ID
- Execute to retrieve the payer's details and payment history
Common Use Cases
Automated Invoice Payments
- Trigger when an invoice is created in your system
- Create a payer (or look up existing)
- Create a payment link with the invoice amount
- Send the payment link via email
Payment Notifications
- Use Pinch Trigger to listen for
Realtime Paymentevents - When a payment is received, send a confirmation email
- Update your database or CRM with the payment status
Subscription Management
- Listen for
Subscription Created,Subscription Cancelled, andSubscription Completeevents - Sync subscription status with your application
- Trigger onboarding or offboarding workflows
Failed Payment Handling
- Listen for
Bank Resultsevents - Check for dishonoured payments
- Send retry notifications or update customer records
Tips and Best Practices
Testing
- Always use Development/Test credentials when building workflows
- Pinch provides test card numbers and bank accounts for testing
- Check the Pinch Testing Guide for test credentials
Error Handling
- Enable Continue on Fail in Pinch nodes to handle errors gracefully
- Use an IF node to check response status and branch accordingly
- Log errors to track failed API calls
Pagination
When listing payers or payment links:
- Use the Page and Page Size parameters to paginate through large result sets
- Maximum page size is 500 items
Webhooks
- Webhooks are automatically managed by the Pinch Trigger node
- Activating a workflow creates the webhook; deactivating deletes it
- You can select multiple events per trigger or use "All" to receive everything
Troubleshooting
Credentials Test Fails
- Double-check your Application ID and Secret Key
- Ensure you're using the correct environment (Test vs Live)
- Verify your Pinch account is active
Webhook Not Receiving Events
- Make sure your workflow is Activated (not just saved)
- Check that your n8n instance is publicly accessible (webhooks require a public URL)
- Verify the events are actually occurring in Pinch
Payment Link Not Working
- Ensure the payer ID exists in Pinch
- Check that the amount is in cents (not dollars)
- Verify the return URL is valid
Next Steps
- Explore the Pinch API Documentation for more details on each endpoint
- Check out the n8n Documentation for workflow building tips
- Join the n8n Community for help and inspiration
Got feedback on this feature?
Send an email to [email protected] or book in a chat with our API team.
Updated 21 days ago
