---
title: "Remove Funds From Wallet Account"
source_url: https://docs.rapyd.net/en/remove-funds-from-wallet-account.html
lang: en
---

# 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](https://docs.rapyd.net/en/funds-removed-webhook.md "Funds Removed Webhook").

### Parameters

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - idempotency
  - A unique key that prevents the platform from creating the same object twice.

    See [Idempotency](https://docs.rapyd.net/en/idempotency.md "Idempotency").
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Request Body Parameters

- - 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_**.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").

### Response Parameters

- - account_id
  - ID of the Rapyd wallet account. UUID.
- - amount
  - Amount of the transfer, in units of the currency specified in `currency`.
- - balance_type
  - Indicates the type of balance within the Rapyd wallet account.
- - currency
  - The currency of the transfer. Three-letter ISO 4217 code.
- - id
  - ID of the funds transfer transaction. UUID.
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - phone_number
  - Phone number of the Rapyd wallet.

### Code Samples

- - .NET

    - ```csharp
      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

    - ```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
      <?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

    - ```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
  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' \
  --data-raw '{
      "ewallet": "ewallet_b9cbf3f4691aab019efacc3e376548df",
      "amount": "1001",
      "currency": "EUR"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "622c44b9-dfae-4e51-8e61-318c46dc0c4d"
      },
      "data": {
          "id": "93a24582-fc35-476f-a9f1-15b3a6ae44a3",
          "account_id": "644410b8-e721-43b2-8847-4764cc0e4a00",
          "phone_number": null,
          "amount": -1001,
          "currency": "EUR",
          "balance_type": "available_balance",
          "balance": 4799,
          "metadata": {}
      }
  }
  ```

- Bad Request - Wallet Not Found
- ```curl
  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' \
  --data-raw '{
      "ewallet": "ewallet_b9cbf3f4691aab019efacc3e376548d",
      "amount": "1001",
      "currency": "EUR"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "ERROR_UPDATE_FUNDS",
          "status": "ERROR",
          "message": "The request tried to add funds to or remove funds from a wallet, but the wallet was not found. The request was rejected. Corrective action: Set 'ewallet' to the ID of a valid wallet that has not been blocked or deleted. The ID is a string starting with 'ewallet_'.",
          "response_code": "ERROR_UPDATE_FUNDS",
          "operation_id": "188820f8-90dd-48e6-85cb-813e1f5371c5"
      }
  }
  ```

- Unauthorized
- ```curl
  curl -X post 'https://sandboxapi.rapyd.net/v1/accounts/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' \
  --data-raw '{
      "ewallet": "ewallet_b9cbf3f4691aab019efacc3e376548df",
      "amount": "1001",
      "currency": "EUR"
  }'
  ```
- ```json
  {
      "status": {
          "error_code": "UNAUTHORIZED_API_CALL",
          "status": "ERROR",
          "message": "",
          "response_code": "UNAUTHORIZED_API_CALL",
          "operation_id": "20178a0f-060e-4778-b409-1965d785ea0e"
      }
  }
  ```
