Skip to main content

Create or find Stripe customers and automatically generate invoices

Workflow preview

Workflow preview
100%
Create or find Stripe customers and automatically generate invoices preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Save hours of manual billing work with this Stripe automation workflow! Designed for entrepreneurs, SaaS founders, and online business owners, this template checks if a customer already exists in S...

Best for

  • Invoice Processing automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.if, n8n-nodes-base.manualtrigger, n8n-nodes-base.set, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Audun.

Original n8n.io source

1.1 Workflow description

Title
Create or find Stripe customers and automatically generate invoices
Workflow name
Create or find Stripe customers and automatically generate invoices

Save hours of manual billing work with this Stripe automation workflow!
Designed for entrepreneurs, SaaS founders, and online business owners, this template checks if a customer already exists in Stripe based on their email. If no customer is found, it automatically creates a new one, generates a draft invoice, adds a product line item using a Stripe Price ID, and finalizes the invoice — making it ready for payment.
This workflow helps ensure clean customer data and efficient billing without manual input.

How it works

  • Search Stripe for an existing customer based on the provided email address.
  • If no customer is found, create a new one in Stripe automatically.
  • Generate a draft invoice associated with the customer.
  • Add a line item to the invoice using a Stripe Price ID.
  • Finalize the invoice to make it ready to send or collect payment.

Set up steps

  1. Stripe account setup:

    • Ensure you have a valid Stripe account.
    • Create a restricted Stripe API key with permissions to read and write Customers, Invoices, and Invoice Items.
  2. Connect Stripe to n8n:

    • Set up an HTTP Basic Auth credential in n8n using your Stripe secret API key.
    • No username is needed; the API key goes into the password field.
  3. Customize dynamic data:

    • Replace the sample email ([email protected]) with your real dynamic customer email input.
    • Replace the example Price ID (price_fromStripeDashboard) with your actual product Price ID from the Stripe dashboard.
  4. Test your workflow:

    • Manually trigger the workflow inside n8n to ensure customers and invoices are being created correctly.
    • Check your Stripe dashboard to confirm that new customers and invoices appear as expected.
  5. Deploy to production:

    • Integrate this workflow with a real trigger (e.g., webhook, form submission) to automate the process live.

Troubleshooting

  • Invalid API Key:
    Double-check that your Stripe API key is active and has the necessary permissions. Test it by making a simple API call manually if needed.

  • Invoice Creation Fails:
    Make sure you are using a valid Price ID from Stripe. The price must be active and available for the correct product.

  • Customer Not Found Error:
    If the search fails due to formatting issues, ensure emails are valid and the query syntax matches Stripe's customer search format.

  • Authentication Errors:
    If authentication fails, ensure you have selected HTTP Basic Auth in the HTTP Request nodes and left the username field empty.

Stripe prerequisites

  • You must have at least one active Price object created in your Stripe dashboard.
  • Your Stripe account must be live or have access to test mode if you're working in development.
  • Ensure your account has API access enabled for Customers, Invoices, and Products.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Get Stripe Customer

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - Customer exists?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 3 - Create customer

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 4 - Create invoice

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - Finalize invoice

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 6 - When clicking ‘Test workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 7 - Set invoice data

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 8 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Set customer id

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Add item to invoice

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

3. Summary Table

Workflow Create or find Stripe customers and automatically generate invoices
Complexity intermediate
Nodes 10
Categories Invoice Processing
Author Audun
Published 26 Apr 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/3723/3723.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create or find Stripe customers and automatically generate invoices do?

Save hours of manual billing work with this Stripe automation workflow! Designed for entrepreneurs, SaaS founders, and online business owners, this template checks if a customer already exists in S...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing use case.