---
issue: 021
title: "POST /api/marketplace/offers/:id/withdraw HTTP route does not exist — seller withdraw is dead code"
severity: major
domain: Seller Offer
labels: [missing-feature, backend, frontend, major]
status: resolved
resolved: 2026-05-29
fix: "Added POST /offers/:id/withdraw route in marketplace/routes.ts. Calls sellerOfferService.withdrawOffer with ownership check (seller or admin only)."
status: open
created: 2026-05-29
source: Doc vs Code Audit 2026-05-29
---

# 🟠 POST /api/marketplace/offers/:id/withdraw HTTP route does not exist — seller withdraw is dead code

**Severity:** major
**Domain:** Seller Offer
**Labels:** missing-feature, backend, frontend, major

## Description

SellerOfferService.withdrawOffer() method exists (lines 427-443) but no HTTP route calls it. The only way to withdraw is via PUT /offers/:id/status with {status:'withdrawn'} which applies no pending-only guard. No frontend withdraw button or action exists.

## Current Behavior

Sellers have no UI path to withdraw an offer. withdrawOffer() service method is unreachable via HTTP. The route-level withdrawal via PUT /status has no transition guard.

## Expected Behavior

A dedicated withdraw endpoint should be registered, calling withdrawOffer() which enforces the pending-only guard. Or the PUT /offers/:id/status path should enforce status transition guards.

## Affected Files

- `backend/src/routes/routes.ts`
- `frontend/src/actions/marketplace.ts`

## References

- [Doc vs Code Audit Report](../09%20-%20Audits/Doc%20vs%20Code%20Audit%20Report%20-%202026-05-29.md)
