> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fincode.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Make Payment from Wallet

> Process payment for any payable item using customer wallet balance.

This endpoint allows customers to pay for transactions, bill payments, wallet funding, or any other payable item using their wallet balance. The system automatically debits the customer's wallet and updates the payment status.

## Authentication

<ParamField header="X-Auth-Token" type="string" required>
  Authentication token obtained from login
</ParamField>

<ParamField header="uuid" type="string" required>
  Device UUID for request tracking
</ParamField>

<ParamField header="platform" type="string" required>
  Platform identifier (e.g., "WEB", "MOBILE", "IOS", "ANDROID")
</ParamField>

## Request Body

<ParamField body="payableType" type="enum" required>
  Type of payable item to process

  **Options:**

  * `TRANSACTION` - Remittance/money transfer
  * `WALLET` - Generic wallet payment
  * `WALLET_CUSTOMER` - Personal wallet payment
  * `BILL` - Bill payment
  * `MERCHANT` - Product payment
  * `WITHDRAWAL` - Wallet withdrawal
</ParamField>

<ParamField body="payAbleId" type="string" required>
  Unique identifier of the payable item
</ParamField>

<ParamField body="password" type="string" required>
  Customer's account password for authentication
</ParamField>

<ParamField body="accountId" type="string" required>
  Wallet account ID to debit from
</ParamField>

<ParamField body="totalCheckOutAmount" type="number" required>
  Total amount to be debited including fees and taxes
</ParamField>

<ParamField body="paymentGatewayRef" type="string" required>
  Reference number for the payment (can be auto-generated)
</ParamField>

<ParamField body="accountNumber" type="string">
  Specific wallet account number (if customer has multiple accounts)
</ParamField>

<ParamField body="paymentAccountNumbeCurrencyCode" type="enum">
  Currency code of the wallet account

  **Examples:** `USD`, `GBP`, `NGN`, `EUR`
</ParamField>

<ParamField body="otp" type="string">
  One-Time Password for Strong Customer Authentication (if enabled)
</ParamField>

<ParamField body="pin" type="string">
  Transaction PIN for additional security (if enabled)
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://remitjunction.fincode.software/api/v6/services/paymentmanagement/makepaymentfromwalletaccount \
    --header 'Content-Type: application/json' \
    --header 'X-Auth-Token: your_auth_token' \
    --header 'uuid: device_uuid' \
    --header 'platform: WEB' \
    --data '{
      "payableType": "TRANSACTION",
      "payAbleId": "txn_abc123",
      "password": "user_password",
      "accountId": "wallet_456",
      "totalCheckOutAmount": 105.50,
      "paymentGatewayRef": "ref_789",
      "accountNumber": "1234567890",
      "paymentAccountNumbeCurrencyCode": "USD",
      "pin": "1234"
    }'
  ```

  ```javascript JavaScript theme={null}
  const payFromWallet = async (paymentData) => {
    const response = await fetch('https://remitjunction.fincode.software/api/v6/services/paymentmanagement/makepaymentfromwalletaccount', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-Auth-Token': 'your_auth_token',
        'uuid': 'device_uuid',
        'platform': 'WEB'
      },
      body: JSON.stringify({
        payableType: 'TRANSACTION',
        payAbleId: 'txn_abc123',
        password: 'user_password',
        accountId: 'wallet_456',
        totalCheckOutAmount: 105.50,
        paymentGatewayRef: 'ref_789',
        accountNumber: '1234567890',
        paymentAccountNumbeCurrencyCode: 'USD',
        pin: '1234'
      })
    });

    return await response.json();
  };
  ```

  ```python Python theme={null}
  import requests

  url = "https://remitjunction.fincode.software/api/v6/services/paymentmanagement/makepaymentfromwalletaccount"
  headers = {
      "Content-Type": "application/json",
      "X-Auth-Token": "your_auth_token",
      "uuid": "device_uuid",
      "platform": "WEB"
  }
  payload = {
      "payableType": "TRANSACTION",
      "payAbleId": "txn_abc123",
      "password": "user_password",
      "accountId": "wallet_456",
      "totalCheckOutAmount": 105.50,
      "paymentGatewayRef": "ref_789",
      "accountNumber": "1234567890",
      "paymentAccountNumbeCurrencyCode": "USD",
      "pin": "1234"
  }

  response = requests.post(url, json=payload, headers=headers)
  data = response.json()
  ```
</CodeGroup>

## Use Cases

### 1. Pay for Money Transfer

```javascript theme={null}
const payForRemittance = async (transactionId) => {
  // First, get payment methods to confirm wallet balance
  const methods = await getPaymentMethods(transactionPCN);
  const walletMethod = methods.data.paymentMethodsMetadata
    .find(m => m.paymentMethod === 'E_WALLET');
  
  if (!walletMethod.metadata.sufficient) {
    throw new Error('Insufficient wallet balance');
  }
  
  // Process payment from wallet
  const payment = await fetch('/makepaymentfromwalletaccount', {
    method: 'POST',
    headers: headers,
    body: JSON.stringify({
      payableType: 'TRANSACTION',
      payAbleId: transactionId,
      password: userPassword,
      accountId: walletAccountId,
      totalCheckOutAmount: walletMethod.totalAmount,
      paymentGatewayRef: generateRef(),
      paymentAccountNumbeCurrencyCode: 'USD'
    })
  });
  
  return await payment.json();
};
```

### 2. Pay Bill from Wallet

```javascript theme={null}
const payBill = async (billId, amount) => {
  const response = await fetch('/makepaymentfromwalletaccount', {
    method: 'POST',
    headers: headers,
    body: JSON.stringify({
      payableType: 'BILL',
      payAbleId: billId,
      password: userPassword,
      accountId: walletAccountId,
      totalCheckOutAmount: amount,
      paymentGatewayRef: `BILL_${Date.now()}`,
      paymentAccountNumbeCurrencyCode: 'NGN',
      pin: transactionPIN
    })
  });
  
  const result = await response.json();
  
  if (result.status === 'SUCCESS') {
    console.log('Bill paid successfully');
  }
  
  return result;
};
```

### 3. Fund Another Wallet

```javascript theme={null}
const fundWallet = async (fundingRequestId) => {
  const response = await fetch('/makepaymentfromwalletaccount', {
    method: 'POST',
    headers: headers,
    body: JSON.stringify({
      payableType: 'WALLET_CUSTOMER',
      payAbleId: fundingRequestId,
      password: userPassword,
      accountId: sourceWalletId,
      totalCheckOutAmount: fundingAmount,
      paymentGatewayRef: `FUND_${Date.now()}`,
      accountNumber: sourceAccountNumber,
      paymentAccountNumbeCurrencyCode: 'USD'
    })
  });
  
  return await response.json();
};
```
