> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tesouro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload evidence

> Upload supporting documentation such as receipts and delivery confirmations via the REST endpoint to challenge a dispute.

**What is it?** The dispute evidence upload endpoint accepts supporting documentation when challenging a dispute. Each upload returns an attachment ID you reference in your dispute response.

<Tip type="when to use">
  **When to Use**

  <ul>
    <li>You need to provide documentation to support your dispute challenge.</li>
    <li>You have receipts, delivery confirmations, or correspondence to prove a transaction was valid.</li>
    <li>You want to increase your chances of winning a dispute case.</li>
  </ul>
</Tip>

<Callout icon="clapperboard-play" color="#6938EF" type="scenario">
  **Scenario**

  When a customer disputes a purchase at Maple Street Coffee, Clearpath Payments challenges the dispute by attaching evidence — receipts, proof of delivery, or correspondence with the customer.
</Callout>

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

<Note>
  Make sure to check the dispute's payment brand before uploading evidence, as each brand has
  different file type and size requirements.
</Note>

| Payment brand    | Max file size | Supported file types      |
| ---------------- | ------------- | ------------------------- |
| Visa             | 10MB          | PDF, JPG, JPEG, TIF, TIFF |
| Mastercard       | 15MB          | PDF, JPG, JPEG, TIF, TIFF |
| Discover         | 15MB          | JPG, JPEG, PNG, BMP       |
| American Express | 1MB           | JPG, JPEG, TIF, TIFF, GIF |

### Upload process

The upload process uses a standard multipart form data request to a REST endpoint:

```http lines theme={null}
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 responds with a 400 status code if the file size exceeds the limit or if the file type isn't supported for the dispute's payment brand. 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](/acquiring/disputes/respond)).

<RequestExample>
  ```bash cURL Example lines theme={null}
  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'
  ```
</RequestExample>

<ResponseExample>
  ```json title="Response" lines theme={null}
  {
    "attachment": {
      "id": "981e535f-8a77-4854-9e2e-4c7d136ef17c",
      "filename": "receipt.jpg",
      "contentType": "image/jpeg",
      "createdAt": "2025-03-07T20:48:32Z"
    }
  }
  ```
</ResponseExample>
