Delete Wallet
Delete a Rapyd Wallet.
Use this method when the wallet has never been used.
Close all virtual accounts issued to the wallet before using this method. See Delete Virtual Account.
This method triggers the Wallet Status Changed Webhook and the Wallet Deleted Webhook.
Note
This endpoint replaces the deprecated endpoint -
DELETE /v1/user/:walletRapyd no longer supports the deprecated endpoint.
The code samples include successful requests (200), bad requests (400), and an unauthorized request (401). For all error messages that appear due to bad requests, see Wallet Errors, Wallet Contact Errors, and General Errors.
ewallet
ID of the wallet. String starting with ewallet_.
None.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string wallet = "ewallet_dc5fe877ee8af918b5e2cc3a24abd812"; string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/user/{wallet}"); 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 result = await makeRequest('DELETE', '/v1/user/ewallet_dc5fe877ee8af918b5e2cc3a24abd812'); 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); try { $object = make_request('delete', '/v1/user/ewallet_dc5fe877ee8af918b5e2cc3a24abd812'); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request wallet_id = 'ewallet_dc5fe877ee8af918b5e2cc3a24abd812' delete_results = make_request(method='delete', path=f'/v1/user/{wallet_id}') pprint(delete_results)
/v1/ewallets/:ewallet
Delete Wallet
curl -X delete 'https://sandboxapi.rapyd.net/v1/ewallets/ewallet_2c9ce67d262955f925b671030639a55a' -H 'access_key: your-access-key-here' -H 'Content-Type: application/json' -H 'salt: your-random-string-here' -H 'signature: your-calculated-signature-here' -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "23bb9aa5-b470-4f9c-b854-5d000fb48ad2" } }
Bad Request - Deleted Wallet
curl -X delete 'https://sandboxapi.rapyd.net/v1/ewallets/ewallet_2c9ce67d262955f925b671030639a55a' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "ERROR_GET_USER", "status": "ERROR", "message": "The request attempted an operation that requires a wallet, but the wallet was not found. The request was rejected. Corrective action: Use the ID of a valid wallet that has not been deleted. The ID is a string starting with 'ewallet_'.", "response_code": "ERROR_GET_USER", "operation_id": "5400d046-68e6-4ded-b05f-e30b39a4b6f0" } }
Unauthorized
curl -X delete 'https://sandboxapi.rapyd.net/v1/ewallets/ewallet_d496b5377c6c6c1d8c0c9ba3fec1d073' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here'
{ "status": { "error_code": "UNAUTHENTICATED_API_CALL", "status": "ERROR", "message": "The request was rejected due to an authentication issue. Corrective action: Check the status of your account in the 'Account Details' page of the Client Portal.", "response_code": "UNAUTHENTICATED_API_CALL", "operation_id": "648a2938-8e4f-4d92-9ad1-ce6d25c51a99" } }