> ## 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.

# List Wallets for a User

<Warning>
  **Caution - ScaContext default value changing**

  On this endpoint, the default value for `ScaContext` is changing to `USER_PRESENT` on **Dec 15, 2025** (Dec 1 in Sandbox).

  From this date, if the `PendingUserAction.RedirectUrl` value is returned, then you need to redirect the user to perform SCA.

  With approval from Mangopay, your platform may be able to use the `USER_NOT_PRESENT` value provided you also have a legal proxy in place with the user and the user's consent to access wallet balances and transactions on their behalf (read more about [proxy management](/guides/sca/proxy-management)).
</Warning>

<Note>
  **Note – SCA triggered by this endpoint**

  This endpoint requires the user to [perform SCA to authenticate](/guides/sca/wallets) the access to their wallet, unless SCA for wallet access was successfully completed in the last 180 days (or unless your platform is using a [proxy and user consent](/guides/sca/proxy-management)).

  When SCA is required, this endpoint returns a **401 - Unauthorized** response.

  To let the user complete the SCA session on the Mangopay-hosted webpage, your platform needs to retrieve the `RedirectUrl` from the `WWW-Authenticate` response header, add an encoded `returnUrl` query parameter, and redirect the user. Read more about how to redirect them in the [SCA session](/guides/sca/session) guide.

  In Sandbox, you can bypass SCA by including the word `accept` in the `Email` value of the [Natural User](/api-reference/users/natural-user-object-sca) or the `LegalRepresentative.Email` value of the [Legal User](/api-reference/users/legal-user-object-sca) – for example `accept@example.com` or `john.doe+accept@example.com`.
</Note>

### Path parameters

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

### Query parameters

<ParamField query="ScaContext" type="string">
  **Possible values:** `USER_PRESENT`, `USER_NOT_PRESENT`

  The SCA context of the request, which is **required** if the user's `UserCategory` is `OWNER`:

  * `USER_PRESENT` – The user is taking the SCA-triggering action of accessing their wallet. The platform must [redirect the user](/guides/sca/session) using the `PendingUserAction.RedirectUrl` returned so that the user can complete the SCA session (unless exempted because a successful SCA session for wallet access occurred in the last 180 days, so no redirection link was returned).
  * `USER_NOT_PRESENT` – The platform is taking the action under proxy from the user and the user has previously given consent to Mangopay (via the SCA hosted experience) to allow the action. If the user has not given (or has revoked) their consent, then `USER_NOT_PRESENT` returns a 403 error.

  Read more about [managing proxy and user consent](/guides/sca/proxy-management) **→**

  **Note:** For existing platforms, the parameter is technically optional if the User is an `OWNER`, and the default value will become `USER_PRESENT` from **Dec 15, 2025** (Dec 1 in Sandbox)
</ParamField>

<ParamField query="per_page" type="integer">
  Min. value: `1`; max. value: `100`

  **Default value:** `10`

  Indicates the number of items returned for each page of the pagination.
</ParamField>

<ParamField query="page" type="integer">
  Start value: `1`

  **Default value:** `1`

  Indicates the index of the page for the pagination.
</ParamField>

