Skip to main content
This guide will help you send your first USDC payment to an X (Twitter) user using the simplest integration method: x402-axios.

Quick Example

Send USDC to any X user with just a few lines of code:

How It Works

  1. Initial Request: Your app makes a payment request to Snack Money API
  2. 402 Response: API returns payment requirements (amount, recipient, chain)
  3. Auto Payment: x402-axios automatically executes the on-chain USDC transfer
  4. Retry with Proof: Request is retried with payment proof
  5. Success: API processes the payment and returns confirmation
Learn more about the x402 protocol.

Prerequisites

  • Node.js 18+
  • USDC balance on Base or Solana network
  • Private key for signing transactions

Installation

Environment Setup

Create a .env file:

Supported Platforms

Send payments to users on:
  • X (Twitter) - /payments/x/pay
  • Farcaster - /payments/farcaster/pay
  • GitHub - /payments/github/pay

Next Steps