Skip to main content

Documentation

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

    • ewallet

    • ID of the wallet. String starting with ewallet_.

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": "43372387-f200-4071-bdd4-47126adc26e0"
        }
    }
  • 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"
        }
    }