BTCPay Trigger icon

BTCPay Trigger

Starts the workflow on a BTCPay event

Overview

This node triggers an n8n workflow when a specific event occurs in a BTCPay Server store. It is designed to listen for events such as the completion of a payment request, allowing automation workflows to react immediately to changes in payment status.

Common scenarios include:

  • Automatically processing orders or updating databases when a payment is completed.
  • Sending notifications or alerts upon successful payments.
  • Integrating BTCPay Server payment events with other systems like CRMs, accounting software, or messaging platforms.

For example, when a customer completes a payment, this node can trigger a workflow that updates the order status in your system and sends a confirmation email.

Properties

Name Meaning
Store Name or ID Select the BTCPay Server store from which to receive events. You can choose from a list or specify an ID using an expression. This determines the source of the webhook events triggering the workflow.
Event The type of event that triggers the workflow. Currently, only "Payment Request Completed" is supported, which corresponds to the "PaymentRequestStatusChanged" event with a status of "Completed".
(Notice) Store Selection Information A notice shown if no stores are available, suggesting to check API key permissions related to viewing store settings.
(Notice) Webhook Information Informs that the node automatically creates the necessary webhook in the selected BTCPay Server store when the workflow is activated, so manual webhook creation is not needed.
(Notice) Webhook Testing Provides guidance on testing the webhook by triggering the "Payment Request Status Changed" event in BTCPay Server. Notes that test events will have a "Pending" status and output includes the payment request ID.

Output

The node outputs JSON data representing the event payload received from BTCPay Server when the specified event occurs.

  • For the "Payment Request Completed" event, the output contains details about the payment request, including its ID, status, and other relevant information.
  • If the event does not meet the criteria (e.g., status is not "Completed"), the node discards the event and does not trigger the workflow.
  • The output JSON structure matches the BTCPay Server webhook payload for the event, enabling downstream nodes to access all event details.

No binary data output is produced by this node.

Dependencies

  • Requires a valid API key credential with appropriate permissions on the BTCPay Server, specifically permission to view store settings and manage webhooks.
  • The node automatically manages webhook registration on the BTCPay Server for the selected store.
  • No additional external dependencies beyond the BTCPay Server API and the provided API key.

Troubleshooting

  • Invalid signature error (HTTP 403):
    This indicates that the webhook request's signature verification failed. Ensure that the webhook secret stored in the node matches the one configured on BTCPay Server. This secret is managed automatically but may require re-creation if out of sync.

  • No stores available in the dropdown:
    Verify that the API key used has the required permission to view store settings (btcpay.store.canviewstoresettings). Without this permission, the node cannot list stores.

  • Event not triggering the workflow:
    Confirm that the event selected is supported ("Payment Request Completed") and that the payment request status is actually "Completed". Other statuses or unsupported events will be ignored.

  • Webhook creation errors:
    Errors during webhook creation or deletion usually relate to API permission issues or network problems. Check API key validity and connectivity to the BTCPay Server.

Links and References

Discussion