> ## 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.

# Fund Wallet

> Adds funds to a user wallet account.

Adds a specified amount to a user's wallet account. This is used to fund the wallet before making investments.

## Request Headers

<ParamField header="X-Auth-Token" type="string" required>
  The **JWT Access Token** obtained from the `/login` or `/refresh-token` endpoint.
</ParamField>

<ParamField header="x-idempotency-key" type="string" required>
  Unique idempotency key for the request to prevent duplicate processing.
</ParamField>

<ParamField header="x-fapi-auth-date" type="string" required>
  The date and time at which the request was initiated (ISO 8601 format).
</ParamField>

<ParamField header="x-fapi-customer-ip-address" type="string" required>
  The IP address of the customer making the request.
</ParamField>

<ParamField header="x-fapi-interaction-id" type="string" required>
  Unique identifier for the interaction/session.
</ParamField>

## Path Parameters

<ParamField path="wallet-id" type="string" required>
  The unique identifier (UUID) of the wallet to fund.
</ParamField>

<ParamField path="amount" type="number" required>
  The amount to add to the wallet.
</ParamField>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://test-investment-products-service.fincode.software/api/v1/user/wallet/fund-wallet/123e4567-e89b-12d3-a456-426614174000/50000' \
  --header 'X-Auth-Token: YOUR_JWT_ACCESS_TOKEN' \
  --header 'x-idempotency-key: unique-key-12345' \
  --header 'x-fapi-auth-date: 2024-01-15T10:30:00Z' \
  --header 'x-fapi-customer-ip-address: 192.168.1.1' \
  --header 'x-fapi-interaction-id: interaction-12345'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const BASE_URL = 'https://test-investment-products-service.fincode.software/api/v1/user/wallet';

  async function fundWallet(accessToken, walletId, amount) {
    try {
      const response = await axios.put(
        `${BASE_URL}/fund-wallet/${walletId}/${amount}`,
        {},
        {
          headers: {
            'X-Auth-Token': accessToken,
            'x-idempotency-key': `key-${Date.now()}`,
            'x-fapi-auth-date': new Date().toISOString(),
            'x-fapi-customer-ip-address': '192.168.1.1',
            'x-fapi-interaction-id': `interaction-${Date.now()}`,
          },
        }
      );

      if (response.data.data) {
        console.log(`Wallet ${walletId} funded successfully with ${amount}`);
      } else {
        console.log('Wallet funding failed');
      }
      return response.data.data;
    } catch (error) {
      console.error(
        'Failed to fund wallet:',
        error.response?.data || error.message
      );
      throw error;
    }
  }

  ```
</CodeGroup>


## OpenAPI

````yaml PUT /wallet/fund-wallet/{wallet-id}/{amount}
openapi: 3.0.0
info:
  title: FinCode API
  version: v6
servers:
  - url: https://{tenant}.fincode.software/api/v6/services
    description: API v6
    variables:
      tenant:
        default: remitjunction
        description: Enter your tenant subdomain
  - url: https://{tenant}.fincode.software/api/v1/services
    description: API v1
    variables:
      tenant:
        default: finlend
        description: Enter your tenant subdomain
  - url: https://api.stag.songhaiexchange.io
    description: Songhai Exchange API
security: []
paths:
  /wallet/fund-wallet/{wallet-id}/{amount}:
    put:
      summary: Fund Wallet
      description: Adds funds to a user wallet account.
      operationId: fundWallet
      parameters:
        - $ref: '#/components/parameters/platformHeader'
        - $ref: '#/components/parameters/uuidHeader'
        - in: header
          name: X-Auth-Token
          schema:
            type: string
          required: true
        - in: header
          name: x-idempotency-key
          schema:
            type: string
          required: true
        - in: path
          name: wallet-id
          schema:
            type: string
          required: true
        - in: path
          name: amount
          schema:
            type: number
          required: true
      responses:
        '200':
          description: Funding status
      servers:
        - url: >-
            https://test-investment-products-service.fincode.software/api/v1/user
components:
  parameters:
    platformHeader:
      in: header
      name: platform
      schema:
        type: string
        default: fincode
      required: true
    uuidHeader:
      in: header
      name: uuid
      schema:
        type: string
        default: '200'
      required: true

````