# Resolve Dispute

### **Headers**

<table><thead><tr><th width="366">Name</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>x-api-key</td><td><code>&#x3C;token></code></td></tr></tbody></table>

### Open API

## POST /escrow/single-release/resolve-dispute

>

```json
{"openapi":"3.0.0","info":{"title":"Trustless Work API","version":"1.0"},"security":[{}],"paths":{"/escrow/single-release/resolve-dispute":{"post":{"operationId":"SingleReleaseController_resolveDispute","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveDispute"}}}},"responses":{"201":{"description":"This endpoint returns an unsigned transaction in XDR format. This XDR is then used to sign the transaction using the “/helper/send-transaction” endpoint.","content":{"application/json":{}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized access"},"429":{"description":"Too Many Requests"},"500":{"description":"Possible errors:\n- Only the dispute resolver can execute this function\n- None of the amounts to be transferred should be less or equal than 0\n- Escrow not in dispute\n- Insufficient funds for resolution\n- The sum of distributions must equal the current escrow balance when resolving an escrow dispute\n- The total amount to be distributed cannot be equal to zero\n- Escrow not found\n- An unexpected error occurred","content":{"application/json":{}}}},"tags":["Single Release"]}}},"components":{"schemas":{"ResolveDispute":{"type":"object","properties":{"contractId":{"type":"string","description":"ID (address) that identifies the escrow contract"},"disputeResolver":{"type":"string","description":"Address of the user defined to resolve disputes in an escrow"},"distributions":{"description":"Array of distributions detailing address and amount to allocate when resolving the dispute. Amounts should sum the remaining escrow funds (post-fees).","type":"array","items":{"type":"array"}}},"required":["contractId","disputeResolver","distributions"]}}}}
```

<figure><img src="/files/pZZixvObnChek5GQRm4D" alt=""><figcaption></figcaption></figure>

### **What this Endpoint returns?**

This endpoint returns the transaction unsigned so that the transaction can be signed by means of a customer wallet.

### Use Example:

```typescript
import axios from "axios";

const http = axios.create({
  baseURL: "https://dev.api.trustlesswork.com",
  timeout: 10000,
  headers: {
    "Content-Type": "application/json",
    "x-api-key": your_api_key,
  },
});

export const useExample = async () => {
    // Get the signer address
    const { address } = await kit.getAddress();

    const response = await http.post(
      "/escrow/single-release/v2/resolve-dispute",
      {
        // body requested for the endpoint
      },
    ); 
    
    // Get the unsigned transaction hash
    const { unsignedTransaction } = response.data;

    // Sign the transaction by wallet
    const { signedTxXdr } = await signTransaction(unsignedTransaction, {
      address,
      networkPassphrase: WalletNetwork.TESTNET,
    });

    // Send the transaction to Stellar Network
    const tx = await http.post("/stellar/submit-transaction", {
      signedXdr: signedTxXdr,
    });

    const { data } = tx;

    return data;
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/deploy/resolving-disputes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
