Skip to main content
What is it? The dispute evidence upload endpoint allows partners to upload supporting documentation when challenging a dispute. These uploaded files generate attachment IDs that can then be referenced when responding to a dispute.
When to Use
  • You need to provide documentation to support your dispute challenge.
  • You have receipts, delivery confirmations, or correspondence to prove a transaction was valid.
  • You want to increase your chances of winning a dispute case.
ScenarioTo challenge Ben’s dispute regarding a mechanical keyboard purchased from CoolTechGear.com, the partner must provide evidence that supports their case. This is done by attaching receipts, proof of delivery, correspondence with Ben, or other relevant documentation to prove the transaction was valid.

Implementation rules

  1. Files must be uploaded before responding to a dispute with a challenge
  2. File format and size requirements vary by payment brand (see table below)
  3. The returned attachmentId must be included in the respondToDispute mutation when challenging a dispute
  4. At least one attachment is required when challenging a dispute
  5. Multiple files can be uploaded separately, and will be referenced together in a single dispute challenge

File requirements by payment brand

Make sure to check the dispute’s payment brand before uploading evidence, as each brand has different file type and size requirements.
Payment brandMax file sizeSupported file types
Visa10MBPDF, JPG, JPEG, TIF, TIFF
Mastercard15MBPDF, JPG, JPEG, TIF, TIFF
Discover15MBJPG, JPEG, PNG, BMP
American Express1MBJPG, JPEG, TIF, TIFF, GIF

Upload process

The upload process uses a standard multipart form data request to a REST endpoint:
POST {baseUrl}/files/disputes/{disputeId}/attachments
Where:
  • {baseUrl} is your Tesouro API base URL
  • {disputeId} is the ID of the dispute you’re uploading evidence for
The request should include the file in the multipart form data with the field name file.

Error handling

The endpoint will respond with a 400 status code if the file size exceeds the limit or if the file type is not supported for the dispute’s payment brand. Always check the payment brand requirements before uploading.

Using attachment IDs

After successfully uploading evidence, use the returned attachmentId when challenging a dispute with the respondToDispute mutation (see Respond to a dispute).
curl '{baseUrl}/files/disputes/{disputeId}/attachments' \
  -X POST \
  -H 'Content-Type: multipart/form-data; boundary=----boundary' \
  --data-binary $'------boundary\r\nContent-Disposition: form-data; name="file"; filename="receipt.jpg"\r\nContent-Type: image/jpeg\r\n\r\n[FILE_BINARY_DATA]\r\n------boundary--\r\n'
{
  "attachment": {
    "id": "981e535f-8a77-4854-9e2e-4c7d136ef17c",
    "filename": "receipt.jpg",
    "contentType": "image/jpeg",
    "createdAt": "2025-03-07T20:48:32Z"
  }
}