Bridge API DocsBridge API Docs
Bridge API Docs
Api reference

Deposit to Transfer Wallet

Fund your transfer wallet using mobile money for future payouts

Deposit to Transfer Wallet

Fund your transfer wallet using mobile money payments. This allows you to add funds to your wallet for future payouts and transfers to customers or partners.

Overview

The Deposit to Transfer Wallet (DTTW) feature allows you to add funds to your transfer wallet using mobile money. This is useful for businesses that need to maintain a balance for payouts, transfers, or other financial operations.

Endpoint

POST https://api.bridgeagw.com/make_payment

Request Headers

Authorization: Basic <base64_encoded_credentials>
Content-Type: application/json

Request Body

{
  "service_id": 1,
  "reference": "Wallet Top-up",
  "customer_number": "0541234567",
  "transaction_id": "WALLET_001",
  "trans_type": "DTTW",
  "amount": 100.00,
  "nw": "MTN",
  "nickname": "Business Account",
  "payment_option": "MOM",
  "currency_code": "GHS",
  "currency_val": "1",
  "callback_url": "https://your-site.com/webhook/wallet-funding",
  "request_time": "2025-01-15 14:30:00"
}

Parameters

ParameterTypeRequiredDescription
service_idintegerYesYour service identifier
referencestringYesDeposit reference/description
customer_numberstringYesYour phone number for the deposit
transaction_idstringYesUnique transaction identifier
trans_typestringYesMust be "DTTW" for wallet deposits
amountnumberYesDeposit amount
nwstringYesNetwork provider (MTN, VOD, AIR)
nicknamestringYesAccount display name
payment_optionstringYesMust be "MOM" for mobile money
currency_codestringNoCurrency code (e.g., "GHS")
currency_valstringNoCurrency value
callback_urlstringYesURL to receive deposit notifications
request_timestringYesRequest timestamp

Supported Networks

NetworkCodeDescription
MTNMTNMTN Mobile Money
TelecelVODTelecel Cash
AirtelTigoAIRAirtelTigo Money

Response

Success Response (202)

{
  "response_message": "Request successfully received for processing",
  "response_code": "202"
}

Error Response (401)

{
  "response_message": "You are not allowed to use this service",
  "response_code": "100"
}

Example Usage

cURL

curl -X POST "https://api.bridgeagw.com/make_payment" \
  -H "Authorization: Basic <your_credentials>" \
  -H "Content-Type: application/json" \
  -d '{
    "service_id": 1,
    "reference": "Wallet Top-up",
    "customer_number": "0541234567",
    "transaction_id": "WALLET_001",
    "trans_type": "DTTW",
    "amount": 100.00,
    "nw": "MTN",
    "nickname": "Business Account",
    "payment_option": "MOM",
    "currency_code": "GHS",
    "currency_val": "1",
    "callback_url": "https://your-site.com/webhook/wallet-funding",
    "request_time": "2025-01-15 14:30:00"
  }'

JavaScript

const depositToWallet = async (amount, phoneNumber, network) => {
  const response = await fetch('https://api.bridgeagw.com/make_payment', {
    method: 'POST',
    headers: {
      'Authorization': 'Basic <your_credentials>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      service_id: 1,
      reference: "Wallet Top-up",
      customer_number: phoneNumber,
      transaction_id: `WALLET_${Date.now()}`,
      trans_type: "DTTW",
      amount: amount,
      nw: network,
      nickname: "Business Account",
      payment_option: "MOM",
      currency_code: "GHS",
      currency_val: "1",
      callback_url: "https://your-site.com/webhook/wallet-funding",
      request_time: new Date().toISOString()
    })
  });

  const result = await response.json();
  return result;
};

// Usage
depositToWallet(100.00, "0541234567", "MTN")
  .then(result => {
    if (result.response_code === "202") {
      console.log("Deposit initiated successfully");
    } else {
      console.error("Deposit failed:", result.response_message);
    }
  });

Python

import requests
from datetime import datetime

