x402
Configured with One Shot, One Shot Synch, Respond To Webhook, Webhook. Review the connections and setup before adapting this template.
Node categories in this workflow
- Trigger
- Routing
- Code
- Integration
- Web / API
Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.
Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.
How it works
The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.
| Node | Category | Type | Operation |
|---|---|---|---|
| Webhook | Trigger | Webhook | See node parameters |
| Check for presence of X-HEADER | Routing | If | See node parameters |
| Decode & Validate X-Payment | Code | Code | See node parameters |
| Simulate Payment | Integration | One Shot | simulate |
| On Successful Payment Simulation | Routing | If | See node parameters |
| 1Shot API Submit & Wait | Integration | One Shot Synch | See node parameters |
| Ensure Well Formatted Payment Payload | Routing | If | See node parameters |
| Response: Missing or Invalid Payment Headers | Web / API | Respond To Webhook | See node parameters |
| Response: Payment Invalid | Web / API | Respond To Webhook | See node parameters |
| Response: 200 - Payment Successful | Web / API | Respond To Webhook | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.
Requirements
An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.
Credential types declared in the source
oneShotOAuth2Api
Workflow notes
x402 Payment Endpoint
x402 Payment Endpoint
This workflow fragment can be used to monetize any workflow you can build in n8n by accepting stablecoin payments via an API call.
Learn more about the x402 payment protocol.
Watch the YouTube tutorial video.
Any ERC-20 on any EVM
Any ERC-20 on any EVM
With the 1Shot API node, you can accept any ERC-20 with the appropriate transferWithAuthorization methods.
Put your workflow down here
Put your workflow down here
Once the payment transaction has been confirmed, replace the Response: 200 - Payment Successful block with your workflow which responds to the user with the appropriate premium content.
Example Curl Command
Example Curl Command
You can test the webhook endpoint with a command like this (be sure to use a properly formatted x-payment header payload):
# swap out the URL here for you webhook URL endpoint
curl -X GET \
https://n8n.1shotapi.dev/webhook-test/92c5ca23-99a7-437d-85da-84aef8bd2a25 \
-H "x-payment: YOUR-BASE64-ENCODED-PAYMENT-PAYLOAD" \
-H "User-Agent: CustomUserAgent/1.0" \
-H "Accept: application/json"
Ensure Required Payment Details
Ensure Required Payment Details
Use this block to add/check for payment detail requirements like minimum payment amount.
x402
x402
Purpose and structure
This folder contains the x402 workflow. Its executable nodes use code, if, oneShot, oneShotSynch, respondToWebhook, webhook. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.
Setup
Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.
Entry points
Webhook
Verification
Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.
Attribution
https://github.com/1Shot-API/n8n-nodes-1shot/blob/099288d799a12a856e15f3f680ef0fd990e7cb43/x402.json MIT; preserve source notices.