Get Started in 5 Minutes
From zero to first payment in under 5 minutes. Follow this step-by-step guide to integrate LyteWire into your application.
Sub-3s Settlements Enterprise Security 10+ Blockchains Social Payments
Prerequisites
Node.js 16+ / Python 3.8+ / PHP 8.0+
Any modern runtime works
LyteWire Tenant Account
Free sandbox available instantly
HTTPS Endpoint (for webhooks)
Required for production only
~5 Minutes
Time to first transaction
1
Create a Tenant Account
Sign up as an enterprise tenant to get your API credentials.
Register for a LyteWire tenant account to get your tenant_id and api_key.
# Register at the portal or via API
curl -X POST https://api.lytewire.com/api/tenant/register \
-H "Content-Type: application/json" \
-d '{
"email": "dev@yourcompany.com",
"password": "your-secure-password",
"company_name": "Your Company",
"plan": "professional"
}'
# Response:
# {
# "tenant_id": "tn_abc123...",
# "api_key": "lw_key_...",
# "environment": "sandbox"
# }Sandbox credentials are provided instantly. Production keys require KYC verification.
2
Install an SDK
Choose your preferred language and install the official SDK.
JavaScript
npm install @lytewire/sdkPython
pip install lytewire-sdkPHP
composer require lytewire/enterprise-sdkOr use the LyteWire Flow component for instant React integration.
3
Initialize the Client
Configure the SDK with your tenant credentials.
import { LyteWireAPI } from '@lytewire/sdk';
const lytewire = new LyteWireAPI({
tenantId: process.env.LYTEWIRE_TENANT_ID,
apiKey: process.env.LYTEWIRE_API_KEY,
environment: 'sandbox' // Switch to 'production' when ready
});
// Verify connection
const health = await lytewire.healthCheck();
console.log('Connected:', health.status); // 'healthy'4
Create a Wallet
Create a wallet for a user to hold and transfer tokens.
// Create a wallet for your user
const wallet = await lytewire.createWallet({
external_id: 'user-123', // Your internal user ID
label: 'Primary Wallet',
chain: 'ethereum' // ethereum | solana | polygon | bsc
});
console.log('Wallet ID:', wallet.wallet_id);
console.log('Address:', wallet.address);
// Get the wallet balance
const balance = await lytewire.getBalance(wallet.wallet_id);
console.log('Balances:', balance.tokens);
// [{ token: 'USDT', amount: '0.00', chain: 'ethereum' }, ...]5
Send a Payment
Send tokens using wallet address, phone, email, or social handle.
// Send via social identifier (phone, email, @handle)
const payment = await lytewire.sendSocialPayment(
'+971501234567', // Recipient (phone, email, @twitter:user, etc.)
10.00, // Amount
'USDT', // Token
'Test payment' // Optional note
);
console.log('Transaction:', payment.transaction_id);
console.log('Status:', payment.status); // 'completed' (< 3 seconds!)
console.log('Fee:', payment.fee); // '0.03' (0.3%)
// Or send via wallet address
const transfer = await lytewire.transfer({
from_wallet: 'wallet-123',
to_address: '0xRecipient...',
amount: 50.00,
token: 'USDT',
chain: 'ethereum'
});6
Set Up Webhooks
Receive real-time notifications for payment events.
// Register a webhook endpoint
const webhook = await lytewire.createWebhook({
url: 'https://yourapp.com/webhooks/lytewire',
events: [
'payment.completed',
'payment.failed',
'payment.pending',
'wallet.created',
'identity.linked'
],
secret: 'whsec_your_secret'
});
// In your server (Express example):
import { verifyWebhookSignature } from '@lytewire/sdk';
app.post('/webhooks/lytewire', (req, res) => {
const signature = req.headers['x-lytewire-signature'];
if (verifyWebhookSignature(req.body, signature, WEBHOOK_SECRET)) {
const { event_type, data } = req.body;
switch (event_type) {
case 'payment.completed':
fulfillOrder(data.metadata.order_id);
break;
case 'payment.failed':
notifyCustomer(data.metadata.order_id);
break;
}
res.status(200).send('OK');
} else {
res.status(401).send('Invalid signature');
}
});