def deposit_to_wallet(amount, phone_number, network):
    url = "https://api.bridgeagw.com/make_payment"
    headers = {
        "Authorization": "Basic <your_credentials>",
        "Content-Type": "application/json"
    }
    data = {
        "service_id": 1,
        "reference": "Wallet Top-up",
        "customer_number": phone_number,
        "transaction_id": f"WALLET_{int(datetime.now().timestamp())}",
        "trans_type": "DTTW",
        "amount": amount,
        "nw": network,
        "nickname": "Business Account",
        "payment_option": "MOM",
        "currency_code": "GHS",
        "currency_val": "1",
        "callback_url": "https://your-site.com/webhook/wallet-funding",
        "request_time": datetime.now().isoformat()
    }
    
    response = requests.post(url, headers=headers, json=data)
    return response.json()

# Usage
result = deposit_to_wallet(100.00, "0541234567", "MTN")
if result['response_code'] == '202':
    print("Deposit initiated successfully")
else:
    print(f"Deposit failed: {result['response_message']}")

Deposit Flow

  1. Initiate Deposit: Send deposit request with amount and phone number
  2. Mobile Money Prompt: You receive mobile money prompt on your phone
  3. Authorize Payment: Authorize the payment on your mobile device
  4. Funds Transfer: Money is transferred from your mobile money to wallet
  5. Wallet Updated: Your transfer wallet balance is updated
  6. Callback Notification: You receive confirmation via webhook

Use Cases

Business Operations

  • Payout Preparation: Fund wallet before making customer payouts
  • Bulk Transfers: Prepare funds for batch transfers
  • Emergency Funding: Quick wallet top-up for urgent payments
  • Working Capital: Maintain operational funds in wallet

Financial Management

  • Cash Flow: Manage business cash flow with wallet balance
  • Payment Scheduling: Pre-fund wallet for scheduled payments
  • Risk Management: Maintain buffer funds for operations
  • Cost Optimization: Reduce per-transaction costs with bulk funding

Wallet Management

Check Wallet Balance

Use the Get Account Balance endpoint to check your wallet balance:

const checkBalance = async () => {
  const response = await fetch('https://api.bridgeagw.com/get_account_balance', {
    method: 'POST',
    headers: {
      'Authorization': 'Basic <your_credentials>',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      service_id: 1,
      request_time: new Date().toISOString()
    })
  });
  
  const result = await response.json();
  console.log('Payout Balance:', result.response_data.payout_balance);
  console.log('Collection Balance:', result.response_data.collection_balance);
};

Wallet Balance Types

  • Payout Balance: Available for making payments to customers
  • Collection Balance: Available for receiving payments from customers
  • SMS Balance: Available for sending SMS notifications

Best Practices

  • Regular Monitoring: Check wallet balance regularly
  • Adequate Funding: Maintain sufficient balance for operations
  • Transaction Limits: Be aware of mobile money transaction limits
  • Security: Use secure phone numbers for wallet deposits
  • Record Keeping: Maintain records of all wallet transactions

Integration Examples

React Hook for Wallet Management

import { useState, useEffect } from 'react';

const useWallet = () => {
  const [balance, setBalance] = useState(null);
  const [loading, setLoading] = useState(false);

  const checkBalance = async () => {
    setLoading(true);
    try {
      const response = await fetch('https://api.bridgeagw.com/get_account_balance', {
        method: 'POST',
        headers: {
          'Authorization': 'Basic <your_credentials>',
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          service_id: 1,
          request_time: new Date().toISOString()
        })
      });
      
      const result = await response.json();
      setBalance(result.response_data);
    } catch (error) {
      console.error('Error checking balance:', error);
    } finally {
      setLoading(false);
    }
  };

  const depositToWallet = async (amount, phoneNumber, network) => {
    // Implementation as shown above
  };

  useEffect(() => {
    checkBalance();
  }, []);

  return { balance, loading, checkBalance, depositToWallet };
};

Common Use Cases

  • E-commerce: Fund wallet for customer refunds
  • Marketplace: Prepare funds for seller payouts
  • Freelance Platform: Fund wallet for contractor payments
  • Gig Economy: Maintain funds for worker payments
  • Financial Services: Prepare funds for loan disbursements

Notes

  • Deposits are processed in real-time
  • Mobile money balance must be sufficient
  • Transaction limits may apply based on network
  • Wallet balance is updated immediately after successful deposit
  • Always monitor wallet balance for operational needs
  • Use appropriate transaction references for easy tracking