NewInvoiceTrigger icon

NewInvoiceTrigger

Triggers when a new invoice is created

Overview

The NewInvoiceTrigger node is a trigger for n8n workflows that activates when a new invoice is created in Stripe. It sets up a webhook with Stripe to listen for the invoiceitem.created event and passes the received data into your workflow. This node is useful for automating actions in response to new invoices, such as sending notifications, updating databases, or integrating with other systems.

Practical examples:

  • Automatically send an email notification when a new invoice is generated.
  • Sync new invoice data to a CRM or accounting system.
  • Trigger custom business logic whenever a new invoice appears in Stripe.

Properties

Name Type Meaning
Webhook URL String The URL where you want to receive notifications about new invoices.

Output

The node outputs the JSON payload received from Stripe's webhook for the invoiceitem.created event. The structure of this output matches Stripe's webhook event object for invoice items. Example output:

{
  "id": "evt_1Example",
  "object": "event",
  "api_version": "2020-08-27",
  "created": 1610000000,
  "data": {
    "object": {
      "id": "ii_1Example",
      "object": "invoiceitem",
      // ...other invoice item fields
    }
  },
  "livemode": false,
  "pending_webhooks": 1,
  "request": {
    "id": null,
    "idempotency_key": null
  },
  "type": "invoiceitem.created"
}

Note: The actual structure may include additional fields depending on Stripe's API version and configuration.

Dependencies

  • Stripe Account: You must have a valid Stripe account.
  • Stripe API Key: The node requires Stripe API credentials (API key) configured in n8n under the name StripeApi.
  • n8n Webhook URL: Your n8n instance must be accessible from the internet so Stripe can reach the webhook endpoint.

Troubleshooting

  • Webhook Not Triggering: Ensure your n8n instance is publicly accessible and the webhook URL is correct.
  • Invalid API Key: If the Stripe API key is incorrect or missing, authentication will fail. Double-check your credentials in n8n.
  • "Already subscribe" Message: If the webhook already exists in Stripe, the node will not create a duplicate but reuse the existing one.
  • Deletion Errors: If the webhook cannot be deleted (e.g., due to network issues or invalid credentials), the node may silently fail to remove it.

Links and References

Discussion