Back to Home
API Documentation

Developer Documentation

Complete reference for integrating Ping Pay's micropayment infrastructure with the x402 protocol on Solana.

Overview

Ping Pay enables micropayments for API requests using Solana blockchain. Users can authenticate via prepaid API keys or pay-per-request using the x402 protocol with SOL or USDC. Our marketplace features creator-made APIs where creators earn revenue directly to their wallet.

Quick Start

1. Get an API Key

Connect wallet, deposit USDC, generate your API key

2. Make Requests

Include your API key in Authorization header

3. Go Live

Start building with instant, low-cost API access

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://pingpay.app/api/solana/balance?address=YOUR_WALLET_ADDRESS"

API Endpoints

All endpoints return JSON. Replace YOUR_WALLET_ADDRESS with your actual Solana address.

GET/api/solana/balance

Returns the SOL balance for a given wallet address

curl https://pingpay.app/api/solana/balance?address=YOUR_WALLET_ADDRESS
GET/api/solana/tokens

Returns all SPL tokens held by a wallet

curl https://pingpay.app/api/solana/tokens?address=YOUR_WALLET_ADDRESS
GET/api/solana/transactions

Returns recent transaction history for a wallet

curl https://pingpay.app/api/solana/transactions?address=YOUR_WALLET_ADDRESS
GET/api/solana/nft

Returns NFTs owned by a wallet address

curl https://pingpay.app/api/solana/nft?address=YOUR_WALLET_ADDRESS
GET/api/solana/validator

Returns validator information for a vote account

curl https://pingpay.app/api/solana/validator?vote_account=YOUR_VOTE_ACCOUNT

Authentication

API Keys

Prepaid balance-based authentication. Ideal for high-volume usage with predictable costs.

Authorization: Bearer pp_live_...

x402 Protocol

Pay-per-request using Solana transactions. No account required, instant settlement.

X-Transaction-Signature: ...

x402 Protocol

Note: The x402 protocol enables HTTP 402 Payment Required responses with Solana settlement. Learn more at x402.org

Request Flow

1

Initial Request

Make an API request without payment credentials

2

402 Response

Server responds with payment details and quote ID

3

Submit Payment

Send SOL or USDC to the specified Solana address

4

Retry with Signature

Include transaction signature in headers to receive data

Response Headers

HeaderDescription
X-Payment-RequiredAlways "true" on 402 responses
X-Quote-IdUnique identifier for this payment quote
X-Amount-USDPrice in USD for this request
X-Solana-AddressRecipient wallet address for payment
X-Expires-AtISO 8601 timestamp for quote expiration

Example

# Step 1: Initial request (receives 402)
curl https://pingpay.app/api/solana/balance?address=YOUR_WALLET

# Step 2: Server responds with 402 and payment details
# {
#   "quote_id": "abc123...",
#   "amount_usd": 0.01,
#   "solana_address": "...",
#   "expires_at": "2025-10-30T12:00:00Z"
# }

# Step 3: Submit Solana payment transaction

# Step 4: Retry with transaction signature
curl -H "X-Quote-Id: abc123" \
     -H "X-Transaction-Signature: YourSolanaSignature..." \
     https://pingpay.app/api/solana/balance?address=YOUR_WALLET

For API Creators

Monetize your own APIs through Ping Pay's marketplace. Set your price, publish your endpoint, and earn revenue directly to your Solana wallet.

Benefits

  • Host your API anywhere (AWS, Vercel, custom)
  • Automated payment verification and settlement
  • Direct USDC payments to your wallet
  • Real-time analytics and usage tracking

Getting Started

  1. 1.Connect your Solana wallet
  2. 2.Set your payout wallet address
  3. 3.Create your API listing with pricing
  4. 4.Start earning from API requests
Get Started as a Creator

Support & Community

Need help or have questions? Connect with our community and development team.