The Payment Gate for Agentic Economy
One-line payment integration for autonomous agents on Solana. Accept SOL, SPL tokens, and stablecoins — with x402 protocol-level settlement.
// Install npm install @gatex402/checkout // 3 lines to accept payments import { GateCheckout } from '@gatex402/checkout' const gate = new GateCheckout({ merchant: 'your-wallet-address', network: 'mainnet', accept: ['SOL', 'USDC', 'USDT'] }) gate.open({ amount: 5.0, currency: 'USDC' })
Drop a single script tag or npm import. Payment modal handles wallet connection, token selection, and confirmation automatically.
Built for AI-to-AI commerce. Agents pay agents autonomously via x402 protocol headers — no human approval needed.
Every transaction scored in real-time for anomalies, MEV exposure, and counterparty risk.
SOL, USDC, USDT, and any SPL token. Auto-convert to merchant's preferred settlement currency on-chain.
Real-time payment notifications via webhooks. Trigger fulfillment, update databases, or notify agents on confirmed transactions.
No-code payment URLs. Share a link, get paid. Perfect for creators, freelancers, and quick commerce without deploying code.
Install the SDK and configure with your wallet address. Supports Phantom, Solflare, and programmatic wallets for agents.
Call gate.open() with amount and currency. The checkout modal handles wallet selection, approval, and signing — or use headless mode for agent-to-agent settlement.
Webhook fires on confirmation. Transaction verified on-chain with risk score attached. Funds settle to your wallet instantly.
The payment gateway protocol for the agentic economy. GATEX402 provides one-line payment integration for Solana dApps, AI agents, and marketplaces.
One-line checkout · Agent-to-agent settlement · Multi-token (SOL, USDC, SPL) · Risk scoring · Webhooks · Payment links · Escrow · Micropayments · <400ms settlement
# npm npm install @gatex402/checkout # yarn yarn add @gatex402/checkout # CDN <script src="https://cdn.gatex402.com/v1/checkout.min.js"></script>
Initialize the gateway with your wallet, then call open() to trigger a payment.
import { GateCheckout } from '@gatex402/checkout' const gate = new GateCheckout({ merchant: 'YOUR_WALLET_ADDRESS', network: 'mainnet', accept: ['SOL', 'USDC', 'USDT'], theme: 'dark' }) gate.open({ amount: 25, currency: 'USDC', memo: 'order-9281' }) gate.on('confirmed', (tx) => { console.log(tx.signature, tx.riskScore, tx.amount) })
Full options for the GateCheckout constructor.
| Parameter | Type | Default | Description |
|---|---|---|---|
merchant | string | — | Your Solana wallet address (required) |
network | string | 'mainnet' | 'mainnet' or 'devnet' |
accept | string[] | ['SOL'] | Accepted tokens |
theme | string | 'dark' | 'dark' | 'light' | 'auto' |
rpc | string | auto | Custom RPC endpoint |
webhook | string | — | Webhook URL for notifications |
riskThreshold | number | 0.7 | Risk score threshold (0-1) |
autoConvert | string | — | Auto-convert to this token on settlement |
escrow | boolean | false | Enable escrow mode |
Default UI integration. Handles wallet detection, token selection, amount display, and signing.
gate.open({ amount: 10.00, currency: 'USDC', memo: 'invoice-0042', metadata: { orderId: 'abc123' }, redirectUrl: 'https://yoursite.com/success', expiry: 300 })
For agent-to-agent or server-side payments. No UI — transactions signed programmatically.
import { GateHeadless } from '@gatex402/checkout/headless' const gate = new GateHeadless({ merchant: 'MERCHANT_WALLET', network: 'mainnet', signer: agentKeypair }) const tx = await gate.pay({ amount: 0.5, currency: 'SOL', memo: 'agent-task-7712' })
Headless mode requires a private key. Never expose keypairs in client-side code. Use env vars or secure key management.
No-code payment URLs. Share a link, get paid.
const link = gate.createLink({ amount: 50, currency: 'USDC', label: 'Logo Design — Final', expiry: '24h' }) // → https://pay.gatex402.com/p/x7k9m2
npx gatex402 link --amount 50 --currency USDC --label "Invoice #42"
Creates a checkout instance. See Configuration for options.
Creates a headless instance for programmatic payments. Requires signer keypair.
Opens checkout modal.
| Param | Type | Description |
|---|---|---|
amount | number | Payment amount (required) |
currency | string | Token symbol or SPL mint |
memo | string | On-chain memo |
metadata | object | Custom metadata (sent to webhook) |
redirectUrl | string | Post-payment redirect |
expiry | number | Expiration in seconds |
Headless payment. Returns Promise<Transaction>.
Generate payment link. Returns { url, id, expiry }.
Fetch tx details + risk score by signature.
Create escrow. Funds locked until release() or refund().
Close checkout modal programmatically.
Payment confirmed on-chain.
{ signature, amount, currency, from, to, riskScore, memo, metadata, timestamp }
Payment failed (rejected, insufficient balance, network error).
User closed checkout without paying.
Transaction exceeded riskThreshold. Still processed but flagged.
interface GateConfig { merchant: string; network?: 'mainnet'|'devnet' accept?: string[]; theme?: 'dark'|'light'|'auto' rpc?: string; webhook?: string riskThreshold?: number; autoConvert?: string escrow?: boolean } interface PaymentOptions { amount: number; currency?: string memo?: string; metadata?: Record<string,any> redirectUrl?: string; expiry?: number } interface Transaction { signature: string; amount: number currency: string; from: string; to: string riskScore: number; memo: string metadata: Record<string,any>; timestamp: number } interface EscrowContract { id: string; amount: number; currency: string status: 'locked'|'released'|'refunded'|'disputed' parties: { payer: string; payee: string } expiry: number release(): Promise<Transaction> refund(): Promise<Transaction> }
GATEX402 is agent-first. AI agents send and receive payments autonomously via x402 protocol.
import { GateHeadless } from '@gatex402/checkout/headless' import { Keypair } from '@solana/web3.js' const agent = new GateHeadless({ merchant: 'TARGET_AGENT_WALLET', network: 'mainnet', signer: Keypair.fromSecretKey(agentSecret) }) const tx = await agent.pay({ amount: 2.5, currency: 'USDC', memo: 'moltdmkt:skill:sentiment-v3', metadata: { protocol: 'x402', agent_id: 'agent-alpha-9' } })
Lock funds for task-based work. Release on completion, auto-refund on expiry.
const escrow = await gate.escrow.create({ amount: 100, currency: 'USDC', payee: 'WORKER_WALLET', expiry: 86400, memo: 'code-review-441' }) // On task complete await escrow.release() // Or refund await escrow.refund()
Pay-per-use for API calls and AI inference. Batched settlements to reduce fees.
import { MicroStream } from '@gatex402/checkout/micro' const stream = new MicroStream({ merchant: 'API_PROVIDER_WALLET', signer: agentKeypair, ratePerCall: 0.001, settleEvery: 100, currency: 'USDC' }) await stream.tick() // +0.001 USDC await stream.tick() // +0.001 USDC // auto-settles every 100 ticks await stream.settle() // force settle
Real-time HTTP POST notifications on payment events.
{ "event": "payment.confirmed", "tx": { "signature": "5Uh7x...", "amount": 25.00, "currency": "USDC", "from": "7xKp...", "to": "9mRq...", "riskScore": 0.08, "memo": "order-9281" }, "timestamp": 1711532400 }
| Event | Description |
|---|---|
payment.confirmed | Payment confirmed on-chain |
payment.failed | Payment failed |
payment.risk_flagged | Payment exceeded risk threshold |
escrow.created | Escrow created and funded |
escrow.released | Escrow released to payee |
escrow.refunded | Escrow refunded to payer |
link.paid | Payment link used |
Webhooks include X-Gate-Signature header. Verify with HMAC using your merchant secret.
Every transaction scored by the built-in risk engine in real-time.
| Score | Level | Action |
|---|---|---|
0.00–0.30 | 🟢 Low | Auto-approve |
0.31–0.60 | 🟡 Medium | Monitor |
0.61–0.85 | 🟠 High | Flagged + webhook alert |
0.86–1.00 | 🔴 Critical | Blocked if threshold set |
| Token | Symbol | Type |
|---|---|---|
| Solana | SOL | Native |
| USD Coin | USDC | SPL |
| Tether | USDT | SPL |
| Custom | Any mint | SPL |
const gate = new GateCheckout({ merchant: 'YOUR_WALLET', accept: ['SOL', 'USDC', 'G8e2v6t4LfsJChH1LiF7xTiVVNR4u4R98VTmU6QWpump'] })
| Code | Name | Description |
|---|---|---|
GATE_001 | WALLET_NOT_FOUND | No compatible wallet detected |
GATE_002 | INSUFFICIENT_BALANCE | Insufficient token balance |
GATE_003 | TX_REJECTED | User rejected transaction |
GATE_004 | NETWORK_ERROR | RPC/network failure |
GATE_005 | RISK_BLOCKED | Blocked by risk threshold |
GATE_006 | CHECKOUT_EXPIRED | Session expired |
GATE_007 | INVALID_TOKEN | Token not in accept list |
GATE_008 | ESCROW_EXPIRED | Escrow auto-refunded |
GATE_009 | WEBHOOK_FAILED | Webhook delivery failed |
GATE_010 | SIGNER_INVALID | Invalid headless keypair |