12 Minute Guide

Wallet Transfers

Implement instant P2P wallet transfers with real-time notifications and balance management.

1

Create User Wallets

Set up digital wallets for your users.

const wallet = await fetch('https://api.gopay.now/v1/wallets', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_test_your_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    user_id: 'user_12345',
    currency: 'USD',
    name: 'Primary Wallet'
  })
});
2

Check Balance

Verify wallet balance before transfer.

const balance = await fetch(`https://api.gopay.now/v1/wallets/${walletId}/balance`, {
  headers: {
    'Authorization': 'Bearer sk_test_your_key'
  }
});

const balanceData = await balance.json();
console.log('Available balance:', balanceData.available);
3

Execute Transfer

Send money between wallets instantly.

const transfer = await fetch('https://api.gopay.now/v1/transfers', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sk_test_your_key',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from_wallet_id: 'wallet_sender_123',
    to_wallet_id: 'wallet_receiver_456',
    amount: 1500, // ₺ 15.00
    description: 'Payment for services',
    reference: 'invoice_789'
  })
});
4

Handle Response

Process transfer results and notify users.

const result = await transfer.json();

if (transfer.ok) {
  console.log('Transfer successful:', result.id);
  console.log('Status:', result.status); // 'completed'
  
  // Notify users
  notifyUser(result.from_user_id, 'Transfer sent successfully');
  notifyUser(result.to_user_id, 'You received a payment');
} else {
  console.error('Transfer failed:', result.error);
}

Wallet Features

⚡ Instant Transfers

Real-time P2P payments with immediate confirmation

📊 Balance Tracking

Real-time balance updates and transaction history

🔒 Secure

Multi-factor authentication and fraud detection

🌍 Multi-Currency

Support for multiple currencies and auto-conversion