Transfer Funds Between Wallets
Transfer funds between Rapyd Wallets.
If the destination wallet does not have an account for the specified currency, the account is created. If the source wallet does not have enough funds in the account for the specified currency, the transfer fails.
The status of the transfer is PEN while the transfer is pending and the transferee has not accepted the transfer.
This method triggers Transfer Funds Between Wallets Created Webhook.
If the transferee fails to respond to the transfer request, the sender must cancel the transaction with Set Transfer Response, with status set to cancel.
Note
Limitation - This feature is available for the following types of wallet:
person
company
client wallet of category disburse or general
To activate this feature, contact Client Support.
This endpoint replaces the deprecated endpoint - POST /v1/account/transfer
Rapyd will continue to support the deprecated endpoint until December 31, 2024.
amount
Amount of the transfer. Decimal.
currency
Three-letter ISO 4217 code for the currency used in the
amount
field.
destination_ewallet
ID of the wallet receiving the money. String starting with ewallet_.
expiration
Determines the day the transfer expires, in Unix time. Acceptance of the transfer must occur before the start of this day.
14 days after creation of the transfer
source_ewallet
ID of the wallet sending the money. 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 { amount = 50, currency = "USD", source_ewallet = "ewallet_56a273c10570528c608f2c6bcdc8ea41", destination_ewallet = "ewallet_43b888d4c038a219c52f45e754139f74", metadata, }; string request = JsonSerializer.Serialize(requestObj); string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/ewallets/transfer", 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 = { amount: 50, currency: 'USD', source_ewallet: 'ewallet_56a273c10570528c608f2c6bcdc8ea41', destination_ewallet: 'ewallet_43b888d4c038a219c52f45e754139f74', metadata: { merchant_defined: true } }; const result = await makeRequest('POST', '/v1/ewallets/transfer', 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 = [ 'amount' => '5000', 'currency' => 'USD', 'source_ewallet' => 'ewallet_56a273c10570528c608f2c6bcdc8ea41', 'destination_ewallet' => 'ewallet_43b888d4c038a219c52f45e754139f74', 'metadata' => [ 'merchant_defined' => true ], ]; try { $object = make_request('post', '/v1/ewallets/transfer', $body); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request body = { "amount": 50, "currency": "USD", "source_ewallet": 'ewallet_56a273c10570528c608f2c6bcdc8ea41', "destination_ewallet": 'ewallet_43b888d4c038a219c52f45e754139f74', "metadata": { "merchant_defined": True } } results = make_request(method='post', path='/v1/ewallets/transfer', body=body) pprint(results)
/v1/ewallets/transfer
Transfer Funds Between Wallets
curl -X post https://sandboxapi.rapyd.net/v1/ewallets/transfer -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 '{ "source_ewallet": "ewallet_e67c8ad63200d781470a04107fbd7c59", "amount": 5, "currency": "USD", "destination_ewallet": "ewallet_e9e973e1c8b9cd030ce573157702ff78" } '
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "0790e2e3-353d-42f8-9deb-f5cdff86f61c" }, "data": { "id": "d2e90d89-60b6-456f-a6a7-5dccf7febf5e", "status": "PEN", "amount": 5, "currency_code": "USD", "destination_phone_number": null, "destination_ewallet_id": "ewallet_e9e973e1c8b9cd030ce573157702ff78", "destination_transaction_id": "", "source_ewallet_id": "ewallet_e67c8ad63200d781470a04107fbd7c59", "source_transaction_id": "wt_ad5149f340d7147f772dd763bc9af7af", "transfer_response_at": 0, "created_at": 1704631595, "metadata": { "merchant_defined": true }, "response_metadata": {}, "expiration": 0 } }
Transfer Funds Between Wallets with Expiration
curl -X post https://sandboxapi.rapyd.net/v1/ewallets/transfer -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 '{ "source_ewallet": "ewallet_613fd9c6593f44ffac0f1532c4eb9e18", "expiration": 1678103732, "amount": 10, "currency": "eur", "destination_ewallet": "ewallet_8f67fd4defacca9e5401f3829a68228a", "metadata": { "merchant_defined": true } } '
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "a2fcb896-112e-4008-a8ac-b4869bbc403a" }, "data": { "id": "d1e8d8a4-b905-11ed-875e-0255f3382f2f", "status": "PEN", "amount": 10, "currency_code": "EUR", "destination_phone_number": null, "destination_ewallet_id": "ewallet_8f67fd4defacca9e5401f3829a68228a", "destination_transaction_id": "", "source_ewallet_id": "ewallet_613fd9c6593f44ffac0f1532c4eb9e18", "source_transaction_id": "wt_d3133e9bc96c23b9c139a3281f3b7592", "transfer_response_at": 0, "created_at": 1677767016, "metadata": { "merchant_defined": true }, "response_metadata": {}, "expiration": 1678103732 } }