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

# Respond to a dispute

> Accept or challenge a dispute using the respondToDispute GraphQL mutation, with options to provide supporting evidence.

**What is it?** The `respondToDispute` mutation accepts or challenges a dispute assigned to your organization. You have two options:

1. **Accept the dispute** - Acknowledge the dispute's validity and accept the chargeback
2. **Challenge the dispute** - Contest the dispute by providing supporting evidence

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

  <ul>
    <li>A customer has disputed a transaction with their card issuer.</li>
    <li>You need to accept liability or challenge a dispute with evidence.</li>
    <li>You want to respond to a chargeback within the required timeframe.</li>
  </ul>
</Tip>

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

  A customer disputes a transaction at Maple Street Coffee, one of Clearpath Payments' acceptors. Clearpath Payments decides whether to accept the dispute or challenge it with evidence that the transaction was valid.
</Callout>

### Implementation rules

1. The dispute must be assigned to your organization before you can respond
2. When accepting a dispute, only the `disputeId` is required
3. When challenging a dispute, both the `disputeId` and at least one `attachmentId` are required
4. Attachment IDs are obtained by first uploading [evidence files](/acquiring/disputes/upload-evidence)
5. Responses must be submitted before the dispute's expiration date

The same mutation is used for both accepting and challenging a dispute, with different input parameters:

```graphql lines expandable theme={null}
mutation RespondToDispute($input: RespondToDisputeInput!) {
  respondToDispute(input: $input) {
    dispute {
      id
    }
    errors {
      ... on AttachmentsRequiredError {
        message
      }
      ... on ExpirationDateExceededError {
        expirationDate
        message
      }
      ... on InvalidAssignmentError {
        currentAssignment
        message
        validAssignments
      }
    }
  }
}
```

<Columns cols={2}>
  <div>
    ### Accept a dispute

    Use the `accept` input parameter with the dispute ID to accept the chargeback.
  </div>

  <div>
    <CodeGroup>
      ```json Variables lines theme={null}
      {
        "input": {
          "accept": {
            "disputeId": "d8f8a027-04ce-437c-ad4e-7d41f667c23c"
          }
        }
      }
      ```

      ```json Response lines theme={null}
      {
        "data": {
          "respondToDispute": {
            "dispute": {
              "id": "d8f8a027-04ce-437c-ad4e-7d41f667c23c"
            },
            "errors": null
          }
        }
      }
      ```
    </CodeGroup>
  </div>

  <div>
    ### Challenge a dispute

    Use the `represent` input parameter with the dispute ID and at least one attachment ID when you want to contest the dispute by [providing evidence](/acquiring/disputes/upload-evidence).
  </div>

  <div>
    <CodeGroup>
      ```json Variables lines theme={null}
      {
        "input": {
          "represent": {
            "disputeId": "daf59e49-5646-4fc2-ab71-fb32cb134c54",
            "attachmentIds": ["981e535f-8a77-4854-9e2e-4c7d136ef17c"]
          }
        }
      }
      ```

      ```json Response lines theme={null}
      {
        "data": {
          "respondToDispute": {
            "dispute": {
              "id": "daf59e49-5646-4fc2-ab71-fb32cb134c54"
            },
            "errors": null
          }
        }
      }
      ```
    </CodeGroup>
  </div>
</Columns>
