Create a self-hosted blockchain payment processor with x402 and 1Shot API
DISCOUNT 20%
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.
Self-Hosted x402 Facilitator
In the x402 payment protocol, a facilitator is a role which helps sellers settle stablecoin payments onchain without dealing with blockchain complexities. This workflow allows you to run your own fully-featured, specification-compliant facilitator in n8n. You might want to do this if you want to accept payments in tokens not supported by existing facilitators or as your own business!
Details
A facilitator supports three routes: /verify, /settle, and /supported. These routes are all created for you in this workflow with proper error handling and responses.
A seller will first hit /verify with their payment details to ensure the payment information is correct. Next they will hit the /settle endpoint with the same payment information to settle the paymet on the blockchain. The /supported endpoint is used to indicate to sellers which blockchains you choose to support in a programatic fashion.
Setup
- Create a 1Shot API account
- Create 1Shot API wallets for the networks where you wish to facilitate token payments and load them with sufficient gas tokens.
- Using 1Shot Prompts, import the
transferWithAuthorizationfunctions for the tokens you will settle payments for. - Import this workflow into n8n and create a credential to link the 1Shot API community node to your 1Shot API business account.
- Enter the token and network information into the payment token and network configuration nodes indicated by the sticky nodes.
- Turn on your workflow and settle payments!