# Disputes

Source: https://developers.bitgo.com/docs/oes-client-disputes

## Overview

If the terms of a settlement look incorrect, you can dispute the settlement before BitGo settles with the partner exchange. This enables you to contest the settlement before assets withdraw from your Go Account. Once triggered, the settlement stops and BitGo reviews the dispute.

Not all partner exchanges support settlement disputes. You can call the [List Partners](/reference/v1partnersgetroute) endpoint to see if a partner exchange supports disputes. Partners that support disputes will return the `clientDisputeWindowMinutes` field in the response.

You must dispute a settlement during the dispute window for a settlement to be suspended. Dispute windows vary depending on the partner exchange. The [List Partners](/reference/v1partnersgetroute) endpoint returns the dispute window length in the `clientDisputeWindowMinutes` field of the response. If you retract a dispute within the dispute window the settlement process will continue as normal.

## Prerequisites

* [Get Started](/docs/get-started-intro)
* [Connect to Partners](/docs/oes-client-connect)
* [Allocate Assets](/docs/oes-client-allocate)

## 1. Dispute a Settlement

>Endpoint: [Dispute a Settlement](/reference/createclientsettlementdispute)

```shell cURL
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export SETTLEMENT_ID="<YOUR_SETTLEMENT_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X POST \
  "https://app.bitgo-test.com/api/network/v1/enterprises/${ENTERPRISE_ID}/clients/settlements/${SETTLEMENT_ID}/disputes" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -d '{
    "connectionId": "string",
    "reason": "string",
    "expectedTransfers": {
      "property1": "string",
      "property2": "string"
    },
    "payload": "string",
    "signature": "string",
    "nonce": "string"
  }'
```

#### Step Result

```json JSON
{
  "dispute": {
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "connectionId": "string",
    "disputedSettlementId": "string",
    "userId": "string",
    "expectedTransfers": {
      "property1": "string",
      "property2": "string"
    },
    "retracted": true,
    "settledInSettlementId": "string",
    "reason": "string",
    "retractedBy": "string",
    "retractedAt": "2019-08-24T14:15:22Z",
    "disputeClosureId": "string",
    "retractedReason": "string"
  }
}
```

## 2. (Optional) Retract a Dispute

>Endpoint: [Update a Dispute](/reference/updateclientsettlementdispute)

```shell cURL
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export DISPUTE_ID="<YOUR_DISPUTE_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X PUT \
  "https://app.bitgo-test.com/api/network/v1/enterprises/${ENTERPRISE_ID}/clients/settlements/disputes/${DISPUTE_ID}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -d '{
    "connectionId": "string",
    "retracted": true,
    "reason": "string",
    "expectedTransfers": {
      "property1": "string",
      "property2": "string"
    },
    "payload": "string",
    "signature": "string",
    "nonce": "string"
  }'
```

#### Step Result

```json JSON
{
  "dispute": {
    "id": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "connectionId": "string",
    "disputedSettlementId": "string",
    "userId": "string",
    "expectedTransfers": {
      "property1": "string",
      "property2": "string"
    },
    "retracted": true,
    "settledInSettlementId": "string",
    "reason": "string",
    "retractedBy": "string",
    "retractedAt": "2019-08-24T14:15:22Z",
    "disputeClosureId": "string",
    "retractedReason": "string"
  }
}
```

## See Also

* [API Reference: Dispute a Settlement](/reference/createclientsettlementdispute)
* [API Reference: Update a Settlement Dispute](/reference/updateclientsettlementdispute)
* [API Reference: List Settlement Disputes for a Client](/reference/listclientsettlementdisputes)
