Sources verified against the orchestrator: disputes.controller.ts, resolution.service.ts, resolution/dto/assign-dispute.dto.ts, resolution/dto/resolve-dispute.dto.ts, and packages/shared/src/enums/dispute-status.enum.ts.
Reference for the Disputes endpoints — list, retrieve, assign, and resolve disputes with FULL_RELEASE, FULL_REFUND, or SPLIT decisions.
The Disputes group lets you list, inspect, assign, and resolve disputes raised on escrowed orders. All routes are served by the Disputes controller (apps/api/src/modules/disputes/disputes.controller.ts), which delegates to the resolution service (apps/api/src/modules/resolution/resolution.service.ts).
Sources verified against the orchestrator: disputes.controller.ts, resolution.service.ts, resolution/dto/assign-dispute.dto.ts, resolution/dto/resolve-dispute.dto.ts, and packages/shared/src/enums/dispute-status.enum.ts.
Every dispute lifecycle change is persisted to the audit trail (DISPUTE_ASSIGNED, DISPUTE_RESOLVED entries) and published on the event bus (dispute.under_review, dispute.resolved), so you can follow progress through Audit Logs and Webhooks.
Disputes can only move forward — OPEN → UNDER_REVIEW → RESOLVED — and RESOLVED is terminal. The transitions are enforced by DisputeStateMachine.assertTransition (see packages/shared/src/enums/dispute-status.enum.ts).
The Dispute state machine puts this lifecycle next to the other domains and lists the INVALID_STATE guard behind each transition.
All endpoints require an API key with read scope for GETs and write scope for the assign and resolve POSTs. Send it as a Bearer token:
The support-facing Audit Logs endpoint requires the dedicated support scope instead.
Schema source: DisputeWithRelations in apps/api/src/modules/resolution/resolution.service.ts.
GET /api/v1/disputes
Returns all disputes for your marketplace, newest first logic handled by the database ordering.
Query parameters
Response — 200 OK
The disputes controller returns the { "success": true, "data": ... } envelope directly (see disputes.controller.ts), so responses are not double-wrapped by the global response interceptor.
curl
TypeScript SDK
GET /api/v1/disputes/{id}
Returns a single dispute including the related order (with escrow, dispute, and milestones relations).
Path parameters
Response — 200 OK
curl
TypeScript SDK
POST /api/v1/disputes/{id}/assign
Moves an OPEN dispute to UNDER_REVIEW and records who is reviewing it. Requires the dispute to be in OPEN state (resolution.service.ts → assignDispute); writes a DISPUTE_ASSIGNED audit entry and emits dispute.under_review.
Path parameters
Request body — AssignDisputeDto (apps/api/src/modules/resolution/dto/assign-dispute.dto.ts)
Response — 200 OK (controller declares @HttpCode(HttpStatus.OK))
Errors
curl
TypeScript SDK
POST /api/v1/disputes/{id}/resolve
Closes a dispute that is UNDER_REVIEW by executing a financial decision and setting the dispute to RESOLVED with the chosen resolutionDecision and decisionNote. Requires UNDER_REVIEW state; writes a DISPUTE_RESOLVED audit entry and emits dispute.resolved.
Path parameters
Request body — ResolveDisputeDto (apps/api/src/modules/resolution/dto/resolve-dispute.dto.ts)
For SPLIT, both releaseAmount and refundAmount are required and their sum must exactly equal the order amount, or the API returns 422 INVALID_AMOUNT (InvalidDisputeResolutionException extends UnprocessableEntityException).
Decisions
Response — 200 OK
Errors
curl
TypeScript SDK — one example per decision (packages/sdk/src/resources/disputes.ts):
POST /disputes/{id}/assign and POST /disputes/{id}/resolve are covered by the global idempotency machinery (apps/api/src/modules/idempotency/idempotency.module.ts registers IdempotencyGuard + IdempotencyInterceptor):
Idempotency-Key header. Non-UUID keys are rejected with 400 VALIDATION_ERROR.Idempotency-Replay: true header.409 IDEMPOTENCY_KEY_REUSED.409 IDEMPOTENCY_KEY_IN_PROGRESS.idempotency.service.ts, ttlHours = 24).GET endpoints are naturally idempotent and do not need the header.
Generate a fresh key per logical operation and reuse it only for retries of that operation — e.g. crypto.randomUUID() in Node.
Errors use the shared envelope (GlobalExceptionFilter):
HTTP status comes from the exception class, not the shared ERROR_HTTP_STATUS map — that is why INVALID_STATE surfaces as 400 and INVALID_AMOUNT as 422 here.
INVALID_STATE guardsDISPUTE_ASSIGNED and DISPUTE_RESOLVED entriesdispute.under_review and dispute.resolved events