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

# View a Report

> Retrieve a legacy report

### Path parameters

<ParamField path="ReportId" type="string" required>
  The unique identifier of the legacy report.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <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="CreationDate" type="Unix timestamp">
      The date and time at which the object was created.
    </ResponseField>

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

      Custom data that you can add to this object.

      For reports, this parameter can be useful to give the report a name.
    </ResponseField>

    <ResponseField name="ReportDate" type="Unix timestamp | null">
      The date and time at which the report was generated.
    </ResponseField>

    <ResponseField name="Status" type="string">
      **Returned values:** `PENDING`, `READY_FOR_DOWNLOAD`, `FAILED`, `EXPIRED`

      The status of the report:

      * `PENDING` – The report is being generated.
      * `READY_FOR_DOWNLOAD` – The report has been created, and can be downloaded.
      * `FAILED` – The report cannot be generated.
      * `EXPIRED` – The report was created, but is no longer available for download (it can be re-run to be downloaded again with fresh data).
    </ResponseField>

    <ResponseField name="DownloadFormat" type="string">
      **Returned values:** `CSV`

      The format in which the report is going to be downloaded.
    </ResponseField>

    <ResponseField name="DownloadURL" type="string | null">
      The URL at which the report file can be downloaded when the `Status` is `GENERATED`.
    </ResponseField>

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

      The URL to which the notification indicating that the report is ready to be downloaded will be sent.
    </ResponseField>

    <ResponseField name="ReportType" type="string">
      The type of the report, indicating whether it lists transactions or wallets.
    </ResponseField>

    <ResponseField name="Sort" type="string">
      The sorting direction of the CreationDate column. By default, the generated report is sorted by ascending creation date.
    </ResponseField>

    <ResponseField name="Preview" type="boolean">
      Whether the report is limited to the first 10 lines (and therefore quicker to generate).
    </ResponseField>

    <ResponseField name="Filters" type="object">
      The filtering parameters to optimize the report.

      <Expandable title="properties">
        <ResponseField name="BeforeDate" type="Unix timestamp">
          **Returned values:** Any date between today’s date and 36 months in the past.

          The date before which the transaction was created (based on the transaction’s `CreationDate` parameter).

          **Caution:** The time range between the `BeforeDate` and the `AfterDate` cannot exceed 6 months.
        </ResponseField>

        <ResponseField name="AfterDate" type="Unix timestamp">
          The date after which the transaction was created (based on the transaction’s `CreationDate` parameter).\
          Caution: The time range between the `BeforeDate` and the `AfterDate` cannot exceed 6 months.
        </ResponseField>

        <ResponseField name="Type" type="array">
          The transaction types to be taken into account.
        </ResponseField>

        <ResponseField name="ResultCode" type="array">
          The transaction result codes to be taken into account.
        </ResponseField>

        <ResponseField name="Status" type="array">
          The transaction statuses to be taken into account.
        </ResponseField>

        <ResponseField name="Nature" type="array">
          **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT`

          The transaction natures to be taken into account.

          * `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow.
          * `REPUDIATION` – Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback).
          * `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay).
          * `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute.
        </ResponseField>

        <ResponseField name="WalletId" type="string">
          The unique identifier of the wallet that is to be taken into account.
        </ResponseField>

        <ResponseField name="AuthorId" type="string">
          The unique identifier of the user at the source of the transaction.
        </ResponseField>

        <ResponseField name="MinDebitedFundsAmount" type="integer">
          The debited funds amount above which the transactions are taken into account.
        </ResponseField>

        <ResponseField name="MinDebitedFundsCurrency" 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 `MinDebitedFundsAmount` value.
        </ResponseField>

        <ResponseField name="MaxDebitedFundsAmount" type="integer">
          The debited funds amount below which the transactions are taken into account.
        </ResponseField>

        <ResponseField name="MaxDebitedFundsCurrency" 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 `MaxDebitedFundsAmount` value.
        </ResponseField>

        <ResponseField name="MinFeesAmount" type="integer">
          The fees amount below which the transactions are taken into account.
        </ResponseField>

        <ResponseField name="MinFeesCurrency" 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 `MinFeesAmount` value.
        </ResponseField>

        <ResponseField name="MaxFeesAmount" type="integer">
          The fees amount above which the transactions are taken into account.
        </ResponseField>

        <ResponseField name="MaxFeesCurrency" 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 `MaxFeesAmount` value.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Columns" type="array">
      **Returned values:** The `Columns` listed in the <a href="/reports">Reports</a> article, which differ according to the report type.

      The information to be included in the report.
    </ResponseField>

    <ResponseField name="ResultCode" type="array">
      The transaction result codes to be taken into account.
    </ResponseField>

    <ResponseField name="ResultMessage" type="string">
      The explanation of the result code.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
      "Id": "report_m_01JFA0JQQJ1X6W6VT6042SASTC",
      "CreationDate": 1734429204,
      "Tag": "Created using Mangopay API Postman Collection",
      "ReportDate": 1734429204,
      "Status": "READY_FOR_DOWNLOAD",
      "DownloadFormat": "CSV",
      "DownloadURL": "https://downloads.sandbox.mangopay.com/85565d93430945388122986252982648.csv?Policy=eyJTdGF0ZW1lbnQiOiBbeyJSZXNvdXJjZSI6IioiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE3MzQ1MTU2MDR9fX1dfQ__&Signature=YvcEtwjbs2hR4mOb2UuGICdh082lFrCjS1XtwJ~Zem7~vDc8bPPo-2kBA-Neb0Hs7V9gApR5mJ9B6RPOgDzKKdBEVD4iBS066eNYIymuW2fY5IXjfuzFgv0id5yi2ynFcmX02sgSgd9WGChYpUTBH36R-McNbAPG3viOu8FZ5LM9IWR44qnMwrM-8IWXPBpg9yh7uZy6ehDjJpoi9tswNnzt445vpORRMF3clMl~tRel59EcsMV73c-~B1Qvd9inBa6msh6eww~kkcP5FE~MCr4oQ-DsX0lZPAXLoSOJNbhOotNqKgwlBrYwAT1gLV510kUlbJy~4bPDmmsgbSqETw__&Key-Pair-Id=K21K4XKUJZ74AO",
      "CallbackURL": null,
      "ReportType": "TRANSACTIONS",
      "Sort": "CreationDate:ASC",
      "Preview": false,
      "Filters": {
          "BeforeDate": 1658317644,
          "AfterDate": 1655725644,
          "Type": [],
          "ResultCode": [],
          "Status": [],
          "Nature": [],
          "WalletId": null,
          "AuthorId": null,
          "MinDebitedFundsAmount": null,
          "MinDebitedFundsCurrency": null,
          "MaxDebitedFundsAmount": null,
          "MaxDebitedFundsCurrency": null,
          "MinFeesAmount": null,
          "MinFeesCurrency": null,
          "MaxFeesAmount": null,
          "MaxFeesCurrency": null
      },
      "Columns": [
          "Id",
          "Tag",
          "CreationDate",
          "ExecutionDate",
          "AuthorId",
          "CreditedUserId",
          "DebitedFundsAmount",
          "DebitedFundsCurrency",
          "CreditedFundsAmount",
          "CreditedFundsCurrency",
          "FeesAmount",
          "FeesCurrency",
          "Status",
          "ResultCode",
          "ResultMessage",
          "Type",
          "Nature",
          "CreditedWalletId",
          "DebitedWalletId"
      ],
      "ResultCode": "000000",
      "ResultMessage": "Success"
  }
  ```
</ResponseExample>

<RequestExample>
  ```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 {
      $reportId = '192900155';

      $response = $api->Reports->Get($reportId);

      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 myReport = {
    Id: '192900155',
  }

  const viewReport = async (reportId) => {
    return await mangopay.Reports.get(reportId)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  viewReport(myReport.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 viewReport(reportId)
      begin
          response = MangoPay::Report.fetch(reportId)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to fetch Report: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myReport = {
      Id: '195000676'
  }

  viewReport(myReport[:Id])  
  ```

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

  report_id = 'report_m_01HR4RQ4KX66A4K52AJC3C1Z2R'

  try:
      view_report = Report.get(report_id)
      pprint(view_report._data)
  except Report.DoesNotExist:
      print('Report {} does not exist.'.format(report_id))  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  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 reportId = "report_m_01J55Z0TCA6998ZRGR2Y9AKDTZ";

          var viewReport = await api.Reports.GetAsync(reportId);

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