🚀 Quick Start
Get started with three simple steps. No backend integration required!
Step 1: Include the Script
Add this line to your website's HTML, just before the closing </body> tag:
<script src="https://app.instantescrow.nz/conduit-checkout.js"></script>Step 2: Initialize with Your Wallet
Configure the checkout with your merchant wallet address:
<script>
ConduitCheckout.init({
// REQUIRED: Your wallet address to receive payments
sellerAddress: '0xYourWalletAddressHere',
// REQUIRED: Base URL of checkout page
baseUrl: 'https://app.instantescrow.nz',
// RECOMMENDED: Auto-send verified payment to your backend
webhookUrl: 'https://yoursite.com/api/conduit-webhook',
webhookSecret: 'your-secret-key', // For HMAC signature verification
// Optional: Default token ('USDC' or 'USDT')
tokenSymbol: 'USDC',
// Optional: Days until auto-release (default: 7)
expiryDays: 7,
// Optional: Display mode ('popup' or 'redirect')
mode: 'popup',
// Success callback (webhook already sent!)
onSuccess: function(data) {
console.log('Payment verified!', data);
// Just show UI - your backend already received webhook
alert('Thank you! Order #' + data.orderId + ' confirmed!');
},
// Error callback
onError: function(error) {
console.error('Payment failed:', error);
alert('Payment failed: ' + error);
},
// Cancel callback
onCancel: function() {
console.log('Payment cancelled');
}
});
</script>Step 3: Add Payment Buttons
Create buttons that open the checkout:
<button onclick="ConduitCheckout.open({
amount: '50.00',
description: 'Premium Product'
})">
Pay $50 with USDC
</button>✨ Try It Live
See the integration in action with a working example page:
View Interactive Demo →🎨 Display Modes
Popup Window
Opens in a centered popup. Best for minimal disruption.
mode: 'popup'Full Redirect
Redirects to checkout page. Best for mobile.
mode: 'redirect'💡 Common Examples
Basic Product Payment
<button onclick="ConduitCheckout.open({
amount: '29.99',
description: 'Premium Widget - Blue',
orderId: 'ORDER-12345'
})">
Buy Now - $29.99
</button>Product with Extended Protection
<button onclick="ConduitCheckout.open({
amount: '99.00',
description: 'Professional Service Package',
orderId: 'SERVICE-' + Date.now(),
expiryDays: 30, // 30-day buyer protection
email: 'customer@example.com'
})">
Purchase - $99
</button>Custom Amount (Donations, Tips)
<input type="number" id="amount" placeholder="Enter amount" min="1.001" step="0.01">
<button onclick="
const amount = document.getElementById('amount').value;
ConduitCheckout.open({
amount: amount,
description: 'Support our project',
orderId: 'DONATION-' + Date.now()
});
">
Donate with USDC
</button>Accept USDT Instead of USDC
<button onclick="ConduitCheckout.open({
amount: '500.00',
description: 'Enterprise License',
tokenSymbol: 'USDT', // Use USDT instead of USDC
expiryDays: 14
})">
Pay $500 with USDT
</button>⚙️ Configuration Options
ConduitCheckout.init(options)
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
| sellerAddress | string | Yes | - | Your wallet address to receive payments |
| baseUrl | string | Yes | - | Base URL of checkout page |
| tokenSymbol | string | No | 'USDC' | 'USDC' or 'USDT' |
| expiryDays | number | No | 7 | Days until auto-release to seller |
| mode | string | No | 'popup' | 'popup' or 'redirect' |
| onSuccess | function | No | - | Callback when payment completes |
| onError | function | No | - | Callback when payment fails |
| onCancel | function | No | - | Callback when user cancels |
ConduitCheckout.open(params)
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | string/number | Yes | Payment amount (e.g., '50.00') |
| description | string | Yes | Payment description (max 160 chars) |
| orderId | string | No | Your internal order/transaction ID |
| string | No | Customer email address | |
| tokenSymbol | string | No | Override default token for this payment |
| expiryDays | number | No | Override default expiry |
| webhookUrl | string | No | Webhook URL for payment verification |
| metadata | object | No | Custom metadata to include |
🔔 Webhook Integration
Receive server-to-server notifications when payments are completed. Perfect for fulfilling orders automatically.
Webhook Payload
{
"transaction_hash": "0x1234...",
"contract_address": "0x5678...",
"contract_id": "abc123",
"order_id": "1234",
"expected_amount": 50.00,
"expected_recipient": "0x9abc...",
"merchant_wallet": "0xdef0..."
}Example Webhook Handler (Node.js)
app.post('/api/payment-webhook', express.json(), async (req, res) => {
const {
transaction_hash,
contract_id,
order_id,
expected_amount
} = req.body;
// Verify payment on blockchain (optional)
// Update your database
// Fulfill order
// Send confirmation email
console.log(`Payment received for order ${order_id}: ${transaction_hash}`);
res.json({ success: true });
});🔒 Features & Security
✓ Buyer Protection
- • Funds held in escrow smart contract
- • Time-delayed release (default 7 days)
- • Dispute mechanism for buyer protection
- • Admin arbitration for disputes
✓ No Gas Fees
- • Platform covers all blockchain fees
- • Users only pay $1 platform fee
- • Minimum payment: $1.001
- • Fee included in payment amount
✓ Client-Side Security
- • Users sign transactions with own wallet
- • No custody of user funds
- • HTTPS required for all integrations
- • Open-source smart contracts
✓ Multi-Token Support
- • USDC (default)
- • USDT (optional)
- • Base network (Ethereum L2)
- • Low transaction costs
🔐 Backend Integration (REQUIRED for Production)
✅ EASY: Use Webhooks!
The SDK automatically sends verified payment data to YOUR backend webhook. Just configure webhookUrl and create ONE endpoint to:
- Receive verified payment data automatically
- Mark the order as PAID in YOUR system
- Trigger order fulfillment (ship goods, deliver digital products, etc.)
- Send confirmation emails to the customer
- Update inventory and accounting systems
No manual fetch() calls needed! The SDK handles everything.
Step 1: Configure SDK with Webhook
ConduitCheckout.init({
// REQUIRED
sellerAddress: '0xYourWalletAddress',
baseUrl: 'https://app.instantescrow.nz',
// WEBHOOK CONFIG (RECOMMENDED)
webhookUrl: 'https://yoursite.com/api/conduit-webhook',
webhookSecret: 'your-secret-key', // Store securely!
onSuccess: function(verifiedData) {
// Webhook already sent! Just show UI confirmation
console.log('Payment verified!', verifiedData);
window.location.href = '/thank-you?order=' + verifiedData.orderId;
},
onError: function(error) {
alert('Payment failed: ' + error);
}
});💡 Key Point: The SDK automatically sends verified payment data to your webhook URL. You don't need manual fetch() calls in onSuccess!
Step 2: Create Webhook Endpoint (ONE endpoint!)
Example Node.js/Express webhook handler:
const crypto = require('crypto');
// POST /api/conduit-webhook
app.post('/api/conduit-webhook', async (req, res) => {
try {
// 1. VERIFY HMAC SIGNATURE (prevents spoofing)
const signature = req.headers['x-conduit-signature'];
const payload = JSON.stringify(req.body);
const expectedSig = crypto
.createHmac('sha256', process.env.WEBHOOK_SECRET)
.update(payload)
.digest('hex');
if (signature !== expectedSig) {
return res.status(401).json({ error: 'Invalid signature' });
}
// 2. EXTRACT VERIFIED DATA
const {
contractId,
chainAddress,
amount,
currencySymbol,
state,
verified,
verifiedAt,
orderId,
email,
metadata
} = req.body;
console.log('✅ Payment verified:', contractId, amount, currencySymbol);
// 3. PROCESS PAYMENT IN YOUR SYSTEM
await db.orders.update({
where: { id: orderId },
data: {
status: 'PAID',
paymentContractId: contractId,
paymentChainAddress: chainAddress,
paymentAmount: amount,
paidAt: new Date(verifiedAt)
}
});
// 4. FULFILL ORDER
await fulfillment.ship(orderId);
await email.sendConfirmation(email, orderId);
// 5. RESPOND SUCCESS
res.json({ received: true });
} catch (error) {
console.error('Webhook error:', error);
res.status(500).json({ error: 'Internal server error' });
}
});
});✅ What the Verified Data Means
| verified: true | Backend confirmed payment exists in blockchain |
| state: "ACTIVE" | Funds are locked in escrow contract |
| seller: "0x..." | Matches YOUR wallet (verified by SDK) |
| amount: 50.0 | Matches expected amount (verified by SDK) |
| chainAddress | Blockchain contract address (permanent record) |
✅ Safe to ship goods! The SDK has verified everything before calling onSuccess.
🎯 Customer Experience Flow (with Webhooks)
- Customer clicks "Pay with USDC"
- Popup opens, customer connects wallet and pays
- SDK verifies payment on blockchain (automatic)
- SDK sends webhook to YOUR backend (automatic)
- Your backend marks order as paid (automatic)
- Your onSuccess callback shows confirmation UI
- Customer sees confirmation page
- Customer receives email receipt (sent by your webhook)
- You ship the goods (triggered by your webhook)
- Funds auto-release to you after 7 days (if no disputes)
💡 Steps 3-5 happen automatically! The SDK handles verification and webhook delivery.
❓ Frequently Asked Questions
What tokens are supported?
What are the fees?
How long until I receive funds?
Can buyers get refunds?
Do I need a crypto wallet?
Is this secure?
What about chargebacks?
Ready to Get Started?
Try the interactive demo or integrate directly into your site