Skip to main content

Documentation

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.

    • 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_.

Code Samples
    • .NET

      • 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

      • 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
        $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

      • 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 -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'
    -d '{
        "amount": 1000,
        "currency": "USD",
        "ewallet": "ewallet_755b0fd11fd22b33328fff7d30f3ce30",
        "metadata": {
            "merchant_defined": true
        }
    }
    '
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "2f166dcf-19a5-4393-aa47-bf6e3434b3b6"
        },
        "data": {
            "id": "c10e06e8-c93a-46ea-a16c-3a45639663ba",
            "account_id": "ef17c6f3-fcdc-11ea-bbd7-02c4887b9dab",
            "phone_number": "+14155551934",
            "amount": 5000,
            "currency": "PHP",
            "balance_type": "available_balance",
            "metadata": {
                "merchant_defined": true
            }
        }
    }