x402 Trigger icon

x402 Trigger

Webhook trigger that accepts x402 micropayments — returns 402 for unpaid requests and settles paid ones

x402 Trigger

AI-generated

Summary

Listen for HTTP webhook requests that require an x402 micropayment before processing. Respond with HTTP 402 Payment Required if unpaid, verifying and settling payments on supported blockchain networks before forwarding request details and payment info.

Inputs

  • HTTP Method — HTTP method this webhook listens on (GET or POST). Defaults to GET.
  • Path (required) — Webhook URL path appended to the base webhook URL.
  • Price (USD) (required) — Amount in USD to charge per webhook request.
  • Token — Payment token to accept (currently USDC).
  • Network — Blockchain network for payment settlement (e.g., base, base-sepolia, solana, solana-devnet). Defaults to base-sepolia.
  • Description — Human-readable description of the resource being sold, used in payment requests.
  • Max Timeout (Seconds) — Maximum time in seconds the payment is valid for. Defaults to 60.

Output shape

a single JSON object containing the original request's body, query parameters, headers, and detailed payment information (payload, verification, settlement status, network, token, amount, and payer address).

If the payment header is missing or invalid, the node responds with HTTP 402 or 400 directly, terminating workflow execution (no output). Payment verification and settlement are performed via HTTP calls to the configured x402 facilitator URL from credentials. On success, the webhook forwards the request and payment details; on failure, appropriate HTTP error responses are returned without workflow execution output.

Links

Discussion