---
title: "Close a dispute"
method: POST
path: "/v1/disputes/{disputeId}/close"
tags: ["Exception"]
---

# Close a dispute

`POST /v1/disputes/{disputeId}/close`

## Request

- Base URL: `https://identity.sandbox.lerian.net`
- URL: `https://identity.sandbox.lerian.net/v1/disputes/{disputeId}/close`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/lerian/apis/identity-plugin/docs/v1/disputes/:disputeId/close/post.ts> (a function with typed inputs; its response is checked against the schema)

Use this endpoint to close a dispute with a resolution. The dispute can be marked as won or lost based on the outcome.

## Path parameters

- `disputeId` string, required

## Headers

- `X-Request-Id` string
- `X-Idempotency-Key` string

## Request body

- CloseDisputeRequest: Close dispute request payload
  - `resolution` string, required: Resolution description
  - `won` boolean: Whether the dispute was won

## Response `200`

Indicates that the request was successful and the response contains the expected data.

The response includes the `X-Idempotency-Replayed` header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See [Retries and idempotency](/en/reference/retries-idempotency) for more details.

- DisputeResponse: Dispute details
  - `category` 'BANK_FEE_ERROR' | 'UNRECOGNIZED_CHARGE' | 'DUPLICATE_TRANSACTION' | 'OTHER': Category of the dispute
  - `createdAt` string: Creation timestamp in RFC3339 format
  - `description` string: Description of the dispute
  - `evidence` EvidenceResponse[]: Evidence submitted for this dispute
    - `comment` string: Comment describing the evidence
    - `disputeId` string: Dispute ID this evidence belongs to
    - `fileUrl` string: URL to evidence file
    - `id` string: Unique identifier for the evidence
    - `submittedAt` string: When the evidence was submitted in RFC3339 format
    - `submittedBy` string: User who submitted the evidence
  - `exceptionId` string: Exception ID this dispute is for
  - `id` string: Unique identifier for the dispute
  - `openedBy` string: User who opened the dispute
  - `reopenReason` string: Reason for reopening if reopened
  - `resolution` string: Resolution description when closed
  - `state` 'DRAFT' | 'OPEN' | 'PENDING_EVIDENCE' | 'WON' | 'LOST': Current state
  - `updatedAt` string: Last update timestamp in RFC3339 format

## Other responses

- `400`: The request contains invalid parameters or payload.
- `401`: The request lacks valid authentication credentials.
- `403`: You do not have permission to access this resource.
- `404`: The requested resource was not found.
- `422`: The request was well-formed but contains semantic errors.
- `500`: An unexpected error occurred on the server.

---

[API](https://skmtc.dev/lerian/apis/identity-plugin.md) - [All operations](https://skmtc.dev/lerian/apis/identity-plugin/llms.txt) - [OpenAPI document](https://skmtc.dev/lerian/apis/identity-plugin/revisions/25daba385532?raw)
