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