> ## 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 Disputes for a Wallet

### Path parameters

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

### Query parameters

<ParamField query="BeforeDate" type="Unix timestamp">
  The date before which the object was created (based on the object's `CreationDate` parameter). You can filter on a specific time range by using both the `AfterDate` and `BeforeDate` query parameters.
</ParamField>

<ParamField query="AfterDate" type="Unix timestamp">
  The date after which the object was created (based on the object's `CreationDate` parameter). You can filter on a specific time range by using both the `AfterDate` and `BeforeDate` query parameters.
</ParamField>

<ParamField query="Status" type="string">
  **Allowed values:** `CREATED`, `PENDING_CLIENT_ACTION`, `SUBMITTED`, `PENDING_BANK_ACTION`, `CLOSED`, `REOPENED_PENDING_CLIENT_ACTION`

  The status of the Dispute. You can filter on multiple values by separating them with a comma.
</ParamField>

<ParamField query="DisputeType" type="string">
  **Allowed values:** `CONTESTABLE`, `NOT_CONTESTABLE`, `RETRIEVAL`

  The type of the Dispute. You can filter on multiple values by separating them with a comma.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="Array (Disputes)" type="array">
      The list of disputes automatically created by Mangopay.

      <Expandable title="properties">
        <ResponseField name="Object (Dispute)" type="object">
          The dispute automatically created by Mangopay.

          <Expandable title="properties">
            <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`, `REPUDIATION`, `REFUND`, `SETTLEMENT`

              The nature of the initial transaction being refunded, providing more information about the context in which the transaction occurred:

              * 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 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 the credit from a repudiation following a lost dispute.
            </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>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  [
      {
          "InitialTransactionId": "158596153",
          "InitialTransactionType": "PAYIN",
          "InitialTransactionNature": "REGULAR",
          "DisputeType": "CONTESTABLE",
          "ContestDeadlineDate": 1673049599,
          "DisputedFunds": {
              "Currency": "EUR",
              "Amount": 1200
          },
          "ContestedFunds": {
              "Currency": "EUR",
              "Amount": 1200
          },
          "Status": "PENDING_CLIENT_ACTION",
          "StatusMessage": null,
          "DisputeReason": {
              "DisputeReasonMessage": "This is a test dispute",
              "DisputeReasonType": "UNKNOWN"
          },
          "ResultCode": "",
          "ResultMessage": null,
          "Id": "159102965",
          "Tag": null,
          "CreationDate": 1672411848,
          "ClosedDate": 1675260940,
          "RepudiationId": "159102966"
      }
  ]  

  ```
</ResponseExample>

<RequestExample>
  ```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: '148968396',
  }

  const listWalletDisputes = async (walletId) => {
    return await mangopay.Disputes.getDisputesForWallet(walletId)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

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

  myWallet = {
      Id: '194579906'
  }

  listWalletDisputes(myWallet[:Id])  
  ```

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

  public class ListWalletDisputes {
      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 walletId = "wlt_m_01HT2J9Q2M6GMFW4Z7GYBAFJ4T";

          List<Dispute> disputes = mangopay.getDisputeApi().getDisputesForWallet(walletId, null, null, null);

          for (Dispute dispute : disputes) {
              Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
              String prettyJson = prettyPrint.toJson(dispute);

              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 Wallet

  user_wallet = Wallet.get('wlt_m_01HQT7AS0FJPGYXDXJ0R151NBV')

  disputes = user_wallet.disputes.all()

  for dispute in disputes:
      print()
      pprint(dispute._vars)  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Entities;
  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 walletId = "wlt_m_01J30991BXBB7VF28PBS82EWD3";
          
          var disputes = await api.Disputes.GetDisputesForWalletAsync(walletId, new Pagination(1, 100), null);

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