<ParamField query="Sort" type="string">
  **Possible values:** `CreationDate:ASC`, `CreationDate:DESC`

  **Default value:** `CreationDate:ASC`

  Indicates the direction in which to sort the list.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="Array (Wallets)" type="array">
      The list of wallets created by the platform.

      <Expandable title="properties">
        <ResponseField name="Object (Wallet)" type="object">
          The Wallet object created by the platform.

          <Expandable title="properties">
            <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="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="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="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>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<AccordionGroup>
  <Accordion title="401 - SCA required" defaultOpen>
    When SCA is required for wallet access, this endpoint returns a **401 - Unauthorized** response code with the `redirectUrl` in the `WWW-Authenticate` response header:

    ```HTTP 401 response header theme={null}
    WWW-Authenticate: PendingUserAction redirectUrl=https://sca.sandbox.mangopay.com/?token=0193cf51ed367151a0cb1c59def21e13
    ```

    In this case, your platform needs to retrieve the URL value, encode and add a `returnUrl` query parameter, and redirect the user.

    Read more about [SCA redirection](/guides/sca/) and [SCA on wallet access](/guides/sca/wallets) **→**
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  [
      {
          "Description": "Description of the user's wallet",
          "Owners": [
              "user_m_01J18HZSACR1EMYNY1TBS8KTJD"
          ],
          "Id": "wlt_m_01J18J1SQGG6KXNM3F8GD674TP",
          "Balance": {
              "Currency": "EUR",
              "Amount": 99800
          },
          "Currency": "EUR",
          "FundsType": "DEFAULT",
          "Tag": "Created using Mangopay API Postman Collection",
          "CreationDate": 1719348029
      },
      {
          "Description": "Description of the user's wallet",
          "Owners": [
              "user_m_01J18HZSACR1EMYNY1TBS8KTJD"
          ],
          "Id": "wlt_m_01J6EN9X1Q0PGM0CJ9QD197CRG",
          "Balance": {
              "Currency": "GBP",
              "Amount": 0
          },
          "Currency": "GBP",
          "FundsType": "DEFAULT",
          "Tag": "Created using Mangopay API Postman Collection",
          "CreationDate": 1724921476
      }
  ]
  ```

  ```json 401 - SCA required theme={null}
  // No response body, redirectUrl returned in WWW-Authenticate response header
  ```
</ResponseExample>

<RequestExample>
  ```json REST theme={null}
  // GET has no body parameters
  ```

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

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;

  $api = new MangoPayApi();

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

  try {
      $userId = 'user_m_01K894KCN9MKGAJDCCDGQ7RSQX';
      $pagination = new \MangoPay\Pagination(1, 10);
      $filter = new FilterWallets();
      $filter->ScaContext = "USER_PRESENT";

      $response = $api->Users->GetWallets($userId, $pagination, null, $filter);

      print_r($response);
  } catch (\MangoPay\Libraries\ResponseException $exception) {
      print_r($exception->GetErrorDetails()->Data['RedirectUrl']);
  }
  ```

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

  let user = {
    Id: "user_m_01JZ8AVM2Y1RWVY1RT396BYW9V",
  };

  const listUserWallets = async (userId) => {
    return await mangopay.Users.getWallets(userId, {
      parameters: {
        ScaContext: "USER_PRESENT", // SCA every 180 days for wallet access
      },
      resolveWithFullResponse: true, // to retrieve www-authenticate header with PendingUserAction RedirectUrl
    })
      .then((response) => {
        console.info(response);
        return response;
      })
      .catch((err) => {
        console.log(err);
        return false;
      });
  };

  listUserWallets(user.Id);
  ```

  ```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 listUserWallets(userId)
      begin
          response = MangoPay::User.wallets(userId, {'ScaContext': 'USER_PRESENT'})
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to fetch wallets for the user: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myUser = {
      Id: 'user_m_01JXJ256GTH5TKXF6RGVFYQVV7',
  }

  listUserWallets(myUser[:Id])  
  ```

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

  import java.util.List;

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

          var userId = "user_m_01HSAVT2J0REPGV5ZRPNK079K9";

          // Pagination: 20 per page, starting at page 1
          Pagination pagination = new Pagination(1, 20);
          
          // Filter with ScaContext
          FilterWallets filter = new FilterWallets();
          filter.setScaContext("USER_PRESENT");
          
          // Sorting: CreationDate DESC
          Sorting sorting = new Sorting();
          sorting.addField("CreationDate", SortDirection.desc);

          List<Wallet> wallets = mangopay.getUserApi().getWallets(userId, pagination, filter, sorting);

          for (Wallet wallet : wallets) {
              Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
              String prettyJson = prettyPrint.toJson(wallet);

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

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

  natural_user = NaturalUserSca.get('user_m_01K884VNR86ZHV9RA6G602AXZW')

  try:
      all_wallets = Wallet.get_all_for_user(user.id, **{"ScaContext": 'USER_NOT_PRESENT'}, page=1, per_page=100)
  except APIError as ex:
      print(ex.headers.get('www-authenticate'))
  ```

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

  public class ListUserWalletsSca
  {
      public void Run()
      {
          Task.Run(async () =>
          {
              MangoPayApi api = new MangoPayApi();

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

              var userId = "user_m_01K8AZGCCWGE9AA7J2M7ZE0SQ5";
              var filter = new FilterWallets
              {
                  ScaContext = "USER_PRESENT"
              };
              var pagination = new Pagination(1, 10);

              try
              {
                  await api.Users.GetWalletsAsync(userId, pagination, filter);
              }
              catch (ResponseException ex)
              {
                  Dictionary<string, string> data = ex.ResponseError.Data;
                  string prettyPrint = JsonConvert.SerializeObject(data, Formatting.Indented);
                  Console.WriteLine(prettyPrint);
              }
          }).GetAwaiter().GetResult();
      }
  }
  ```
</RequestExample>
