Skip to main content

Overview

This tutorial walks you through building a complete paid API service from scratch using the x402x payment protocol. You will learn how to:
  • Quickly obtain the seller’s recipient address
  • Create a seller server
  • Create a buyer client
  • Handle the payment flow

Prerequisites

1. Seller recipient address

Go to app.x402x.ai to register and obtain the seller’s wallet (an EIP-7702 address will be automatically generated, see Why EIP-7702).

2. Token address

Currently supported token addresses by the WTF Facilitator:
  • USD1 (BSC): 0x8d0D000Ee44948FC98c9B98A4FA4921476f08B0d

3. Install dependencies

Build it

1. Create the seller server

Create server.ts, core logic:

2. Create the buyer client

Create client.ts, core logic:

3. Run

Expected output

Server:
Client:
🎉 Congratulations! You’ve built your first x402x application.

What’s next

Seller Guide

Server best practices

Buyer Guide

Client integration tips

Payment Types

Authorization options compared

Core Concepts

Understand the protocol design