availability

Managing disputes via the API is only available to merchants who can access disputes in the Braintree Control Panel.

You can submit an evidence file for a dispute through this method. You can only submit evidence for disputes that have a status of "open".

PHP
Copy
Copied
$result = Braintree\Dispute::addFileEvidence(
  "a_dispute_id",
  $document_result->documentUpload->id
);

If the evidence is successfully added to the dispute, the result will be successful and will include the evidence object. Otherwise, check for validation errors.

PHP
Copy
Copied
if ($result->success) {
  # evidence file added successfully
  $evidence = $result->evidence;
} else {
  echo $result->errors;
}

If the dispute can't be found, you'll receive a Braintree_Exception_NotFound exception.

important

Once you have finished uploading evidence, you must finalize the dispute using Braintree_Dispute::finalize() before the Reply By date indicated in the dispute details.

Arguments
disputeId required, string

The unique dispute identifier.

documentId required, string

The unique identifier for a Braintree_DocumentUpload object. The document must have a kind of EVIDENCE_DOCUMENT.

Examples

PHP
Copy
Copied
$document_result = Braintree\DocumentUpload::create([
  'kind' => Braintree\DocumentUpload::EVIDENCE_DOCUMENT,
  'file' => fopen('local_file.pdf', 'rb')
]);

if($document_result->success) {
  $result = Braintree\Dispute::addFileEvidence(
    'a_dispute_id',
    $document_result->documentUpload->id
  );
}

Still have questions?

If you can’t find an answer, contact our Support team.