# Dispute Period

| Previous state | State    | Next state(s)                |
| -------------- | -------- | ---------------------------- |
| COMMITTED      | REDEEMED | <p>COMPLETED<br>DISPUTED</p> |

#### Period actions

| Seller | Buyer                 | Dispute resolver |
| ------ | --------------------- | ---------------- |
| /      | Complete the exchange | /                |
|        | Raise a dispute       |                  |

#### Post-period actions

| Seller                | Buyer                 | Dispute resolver      |
| --------------------- | --------------------- | --------------------- |
| Complete the exchange | Complete the exchange | Complete the exchange |

***

### TypeScript SDK

{% tabs %}
{% tab title="Complete the exchange" %}
Ends the exchange, the seller gets the price and the seller's deposit.&#x20;

<pre class="language-typescript"><code class="lang-typescript"><strong>const exchangeId = "1534";
</strong>
await coreSDK.completeExchange(
    exchangeId
);
</code></pre>

Multiple exchanges can be completed in a single transaction.

<pre class="language-typescript"><code class="lang-typescript"><strong>const exchangeId1 = "1534";
</strong>const exchangeId2 = "2";
const exchangeId3 = "758";

await coreSDK.completeExchangeBatch(
    [exchangeId1, exchangeId2, exchangeId3] 
);
</code></pre>

{% endtab %}

{% tab title="Raise a disupte" %}
Moves the exchange into a disputed state and starts the resolution period.

```typescript
const exchangeId = "1534";

await buyerCoreSDK.raiseDispute(exchangeId);
```

{% endtab %}
{% endtabs %}

### Solidity

{% tabs %}
{% tab title="Complete the exchange" %}
Ends the exchange, the seller gets the price and the seller's deposit.&#x20;

```solidity
IBosonExchangeHandler bosonProtocol = IBosonExchangeHandler(_bosonProtocolAddress);
uint256 exchangeId = 1534;

bosonProtocol.completeExchange(exchangeId);
```

Multiple exchanges can be completed in a single transaction.

```solidity
IBosonExchangeHandler bosonProtocol = IBosonExchangeHandler(_bosonProtocolAddress);
uint256[] memory exchangeIds = new uint256[](3);
exchangeIds[0] = 1534;
exchangeIds[1] = 2;
exchangeIds[3] = 758;

bosonProtocol.completeExchangeBatch(exchangeIds);
```

{% endtab %}

{% tab title="Raise a disupte" %}
Moves the exchange into a disputed state and starts the resolution period.

```solidity
IBosonDisputeHandler bosonProtocol = IBosonDisputeHandler(_bosonProtocolAddress);
uint256 exchangeId = 1534;

bosonProtocol.raiseDispute(exchangeId);
```

{% endtab %}
{% endtabs %}


---

# 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.bosonprotocol.io/using-the-protocol/dacp-tools/exchange-mechanism/dispute-period.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.
