Secure and monetize your API services instantly using the x402 payment protocol within a custom n8n workflow. This n8n template utilizes the 1Shot API node for robust crypto payment verification and processing.
Download this n8n workflow template and start using it instantly.
Monetizing automated services often requires complex subscription models or traditional payment processors. This advanced n8n workflow solves this by implementing the x402 protocol, which enables pay-per-request monetization using stablecoins (ERC-20 tokens) on any EVM chain via the 1Shot API.
Instead of building custom payment logic, this n8n template provides a plug-and-play solution. The entire process—from receiving the request via an n8n trigger, decoding the payment header, verifying the signature, simulating the transaction, and finally submitting the payment—is handled automatically. If any validation fails (e.g., missing header, invalid signature, or payment failure), the workflow responds instantly with a 402 Payment Required status, ensuring only paid requests proceed to the premium service component of the n8n workflow.
This robust n8n workflow is initiated by an incoming HTTP request directed to the Webhook n8n trigger.
X-Payment header is present in the request. If missing, a 402 error response is immediately returned via the Response: Missing or Invalid Payment Headers n8n node.Response: 200 - Payment Successful node, which should be replaced by the premium service logic that the user is paying for.To deploy and utilize this powerful n8n workflow, follow these steps:
Response: 200 - Payment Successful n8n node with your specific business logic (e.g., generating content, sending data, or accessing a database). Webhook (n8n Trigger)
Function: Serves as the public-facing API endpoint, initiating the n8n workflow upon receiving an HTTP request.
Key Configuration: Response mode is set to responseNode to allow later nodes to control the HTTP response code (402 or 200).
Check for presence of X-HEADER (If n8n node)
Function: Checks if the required x-payment header exists in the incoming request data.
Key Configuration: Uses the expression ={{ $json.headers['x-payment'] }} with the operation exists.
Decode & Validate X-Payment (Code n8n node)
Function: Decodes the Base64 value of the x-payment header and parses the result into a new JSON property, decodedXPayment, which is crucial for subsequent n8n nodes.
Simulate Payment (1Shot n8n node)
Function: Interacts with the 1Shot API to cryptographically verify the payment signature and check if the funds are available and authorized, without executing the transaction.
Key Configuration: Configured with the simulate operation, passing extracted x402 parameters like from, to, value, and signature.
1Shot API Submit & Wait (1ShotSynch n8n node)
Function: Submits the validated x402 payment transaction to the blockchain via the 1Shot API and waits for on-chain confirmation before proceeding to the service delivery part of the n8n workflow.
Response: Missing or Invalid Payment Headers (Respond to Webhook n8n node)
* Function: Returns a 402 'Payment Required' response code, informing the caller that the request lacked the necessary payment credentials or was malformed.
Use this powerful n8n workflow to extract complex Monday.com data, including nested subitems, linked pulses, and specific column values using custom n8n node logic and JavaScript scripting.

Use this powerful n8n workflow to classify contact form submissions using OpenAI (GPT-4o-mini) and automatically route them to the correct department, enhancing support efficiency. Get started with this n8n template.

Expose the O2 Mobility API as an AI tool using this specialized n8n workflow. Integrate transit calculation and info retrieval for intelligent AI agents using the n8n trigger.

Use this powerful n8n workflow template to monetize your private Ollama Large Language Models (LLMs) using the x402 payment protocol and the 1Shot API. This n8n workflow validates all transactions.








































