Skip to main content

Documentation

Remove Funds From Wallet Account

Remove virtual currency from a Rapyd Wallet account.

If the account does not have sufficient funds in the indicated currency, the funds transfer fails.

Use this method in the sandbox for testing purposes.

This method triggers the Funds Removed Webhook.

    • amount

    • The 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_090e1ef18c3aa754fd43cce9ee454858",
                            amount = "100",
                            currency = "USD",
                            metadata,
                        };
        
                        string request = JsonSerializer.Serialize(requestObj);
        
                        string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/account/withdraw", 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_090e1ef18c3aa754fd43cce9ee454858',
              amount: '100',
              currency: 'USD',
              metadata: {
                merchant_defined: true
              }
            };
            const result = await makeRequest('POST', '/v1/account/withdraw', 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_090e1ef18c3aa754fd43cce9ee454858',
            'amount' => '100',
            'currency' => 'USD',
            'metadata' => [
                'merchant_defined' => true
            ],
          ];
        
        try {
            $object = make_request('post', '/v1/account/withdraw', $body);
            var_dump($object);
        } catch(Exception $e) {
            echo "Error: $e";
        }
        ?>
    • Python

      • from pprint import pprint
        
        from utilities import make_request
        
        wallet = 'ewallet_090e1ef18c3aa754fd43cce9ee454858'
        body = {
            "ewallet": wallet,
            "amount": "100",
            "currency": "USD",
            "metadata": {
                "merchant_defined": True
            }
        }
        results = make_request(method='post', path='/v1/account/withdraw', body=body)
        pprint(results)
  • /v1/account/withdraw

  • Remove Funds From Wallet Account

  • curl -X post
    https://sandboxapi.rapyd.net/v1/account/withdraw
    -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 '{
        "ewallet": "ewallet_090e1ef18c3aa754fd43cce9ee454858",
        "amount": "100",
        "currency": "USD",
        "metadata": {
            "merchant_defined": true
        }
    }
    '
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "23a82f1d-397b-46a7-9077-1335642754e0"
        },
        "data": {
            "id": "8efa7651-ae65-481c-a025-d93f6b902859",
            "account_id": "96dd8958-48cf-11ea-833c-02e199f7f6f5",
            "phone_number": "+14155539886",
            "amount": -100,
            "currency": "USD",
            "balance_type": "available_balance",
            "metadata": {
                "merchant_defined": true
            }
        }
    }