TransX402 Docs
Onboarding

Quickstart

Step-by-step guide to start accepting IDRX payments on your website using TransX402 — from registration to your first payment.

This guide takes you from zero to your first IDRX payment, then to production.

Onboarding at a Glance

Register — connect your wallet at dashboard.transx402.com and create a merchant profile
Get your API key — a sandbox key (ipk_sandbox_...) is created automatically
Integrate — add the JS library, CDN script, or WordPress plugin
Test in sandbox — fund a test wallet and make a free IDRX payment on Anvil
Go live — swap to ipk_live_...; same code, real payments on Base
Same code for sandbox and production — only the API key changes.

Prerequisites

  • An Ethereum wallet (MetaMask, Coinbase Wallet, or any EVM wallet)
  • A website or application you want to monetize
  • Node.js 18+ (if using npm) or just a browser (if using CDN)

Step 1: Register on the Dashboard

Go to dashboard.transx402.com and connect your wallet.

  1. Click "Connect Wallet" and select your wallet (MetaMask, Coinbase Wallet, etc.)
  2. Sign the verification message (SIWE — Sign-In with Ethereum) to prove wallet ownership
  3. Fill in your merchant profile: business name, email, and website URL

After registration, you automatically receive a sandbox API key to start testing.

Step 2: Get Your API Key

On the API Keys page in the dashboard, you'll see the sandbox API key that was automatically created:

ipk_sandbox_abc123def456...

Important: The full API key is only displayed once at creation. Copy and store it securely.

The ipk_sandbox_ prefix indicates this key is for the sandbox environment. All payments will use test IDRX on the Anvil chain (free).

Step 3: Integrate into Your Website

Option A: CDN (Easiest)

Add the following script tag to your HTML page:

<script src="https://cdn.transx402.com/v1/transx402.min.js"></script>
<script>
  const client = TransX402.create({
    apiKey: 'ipk_sandbox_abc123def456...'
  });
 
  // Automatic paywall
  TransX402.paywall({
    selector: '#premium-content',
    price: 5000,
    currency: 'IDR',
    title: 'Premium Article',
    description: 'Pay Rp 5,000 to read this article'
  });
</script>

See the CDN Usage guide for more configuration details.

Option B: NPM (For Modern Applications)

npm install @transx402/client
import { TransX402 } from '@transx402/client';
 
const client = TransX402.create({
  apiKey: 'ipk_sandbox_abc123def456...'
});
 
// Fetch that automatically handles 402 payments
const response = await client.fetch('https://mysite.com/api/premium-article');
const data = await response.json();

See the JavaScript Library guide for the full API reference.

Option C: WordPress Plugin

  1. Install the TransX402 Paywall plugin from WordPress admin
  2. Go to Settings > TransX402
  3. Paste your sandbox API key
  4. In the post/page editor, enable the "Enable Paywall" toggle

See the complete WordPress guide for more details.

Step 4: Test in Sandbox

Fund a Test Wallet

Before making test payments, you need to fund a test wallet with IDRX. Use the sandbox endpoint:

curl -X POST https://sandbox.transx402.com/sandbox/fund \
  -H "X-API-Key: ipk_sandbox_abc123def456..." \
  -H "Content-Type: application/json" \
  -d '{"address": "0xYourWalletAddress...", "amount": "1000000"}'

Or use the Sandbox page in the dashboard to fund test wallets through the UI.

Make a Test Payment

  1. Open your website page with the paywall installed
  2. Click "Pay with IDRX" on the paywall overlay
  3. Connect your test wallet
  4. Approve Permit2 (first time only)
  5. Sign the payment
  6. Content unlocks automatically

Check the Dashboard

After a successful payment, you can see the details on the Payments page in the dashboard:

  • Transaction hash
  • Payer address
  • IDRX amount
  • Confirmation status
  • Payment time

Step 5: Go Live

When your integration is working well in sandbox, it's time to switch to production:

  1. Go to the API Keys page in the dashboard
  2. Click "Create Production Key"
  3. Replace the API key in your code:
const client = TransX402.create({
  // Replace sandbox key with production key
  apiKey: 'ipk_live_xyz789...'
});

That's it! No other code changes required. The library automatically routes to api.transx402.com and uses Base mainnet.

Next Steps