> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a Wallet

### Path parameters

<ParamField path="WalletId" type="string" required>
  The unique identifier of the wallet.
</ParamField>

### Body parameters

<ParamField body="Description" type="string">
  Max. length: 255 characters

  The description of the wallet. It can be a name, the type, or anything else that can help you clearly identify the wallet on the platform (and for your end users).
</ParamField>

<ParamField body="Tag" type="string">
  Max. length: 255 characters

  Custom data that you can add to this object.\
  For wallets, you can use this parameter to identify the corresponding end user in your platform.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="Description" type="string">
      Max. length: 255 characters

      The description of the wallet. It can be a name, the type, or anything else that can help you clearly identify the wallet on the platform (and for your end users).
    </ResponseField>

    <ResponseField name="Owners" type="array">
      string

      The unique identifier of the user owning the wallet.

      **Note:** Only one owner can be defined; this array accepts only one string.
    </ResponseField>

    <ResponseField name="Id" type="string">
      Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

      The unique identifier of the object.
    </ResponseField>

    <ResponseField name="Balance" type="object">
      The current balance of the wallet.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the balance.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Currency" type="string">
      **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

      The currency of the wallet.
    </ResponseField>

    <ResponseField name="FundsType" type="string">
      **Returned values:** `DEFAULT`, `FEES`, `CREDIT`

      The type of funds in the wallet:

      * `DEFAULT` – Regular funds for user-owned wallets. Wallets with this `FundsType` cannot have a negative balance.
      * `FEES` – Fees Wallet, for fees collected by the platform, specific to the Client Wallet object.
      * `CREDIT` – Repudiation Wallet, for funds for the platform's dispute management, specific to the Client Wallet object.

      **Note:** The Fees Wallet and Repudiation Wallet are created automatically by Mangopay for each currency.
    </ResponseField>

    <ResponseField name="Tag" type="string">
      Max. length: 255 characters

      Custom data that you can add to this object.\
      For wallets, you can use this parameter to identify the corresponding end user in your platform.
    </ResponseField>

    <ResponseField name="CreationDate" type="Unix timestamp">
      The date and time at which the wallet was created.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
      "Description": "New description of the wallet",
      "Owners": [
          "user_m_01J18HZSACR1EMYNY1TBS8KTJD"
      ],
      "Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
      "Balance": {
          "Currency": "EUR",
          "Amount": 0
      },
      "Currency": "EUR",
      "FundsType": "DEFAULT",
      "Tag": "Updated using Mangopay API Postman collection",
      "CreationDate": 1724921476
  }
  ```
</ResponseExample>

<RequestExample>
  ```json REST   theme={null}
  {
      "Description": "New description of the wallet",
      "Tag": "Updated using Mangopay API Postman collection"
  }  
  ```

  ```php PHP theme={null}
  <?php 

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;
  use MangoPay\Libraries\ResponseException as MGPResponseException;
  use MangoPay\Libraries\Exception as MGPException;

  $api = new MangoPayApi();

  $api->Config->ClientId = 'your-client-id';
  $api->Config->ClientPassword = 'your-api-key';
  $api->Config->TemporaryFolder = 'tmp/';

  try {
      $walletId = '148968396';

      $wallet = $api->Wallets->Get($walletId);
      $wallet->Description = 'Updated again EUR Wallet';
      $wallet->Tag = 'Updated using Mangopay PHP SDK';

      $response = $api->Wallets->Update($wallet);

      print_r($response);
  } catch(MGPResponseException $e) {
      print_r($e);
  } catch(MGPException $e) {
      print_r($e);
  }  
  ```

  ```javascript NodeJS   theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk')
  const mangopay = new mangopayInstance({
      clientId: 'your-client-id',
      clientApiKey: 'your-api-key'
  })

  let myWallet = {
    Id: '174796439',
    Description: 'updated description',
    Tag: 'updated tag',
  }

  const updateWallet = async (wallet) => {
    return await mangopay.Wallets.update(wallet)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  updateWallet(myWallet)  
  ```

  ```ruby Ruby   theme={null}
  require 'mangopay'

  MangoPay.configure do |client|
      client.preproduction = true
      client.client_id = 'your-client-id'
      client.client_apiKey = 'your-api-key'
      client.log_file = File.join(Dir.pwd, 'mangopay.log')
  end

  def updateWallet(walletId, params)
      begin
          response = MangoPay::Wallet.update(walletId, params)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to update wallet: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myWallet = {
    Id: '194311640'
  }

  myParams = {
      Description: 'Updated description',
      Tag: 'Updated tag'
  }

  updateWallet(myWallet[:Id], myParams)  
  ```

  ```java Java   theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.core.Money;
  import com.mangopay.entities.Wallet;

  public class UpdateWallet {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");

          Wallet wallet = mangopay.getWalletApi().get("wlt_m_01HSV2W1JYHZQMW24EWREKEN62");

          wallet.setTag("Updated using the Mangopay Java SDK");

          Wallet updateWallet = mangopay.getWalletApi().update(wallet);

          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(updateUbo);

          System.out.println(updateWallet);
      }
  }
  ```

  ```python Python   theme={null}
  from pprint import pprint
  import mangopay

  mangopay.client_id='your-client-id'
  mangopay.apikey='your-api-key'

  from mangopay.api import APIRequest
  handler = APIRequest(sandbox=True)

  from mangopay.resources import NaturalUser, Wallet

  natural_user = NaturalUser.get('213753890')

  user_wallet = Wallet(
      id = '215029593',
      owners=[natural_user],
      description='EUR Wallet of Rhoda Keeling'
  )

  update_wallet = user_wallet.save()

  pprint(update_wallet)  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Entities.PUT;
  using Newtonsoft.Json;

  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();

          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          var userId = "user_m_01J2TZ261WZNDM0ZDRWGDYA4GN";
          var walletId = "wlt_m_01J2Y06CEN8J3K19KP0F7YJVNT";

          var wallet = new WalletPutDTO {
              Owners = [userId],
              Description = "BLIK Wallet",
              Tag = "Updated using Mangopay .NET SDK"
          };

          var updateWallet = await api.Wallets.UpdateAsync(wallet, walletId);

          string prettyPrint = JsonConvert.SerializeObject(updateWallet, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
