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

### Path parameters

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

### Responses

<AccordionGroup>
  <Accordion title="200" defaultOpen>
    <ResponseField name="InitialTransactionId" type="string">
      The unique identifier of the initial pay-in being disputed.
    </ResponseField>

    <ResponseField name="InitialTransactionType" type="string">
      **Returned values:** `PAYIN`

      The type of the initial transaction being disputed.
    </ResponseField>

    <ResponseField name="InitialTransactionNature" type="string">
      **Returned values:** `REGULAR`

      The nature of the initial transaction being disputed.
    </ResponseField>

    <ResponseField name="DisputeType" type="string">
      **Returned values:** `CONTESTABLE`, `NOT_CONTESTABLE`, `RETRIEVAL`

      The type of dispute:

      * `CONTESTABLE` – Dispute for which the chargeback can be contested by providing proof (i.e., Dispute Documents) justifying the original transaction.
      * `NOT_CONTESTABLE` – Dispute that is automatically closed after its creation, without any action possible for the platform.
      * `RETRIEVAL` – Dispute that is actually a chargeback warning issued by the bank. The platform is required to provide documents, but no funds will be taken from the Repudiation Wallet.
    </ResponseField>

    <ResponseField name="ContestDeadlineDate" type="Unix timestamp">
      The date and time until which the platform can contest the dispute (i.e., the `Status` is set to `SUBMITTED`). This date is defined by the issuing bank of the initial transaction and may usually vary between 7 to 18 days. Once the deadline passes, the dispute `Status` is automatically set to `CLOSED`.
    </ResponseField>

    <ResponseField name="DisputedFunds" type="string">
      Information about the disputed funds.\
      Note: This amount can be lower than the initial transaction amount.

      <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 funds.
        </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="ContestedFunds" type="object">
      Information about the contested funds, in other words, the amount that you wish to contest.\
      Note: This amount can be lower than the disputed funds amount.

      <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 funds.
        </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="Status" type="string">
      **Returned values:** `CREATED`, `PENDING_CLIENT_ACTION`, `SUBMITTED`, `PENDING_BANK_ACTION`, `REOPENED_PENDING_CLIENT_ACTION`, `CLOSED`

      The status of the dispute:

      * `CREATED` – The dispute is created.
      * `PENDING_CLIENT_ACTION` – The dispute was not closed automatically upon its creation, it now requires some actions from the platform (either submission after providing the relevant proofs or closing).
      * `SUBMITTED` – The dispute is submitted by the platform for the Mangopay team to review the documents.
      * `PENDING_BANK_ACTION` – Mangopay accepted the documents and passed them on to the bank for them to review the dispute contestation. They will either reject or accept the contestation, or require further documents.
      * `REOPENED_PENDING_CLIENT_ACTION` – Mangopay didn’t accept the documents and requires more information or documents before sending the documents to the bank.
      * `CLOSED` – The dispute is closed.
    </ResponseField>

    <ResponseField name="StatusMessage" type="string">
      Additional information about the dispute `Status` communicated by Mangopay teams.
    </ResponseField>

    <ResponseField name="DisputeReason" type="object">
      Information about the reasons for the dispute.

      <Expandable title="properties" defaultOpen>
        <ResponseField name="DisputeReasonType" type="string">
          The reason for the dispute.
        </ResponseField>

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

          Additional information about the reason for the dispute sent by Mangopay teams.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="ResultCode" type="string">
      **Returned values:** `LOST`, `WON`, `VOID`

      The result of the dispute for the platform, which can be:

      * `LOST` – The platform lost the dispute and must settle its debt to Mangopay with a Settlement Transfer.
      * `WON` – The platform won the dispute, the disputed funds will be credited back to the Repudiation Wallet.
      * `VOID` – The dispute has been canceled.
    </ResponseField>

    <ResponseField name="ResultMessage" type="string">
      The explanation of the result code.
    </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.
    </ResponseField>

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

    <ResponseField name="ClosedDate" type="Unix timestamp">
      The date and time the dispute was closed (i.e., its `Status` is set to `CLOSED`).\
      Note: This value will be `null` for any Dispute closed before February 16th, 2023.
    </ResponseField>

    <ResponseField name="RepudiationId" type="string">
      The unique identifier of the repudiation.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200   theme={null}
  {
      "InitialTransactionId": "156981683",
      "InitialTransactionType": "PAYIN",
      "InitialTransactionNature": "REGULAR",
      "DisputeType": "CONTESTABLE",
      "ContestDeadlineDate": 1670025599,
      "DisputedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "ContestedFunds": {
          "Currency": "EUR",
          "Amount": 10000
      },
      "Status": "PENDING_CLIENT_ACTION",
      "StatusMessage": null,
      "DisputeReason": {
          "DisputeReasonMessage": "This is a test dispute",
          "DisputeReasonType": "UNKNOWN"
      },
      "ResultCode": "",
      "ResultMessage": null,
      "Id": "156981783",
      "Tag": null,
      "CreationDate": 1669384460,
      "ClosedDate": null,
      "RepudiationId": "156981784"
  }  
  ```
</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 {
      $disputeId = '193572349';

      $response = $api->Disputes->Get($disputeId);

      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 myDispute = {
    Id: '159763014',
  }

  const viewDispute = async (disputeId) => {
    return await mangopay.Disputes.get(disputeId)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

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

  myDispute = {
      Id: '159763014'
  }

  viewDispute(myDispute[:Id])  
  ```

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

  public class ViewDispute {
      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 disputeId = "dispute_m_01HQT8ZRCWP0HBT8QGRFMBA97B";

          Dispute viewDispute = mangopay.getDisputeApi().get(disputeId);

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

          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 Dispute

  dispute_id = 'dispute_m_01HQT6F2162Q1791CZR5RM4WSD'

  try:
      view_dispute = Dispute.get(dispute_id)
      pprint(view_dispute._data)
  except Dispute.DoesNotExist:
      print('Dispute {} does not exist.'.format(view_dispute.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 disputeId = "dispute_m_01HQT8ZRCWP0HBT8QGRFMBA97B";

          var viewDispute = await api.Disputes.GetAsync(disputeId);

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