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

# Submit a Dispute Document

### Path parameters

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

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

### Body parameters

<ParamField body="Status" type="string" required>
  **Allowed values:** `VALIDATION_ASKED`

  The status of the dispute document.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200">
    <ResponseField name="DisputeId" type="string">
      The unique identifier of the dispute.
    </ResponseField>

    <ResponseField name="Type" type="string">
      **Returned values:** `DELIVERY_PROOF`, `INVOICE`, `REFUND_PROOF`, `USER_CORRESPONDANCE`, `USER_ACCEPTANCE_PROOF`, `PRODUCT_REPLACEMENT_PROOF`, `OTHER`

      The type of the dispute document.
    </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="ProcessedDate" type="Unix timestamp">
      The date and time at which the document was processed by Mangopay’s team.
    </ResponseField>

    <ResponseField name="Status" type="string">
      **Returned values:** `CREATED`, `VALIDATION_ASKED`, `VALIDATED`, `REFUSED`, `OUT_OF_DATE`

      The status of the dispute document.
    </ResponseField>

    <ResponseField name="RefusedReasonType" type="string">
      **Returned values:** DOCUMENT\_DO\_NOT\_MATCH\_USER\_DATA, DOCUMENT\_FALSIFIED, DOCUMENT\_HAS\_EXPIRED, DOCUMENT\_INCOMPLETE, DOCUMENT\_MISSING, DOCUMENT\_NOT\_ACCEPTED, DOCUMENT\_UNREADABLE, SPECIFIC\_CASE, UNDERAGE\_PERSON

      The reason for the dispute document refusal. See the <inline-code>RefusedReasonMessage</inline-code> for more information.
    </ResponseField>

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

      **Default value:** null

      Additional information about why the dispute document was refused, provided by Mangopay’s team.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  {
      "DisputeId": "159102965",
      "Type": "DELIVERY_PROOF",
      "Id": "159188418",
      "Tag": null,
      "CreationDate": 1672655973,
      "ProcessedDate": null,
      "Status": "VALIDATION_ASKED",
      "RefusedReasonType": null,
      "RefusedReasonMessage": null
  }  
  ```
</ResponseExample>

<RequestExample>
  ```json REST   theme={null}
  {
      "Status": "VALIDATION_ASKED"
  }  
  ```

  ```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 = '199385842';
      $disputeDocumentId = '199387308';

      $disputeDocument = $api->DisputeDocuments->Get($disputeDocumentId);
      $disputeDocument->Status = \MangoPay\DisputeDocumentStatus::ValidationAsked;

      $response = $api->Disputes->UpdateDisputeDocument($disputeId, $disputeDocument);

      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: '192746554',
  }

  let myDisputeDocument = {
    Id: '192747541',
    Status: 'VALIDATION_ASKED',
  }

  const submitDisputeDocument = async (disputeId, disputeDocument) => {
    return await mangopay.Disputes.updateDisputeDocument(disputeId, disputeDocument)
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  submitDisputeDocument(myDispute.Id, myDisputeDocument)  
  ```

  ```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 submitDisputeDocument(disputeId, disputeDocumentId, disputeDocumentObject)
      begin
          response = MangoPay::Dispute.update_document(disputeId, disputeDocumentId, disputeDocumentObject)
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to submit Document: #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end

  myDispute = {
      Id:'194413022'
  }

  myDocument = {
      Id:'194643965',
      Status:'VALIDATION_ASKED'
  }

  submitDisputeDocument(myDispute[:Id], myDocument[:Id], myDocument)  
  ```

  ```java Java  theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.core.enumerations.DisputeDocumentStatus;
  import com.mangopay.entities.DisputeDocument;

  public class SubmitDisputeDoc {
        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_01J354MZ17XZA4DMAQS1766VXM";
          var disputeDocId = "dispdoc_m_01J35502PVF13JEV84D6PET414";
          var disputeDoc = mangopay.getDisputeApi().getDocument(disputeDocId);
          disputeDoc.setStatus(DisputeDocumentStatus.VALIDATION_ASKED);
          
          DisputeDocument submitDispute = mangopay.getDisputeApi().submitDisputeDocument(disputeDoc, disputeId);

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

          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)

  dispute_doc = DisputeDocument(
      id = 'dispdoc_m_01HQTAHCSMH0Q6MRHYWZ0B39M5',
      dispute = dispute,
      status = 'VALIDATION_ASKED'
  )

  submit_dispute = dispute_doc.submit()

  pprint(submit_dispute)  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Core.Enumerations;
  using MangoPay.SDK.Entities.PUT;
  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_01J41GEVRQN3W1C4YRK7NC04QT";
          var disputeDocId = "dispdoc_m_01J41GSW7D919YXBY2ZEK91ACD";

          DisputeDocumentPutDTO disputeDoc = new DisputeDocumentPutDTO
          {
              Status = DisputeDocumentStatus.VALIDATION_ASKED
          };	

          var submitDisputeDoc = await api.Disputes.SubmitDisputeDocumentAsync(disputeDoc, disputeId, disputeDocId);

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