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

# Wallets report

> List user wallets, their owners, descriptions and tags, and their balances at the time of report creation

The **Wallets** report lists user wallets, their owners, descriptions and tags, and their balances at the time of report creation.

You can access this report <a href="https://hub.mangopay.com/" target="_blank">in the Dashboard</a> in ***Dashboard (Legacy)*** >  ***Reporting*** > ***+ (right side)***.

The **Wallets** report is only available in the legacy Dashboard. It also uses a different endpoint and [generation flow](#generate-via-api).

## Columns

The **Wallets** report has the following columns and columns used by default.

<table>
  <thead>
    <tr>
      <th class="header">Column</th>
      <th class="header">Description</th>
      <th class="header">Included by default</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td class="table-content">Id</td>
      <td class="table-content">The unique identifier of the wallet.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">Tag</td>
      <td class="table-content">Custom data that can be added to the wallet.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">CreationDate</td>
      <td class="table-content">The date and time at which the wallet was created in a timestamp format.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">CreationDate:ISO</td>
      <td class="table-content">The date and time at which the wallet was created in the following format: dd/MM/yyyy HH:mm:ss.</td>
      <td class="table-content">No</td>
    </tr>

    <tr>
      <td class="table-content">Owners</td>
      <td class="table-content">The Id of the user attached to the wallet.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">Description</td>
      <td class="table-content">The description of the wallet. It can be a name, a type, anything that can help you clearly identify the wallet on the platform (and for your end users).</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">BalanceAmount</td>
      <td class="table-content">The current balance of the wallet.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">BalanceCurrency</td>
      <td class="table-content">The currency of the balance of the wallet.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">Currency</td>
      <td class="table-content">The currency of the wallet.</td>
      <td class="table-content">Yes</td>
    </tr>

    <tr>
      <td class="table-content">FundsType</td>
      <td class="table-content">The type of funds in the wallet, which can be DEFAULT, FEES, or CREDIT.</td>
      <td class="table-content">Yes</td>
    </tr>
  </tbody>
</table>

## Generate via API

<Steps>
  <Step title="Set up callback URL (optional)">
    If downloading large quantities of data, you may wish to define a URL on which to be notified that the report is ready. In the Wallets report, you can do this in the `CallbackURL` parameter of the [POST Create a Wallets Report](/api-reference/reports/create-wallets-report) endpoint.
  </Step>

  <Step title="Define filters and columns">
    In the [POST Create a Wallets Report](/api-reference/reports/create-wallets-report) endpoint, use the `Filters` parameter to filter the data to be returned in the report.

    The `BeforeDate` and `AfterDate` filters refer to the `CreationDate` of the wallets. This range can't exceed 24 months.

    If no `Filters` are specified, the report contains all wallets created in the last 1 month.

    The columns set by default are [listed above](#columns). You can customize this in the `Columns` parameter by sending the full list of columns you wish to see in the report.
  </Step>

  <Step title="Run the report">
    Run the report by calling the [POST Create a Wallets Report](/api-reference/reports/create-wallets-report) endpoint.

    Send your defined filters in the `Filters` parameter and, if not using the default columns, the full list of columns you wish to include in the `Columns` parameter.

    <CodeGroup>
      ```json REST expandable theme={null}
      {
          "Tag": "Created using Mangopay API Postman Collection",
          "DownloadFormat": "CSV",
          "CallbackURL": null,
          "Sort": "CreationDate:ASC",
          "Preview": false,
          "Filters": {
              "BeforeDate": 1658838931,
              "AfterDate": 1656246931,
              "OwnerId": null,
              "Currency": null,
              "MinBalanceAmount": null,
              "MinBalanceCurrency": null,
              "MaxBalanceAmount": null,
              "MaxBalanceCurrency": null
          },
          "Columns": [
              "Id",
              "Tag",
              "CreationDate",
              "Owners",
              "Description",
              "BalanceAmount",
              "BalanceCurrency",
              "Currency",
              "FundsType"
          ]
      }
      ```

      ```php PHP expandable 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 {
          $reportRequest = new \MangoPay\ReportRequest();
          $reportRequest->ReportType = \MangoPay\ReportType::Wallets;
          $reportRequest->CallbackURL = 'http://example.com';
          $reportRequest->Tag = 'Created using Mangopay PHP SDK';
          
          $reportRequest->Filters = [
              'Currency' => 'EUR',
              'BalanceAmount' => [
                  'Min' => 1,
                  'Max' => 1000000
              ],
              'BeforeDate' => 1658838931,
              'AfterDate'  => 1656246931,
              'OwnerId' => null,
              'MinBalanceAmount' => 1, 
              'MinBalanceCurrency' => 'EUR',
              'MaxBalanceAmount' => 100000000,
              'MaxBalanceCurrency' => 'EUR',
          ];

          $reportRequest->Columns = [
              'Id',
              'CreationDate',
              'Tag',
              'Owners',
              'Description',
              'BalanceAmount',
              'BalanceCurrency',
              'Currency',
              'FundsType',
          ];

          $response = $api->Reports->Create($reportRequest);

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

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

      let myWalletsReport = {
        ReportType: 'WALLET',
        Tag: 'Created with Mangopay NodeJs SDK',
        DownloadFormat: 'CSV',
        CallbackURL: 'http://example.com',
        Sort: 'CreationDate:ASC',
        Preview: false,
        Filters: {
          BeforeDate: 1658838931,
          AfterDate: 1656246931,
          OwnerId: null,
          Currency: 'EUR',
          MinBalanceAmount: 1,
          MinBalanceCurrency: 'EUR',
          MaxBalanceAmount: 1000000,
          MaxBalanceCurrency: 'EUR',
        },
        Columns: [
          'Id',
          'Tag',
          'CreationDate',
          'Owners',
          'Description',
          'BalanceAmount',
          'BalanceCurrency',
          'Currency',
          'FundsType',
        ],
      }

      const createWalletsReport = async (report) => {
        return await mangopay.Reports.create(report)
          .then((response) => {
            console.info(response)
            return response
          })
          .catch((err) => {
            console.log(err)
            return false
          })
      }

      createWalletsReport(myWalletsReport)  
      ```

      ```ruby Ruby expandable 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

      myReport = {
          ReportType: 'wallets',
          Tag: 'Created with Mangopay Ruby SDK',
          DownloadFormat: 'CSV',
          CallbackURL: 'http://example.com',
          Sort: 'CreationDate:ASC',
          Preview: false,
          Filters: {
            BeforeDate: 1658838931,
            AfterDate: 1656246931,
            OwnerId: nil,
            Currency: 'EUR',
            MinBalanceAmount: 1,
            MinBalanceCurrency: 'EUR',
            MaxBalanceAmount: 1000000,
            MaxBalanceCurrency: 'EUR'
          },
          Columns: [
            'Id',
            'Tag',
            'CreationDate',
            'Owners',
            'Description',
            'BalanceAmount',
            'BalanceCurrency',
            'Currency',
            'FundsType'
          ]

      }

      createWalletsReport(myReport)  
      ```

      ```python Python expandable 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 ReportWallets
      from mangopay.utils import ReportWalletsFilters

      wallets_report = ReportWallets(
          tag = 'Created using Mangopay Python SDK',
          download_format  = 'CSV',
          callback_url = 'http://example.com',
          sort = 'CreationDate: ASC',
          preview = False,
          filters = ReportWalletsFilters(
              currency = 'GBP',
              min_balance_amount = 1,
              min_balance_currency = 'GBP',
              max_balance_amount = 100000,
              max_balance_currency = 'GBP'
          ),
          columns = [
            'Id',
            'Tag',
            'CreationDate',
            'Owners',
            'Description',
            'BalanceAmount',
            'BalanceCurrency',
            'Currency',
            'FundsType'
          ]
      )

      create_report = wallets_report.create()

      pprint(create_report._data)  
      ```

      ```csharp .NET expandable theme={null}
      using MangoPay.SDK;
      using MangoPay.SDK.Core.Enumerations;
      using MangoPay.SDK.Entities.POST;
      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 report = new ReportRequestPostDTO(ReportType.WALLETS) {
                  Filters = {
                      MinBalanceAmount = 500,
                      MinBalanceCurrency = CurrencyIso.EUR,
                      MaxBalanceAmount = 50000,
                      MaxBalanceCurrency = CurrencyIso.EUR
                  },
                  Columns = [
                      "Id",
                      "CreationDate",
                      "Tag",
                      "Owners",
                      "Description",
                      "BalanceAmount",
                      "BalanceCurrency",
                      "Currency",
                      "FundsType",
                  ],
                  CallbackURL = "http://example.com",
                  Tag = "Created using the Mangopay .NET SDK"
              };
              

              var createReport = await api.Reports.CreateAsync(report);

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

    The API response shows the `Status` as `PENDING`, indicating that the report is being generated. It also shows the filters and columns set by default if not sent.

    <CodeGroup>
      ```json 200 expandable theme={null}
      {
          "Id": "report_m_01JFA0QC7K9CJ339JX4KV08CMW",
          "CreationDate": 1734429356,
          "Tag": "Created using Mangopay API Postman Collection",
          "ReportDate": null,
          "Status": "PENDING",
          "DownloadFormat": "CSV",
          "DownloadURL": null,
          "CallbackURL": null,
          "ReportType": "WALLETS",
          "Sort": "CreationDate:ASC",
          "Preview": false,
          "Filters": {
              "BeforeDate": 1658838931,
              "AfterDate": 1656246931,
              "OwnerId": null,
              "Currency": null,
              "MinBalanceAmount": null,
              "MinBalanceCurrency": null,
              "MaxBalanceAmount": null,
              "MaxBalanceCurrency": null
          },
          "Columns": [
              "Id",
              "Tag",
              "CreationDate",
              "Owners",
              "Description",
              "BalanceAmount",
              "BalanceCurrency",
              "Currency",
              "FundsType"
          ],
          "ResultCode": null,
          "ResultMessage": null
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Download when ready">
    The report is ready for download when its status changes from `PENDING` to `READY_FOR_DOWNLOAD`. This event triggers a notification to your `CallbackURL` (defined in Step 1) with the following format:

    > https<span>://www</span>.example.com?EventType=REPORT\_READY\_FOR\_DOWNLOAD\&ResourceId=`ReportId`\&Date=`ReportDate`

    Using the `ReportId` as the path parameter, call the legacy [GET View a Report](/api-reference/reports/view-report) endpoint to retrieve the `DownloadURL` value where you can download the report.
  </Step>

  <Step title="Repeat process as needed">
    The Wallets report `DownloadURL` value is valid for 24 hours. After this, the `Status` changes to `EXPIRED` at it is no longer available for download.

    You can re-generate another report with the same parameters and update the date range for the latest period.
  </Step>
</Steps>
