Skip to main content

Request Flow

How the request flow looks like

// === REQUESTER SIDE ===

// 1. Create request (no crypto specified)
const request = await client.createPayment({
type: 'request',
fiatAmount: 15000,
fiatCurrency: 'NGN',
receiver: {
bankCode: '044',
accountNumber: '0012345678',
},
metadata: { invoiceId: 'INV-001' },
});

// 2. Share reference with payer
const requestCode = request.reference; // e.g., "2S-REQ001"
console.log(`Ask payer to pay: ${requestCode}`);
console.log(`Amount: 15,000 NGN`);


// === PAYER SIDE ===

// 3. Payer fulfills (chooses crypto at this point)
const fulfilled = await client.fulfillRequest(requestCode, {
payer: { chatId: '9012345678' },
crypto: 'USDT',
network: 'trc20',
});

// 4. Payer sends crypto
console.log(`Send ${fulfilled.cryptoAmount} USDT to:`);
console.log(fulfilled.depositAddress);

// 5. Settlement happens automatically to requester's bank