---
title: "Add Funds to Wallet Account"
source_url: https://docs.rapyd.net/en/add-funds-to-wallet-account.html
lang: en
---

# Add Funds to Wallet Account

Transfer virtual currency to a Rapyd Wallet account.

If the account does not already exist for the indicated currency, it is created.

Use this method in the sandbox for testing purposes.

This method triggers the [Funds Added Webhook](https://docs.rapyd.net/en/funds-added-webhook.md "Funds Added Webhook").

### Parameters

### Request Body Parameters

- - amount
  - Amount of the transaction. Decimal.
- - currency
  - Three-letter ISO 4217 code for the currency used in the `amount` field.
- - ewallet
  - ID of the Rapyd Wallet. String starting with **ewallet_**.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - idempotency
  - A unique key that prevents the platform from creating the same object twice.

    See [Idempotency](https://docs.rapyd.net/en/idempotency.md "Idempotency").
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Response Parameters

- - account_id
  - ID of the Rapyd wallet account. UUID.
- - amount
  - Amount of the transfer, in units of the currency specified in `currency`.
- - balance_type
  - Indicates the type of balance within the Rapyd wallet account.
- - currency
  - The currency of the transfer. Three-letter ISO 4217 code.
- - id
  - ID of the funds transfer transaction. UUID.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - phone_number
  - Phone number of the Rapyd wallet.

### Code Samples

- - .NET

    - ```csharp
      using System;
      using System.Text.Json;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      var metadata = new
                      {
                          merchant_defined = true
                      };

                      var requestObj = new
                      {
                          ewallet = "ewallet_554f0be25b653e4a578db9b7df058e31",
                          amount = "5000",
                          currency = "PHP",
                          metadata,
                      };

                      string request = JsonSerializer.Serialize(requestObj);

                      string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/account/deposit", request);
                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const body = {
            ewallet: 'ewallet_554f0be25b653e4a578db9b7df058e31',
            amount: '5000',
            currency: 'PHP',
            metadata: {
              merchant_defined: true
            }
          };
          const result = await makeRequest('POST', '/v1/account/deposit', body);

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      $body = [
          'ewallet' => 'ewallet_554f0be25b653e4a578db9b7df058e31',
          'amount' => '5000',
          'currency' => 'PHP',
          'metadata' => [
              'merchant_defined' => true
          ],
        ];

      try {
          $object = make_request('post', '/v1/account/deposit', $body);
          var_dump($object);
      } catch(Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      wallet = 'ewallet_554f0be25b653e4a578db9b7df058e31'
      body = {
          "ewallet": wallet,
          "amount": "5000",
          "currency": "PHP",
          "metadata": {
              "merchant_defined": True
          }
      }
      results = make_request(method='post', path='/v1/account/deposit', body=body)
      pprint(results)
      ```

- /v1/account/deposit

- Add Funds to Wallet Account
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/account/deposit' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "amount": 1000,
      "currency": "EUR",
      "ewallet": "ewallet_b9cbf3f4691aab019efacc3e376548df"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "e3a09d6f-ce86-4c9c-9a99-864a8c1be06a"
      },
      "data": {
          "id": "da5422ed-0131-45be-8ddd-af6a95b8a5f5",
          "account_id": "644410b8-e721-43b2-8847-4764cc0e4a00",
          "phone_number": null,
          "amount": 1000,
          "currency": "EUR",
          "balance_type": "available_balance",
          "balance": 5800,
          "metadata": {}
      }
  }
  ```

- Bad Request - Invalid Parameters
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/account/deposit' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "amount": 1000,
      "currency": "EU",
      "ewallet": "ewallet_b9cbf3f4691aab019efacc3e376548df"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "MISSING_INVALID_PARAMETERS",
          "status": "ERROR",
          "message": "A parameter is missing or contains an invalid value. The request was rejected. Corrective action: Check all input parameters.",
          "response_code": "INVALID_CURRENCY",
          "operation_id": "7a1159e1-c633-4b4b-bdd7-3e17a37798b3"
      }
  }
  ```

- Unauthorized
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/accounts/deposit' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'idempotency: your-idempotency-parameter-here' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here' \
  --data-raw '{
      "amount": 10,
      "currency": "EUR",
      "ewallet": "ewallet_b5320c566cc4aa01fe77440ad08693f7"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "UNAUTHORIZED_API_CALL",
          "status": "ERROR",
          "message": "",
          "response_code": "UNAUTHORIZED_API_CALL",
          "operation_id": "434f207a-da2a-4476-9ca5-7f6c0c3d4bb5"
      }
  }
  ```
