Skip to content

REST API Endpoints Reference Catalog ​

This living reference document is the exhaustive catalog of all HTTP REST API endpoints exposed by debelu-backend at https://api.debelu.com. Grounded directly in the 38 route modules in [debelu-backend/src/routes](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes), controller implementations, and Zod validator schemas, this catalog specifies request schemas, authorization scopes, rate limits, and response structures.


1. Global API Conventions & Protocol Standards ​

1.1 Base URL & Content Negotiation ​

  • Production Base URL: https://api.debelu.com
  • Default Content-Type: application/json; charset=utf-8
  • Webhook Payloads: application/json parsed as raw byte buffers (express.raw()) for cryptographic HMAC signature verification.
  • Media Uploads: image/jpeg, image/png, image/webp, image/gif up to 5 MB via POST /api/products/images.

1.2 Authentication & Authorization Headers ​

Except for explicitly marked public and webhook endpoints, all requests require an Authenticated Bearer Token:

http
Authorization: Bearer <supabase_jwt_access_token>

Privileged administrative actions require Multi-Factor Authenticator Assurance Level 2 (AAL2).

1.3 Request Tracing & Correlation ​

Every inbound request may provide a client-generated UUID v4 in X-Request-ID. If omitted, the perimeter middleware assigns a secure randomUUID(). The ID is echoed in the response:

http
X-Request-ID: 7b8971f4-3d02-45e6-8e56-11f879cf1d12

1.4 Rate Limiting Headers (IETF Draft-7) ​

http
RateLimit-Limit: 1000
RateLimit-Remaining: 994
RateLimit-Reset: 842

1.5 Idempotency Key Specification ​

All financial mutations (checkout payment intent creation, escrow releases, wallet refunds, and payout disbursements) require an Idempotency-Key header:

http
Idempotency-Key: 9a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d

1.6 RFC 7807 Problem Details Error Schema ​

json
{
  "type": "https://api.debelu.com/errors/validation_failed",
  "title": "Bad Request",
  "status": 400,
  "detail": "Your store name needs at least 3 characters",
  "instance": "/api/vendors/applications",
  "code": "VALIDATION_FAILED",
  "requestId": "7b8971f4-3d02-45e6-8e56-11f879cf1d12",
  "timestamp": "2026-10-05T10:15:30.124Z"
}

2. Products, Catalog & Discovery Endpoints ​

Mounted via [productRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/productRoutes.ts), [catalogRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/catalogRoutes.ts), [flashSaleRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/flashSaleRoutes.ts), [bannerRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/bannerRoutes.ts), and [vibeRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/vibeRoutes.ts).

MethodEndpointAuth LevelRate LimitCache TTLDescription / Key Request Params
GET/api/productsPublicGlobal300sPaginated product listing with campus, category, and price filters.
GET/api/products/searchPublic60 req/minNoneFull-text product and merchant search.
GET/api/products/trendingPublicGlobal60sAlgorithmic trending products based on 24h view and cart velocity.
GET/api/products/new-arrivalsPublicGlobal60sChronological feed of recently published campus listings.
GET/api/products/exclusivesPublicGlobal60sVerified exclusive student vendor listings.
GET/api/products/featuredPublicGlobal300sHand-curated promotional campus products.
GET/api/products/categoriesPublicGlobal3600sCategory hierarchy tree with active listing count aggregates.
GET/api/products/suggestionsPublicGlobal900sAutocomplete search suggestions for search inputs.
POST/api/products/imagesVendor / Staff60 req/15mNoneDirect multipart image upload to Cloudflare R2 (limit: 5mb).
POST/api/products/bulkPublicGlobalNoneBulk retrieval of product entities by array of UUIDs.
GET/api/products/vendor/paginatedVendor (Me)VendorNoneAuthenticated vendor's complete inventory with private status codes.
GET/api/products/vendor/:idOptionalGlobal60sPublic store inventory for a specific vendor profile ID.
GET/api/products/:idOptionalGlobalNoneDetailed product information, vendor reputation, and related items.
POST/api/products/:id/stats/:typePublic120 req/mNoneAtomic counter increment (view, cart_add, share).
POST/api/productsVendor / StaffVendorNoneCreates a new product listing (validateRequest(addProductSchema)).
PUT/api/products/:idVendor (Owner)VendorNoneUpdates product details, price, condition, or inventory count.
DELETE/api/products/:idVendor / StaffVendorNoneSoft-deletes product listing; revokes search indexing.
DELETE/api/products/bulk/deleteAdmin30 req/mNoneAdministrative batch deletion of violating listings.
GET/api/flash-sales/activePublicGlobal60sLists current active time-bounded campus flash discounts.
GET/api/bannersPublicGlobal300sCampus marketing hero banners and promotional cards.
GET/api/vibesPublicGlobal300sCurated campus aesthetic feeds (e.g., "Hostel Essentials", "Tech Bro").

3. Cart, Orders & Escrow Lifecycle Endpoints ​

Mounted via [cartRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/cartRoutes.ts) and [orderRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/orderRoutes.ts).

MethodEndpointAuth LevelRate LimitDescription & Request Invariants
GET/api/cartAuthenticatedGlobalFetches authenticated user's persistent server cart with stock validation.
POST/api/cartAuthenticated60 req/mSynchronizes client cart items; validates campus origin alignment.
DELETE/api/cartAuthenticatedGlobalClears active cart state upon successful checkout initiation.
POST/api/ordersAuthenticated30 req/mPlaces order; validates pricing invariants, creates escrow record (pending_payment).
GET/api/ordersAuthenticatedGlobalPaginated list of orders placed by authenticated buyer.
GET/api/orders/vendorVendorGlobalPaginated list of inbound customer orders requiring fulfillment.
GET/api/orders/vendor/countsVendorGlobalStatus summary counts (pending, processing, shipped, delivered).
GET/api/orders/:idBuyer / Vendor / StaffGlobalOrder detail view with shipping address and delivery status.
GET/api/orders/:id/eventsBuyer / Vendor / StaffGlobalChronological audit trail of order state transitions.
POST/api/orders/:id/acceptVendor30 req/mVendor acknowledges order; transitions state to processing.
POST/api/orders/:id/statusVendor30 req/mUpdates fulfillment progress (processing $\rightarrow$ shipped).
POST/api/orders/:id/verify-codeVendor10 req/mEscrow Release Point: Submits buyer's 6-digit delivery PIN (pin: /^\d{6}$/). Unlocks funds upon verification.
POST/api/orders/:id/cancelBuyer / Vendor15 req/mCancels unpaid order or initiates automated pre-fulfillment refund.
POST/api/orders/:id/confirmBuyer20 req/mBuyer manual receipt confirmation fallback.
GET/api/orders/adminAdmin (canManageOrders)60 req/mGlobal order audit table across all campuses with escrow balances.

4. Payments, Financial Ledger & Payout Endpoints ​

Mounted via [paymentRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/paymentRoutes.ts), [transactionRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/transactionRoutes.ts), [reviewedPayoutBatchRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/reviewedPayoutBatchRoutes.ts), and [payoutTransferReconciliationRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/payoutTransferReconciliationRoutes.ts).

MethodEndpointAuth LevelRate LimitInvariants & Schema Requirements
POST/api/payments/webhookWebhook (Public)NonePaystack Webhook: Evaluates x-paystack-signature via timing-safe HMAC SHA-512. Enqueues to BullMQ.
POST/api/payments/initializeAuthenticated15 req/mInitializes Paystack checkout transaction; returns authorization URL. Mandatory Idempotency-Key.
POST/api/payments/verifyAuthenticated30 req/mSynchronously queries Paystack to confirm charge success (reference: string).
GET/api/payments/banksAuthenticatedGlobalLists supported Nigerian commercial banks and fintech institutions with NIP codes.
POST/api/payments/bank/resolveAuthenticated10 req/mResolves 10-digit NUBAN account number against bank code; verifies account name.
POST/api/payments/virtual-accountAuthenticated5 req/mGenerates dedicated dynamic NUBAN bank transfer virtual account for checkout.
GET/api/transactionsAuthenticatedGlobalDouble-entry general ledger statements for authenticated member.
POST/api/payments/order/:orderId/process-refundAdmin (AAL2)10 req/mExecutes wallet/gateway refund for disputed orders with audit reason.
GET/api/payouts/batchesAdmin (canManageFinances)30 req/mLists staged vendor payout batches awaiting disbursement.
POST/api/payouts/batches/:id/approveAdmin (AAL2)5 req/mMaker-Checker: Second staff officer approves payout batch for transfer dispatch.
POST/api/payouts/reconcileAdmin (AAL2)5 req/mInitiates ledger reconciliation job comparing Paystack balance to escrow liabilities.

5. Users, Identity & Vendor Management Endpoints ​

Mounted via [userRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/userRoutes.ts) and [vendorRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/vendorRoutes.ts).

MethodEndpointAuth LevelRate LimitDescription / Payload Schema
GET/api/users/meAuthenticatedGlobalFetches member profile, campus affiliation, role, and verification badges.
PUT/api/users/meAuthenticated30 req/mUpdates name, phone number, campus, and avatar URL.
GET/api/users/me/addressesAuthenticatedGlobalLists saved campus delivery addresses (hostel, hall, room number).
POST/api/users/me/addressesAuthenticated20 req/mCreates a new delivery location (addAddressSchema).
PUT/api/users/me/addresses/:idAuthenticated20 req/mUpdates existing address coordinates or delivery instructions.
DELETE/api/users/me/addresses/:idAuthenticated20 req/mRemoves saved delivery address.
GET/api/users/favoritesAuthenticatedGlobalFetches bookmarked/favorited products.
POST/api/users/favorites/toggleAuthenticated60 req/mToggles product favorite state (productId: uuid).
POST/api/users/content-flagsAuthenticated20 req/hSubmits Trust & Safety report on listing, review, or member.
GET/api/users/me/account-statusRestricted / SuspendedGlobalAllows restricted accounts to inspect suspension reason and appeal status.
POST/api/vendors/applicationsAuthenticated5 req/hSubmits student vendor merchant application with private student ID path.
GET/api/vendors/applications/meAuthenticatedGlobalChecks active vendor onboarding verification status.
GET/api/vendors/profile/:idPublicGlobalPublic vendor profile, reputation rating, and business policies.
PUT/api/vendors/profile/:idVendor (Owner)20 req/mUpdates store description, policies, vacation mode, and NUBAN bank account.
GET/api/vendors/:id/analyticsVendor (Owner)30 req/mComprehensive sales revenue, visitor traffic, and order conversion metrics.
GET/api/vendors/slug/:slug/availablePublic60 req/mVerifies whether custom vendor store URL handle is available.

6. AI Assistant (Nduzi) & Communication Endpoints ​

Mounted via [geminiRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/geminiRoutes.ts), [chatRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/chatRoutes.ts), [conversationRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/conversationRoutes.ts), and [whatsappWebhookRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/whatsappWebhookRoutes.ts).

MethodEndpointAuth LevelRate LimitDescription / Technical Behavior
POST/api/gemini/streamAuthenticated20 req/m (aiRateLimiter)Nduzi AI Streaming: SSE connection executing multi-turn tool calling and contextual campus product recommendations (limit: 8mb).
POST/api/gemini/session-titleAuthenticated30 req/mGenerates a 3-5 word semantic title for an AI conversational thread.
POST/api/gemini/support-replyStaff (requireStaff)20 req/mGenerates AI-assisted suggested replies for customer support agents.
GET/api/conversationsAuthenticatedGlobalLists active buyer-to-vendor direct message threads.
GET/api/conversations/:id/messagesAuthenticated (Participant)GlobalPaginated message history for a specific conversation.
POST/api/chat/sendAuthenticated60 req/mSends buyer-vendor message. Enforces ChatGuard regex inspection (blocks off-platform phone/bank leaks).
GET/api/whatsapp/webhookWebhook (Public)GlobalMeta WhatsApp Cloud API verification challenge handshake (hub.challenge).
POST/api/whatsapp/webhookWebhook (Public)NoneInbound WhatsApp customer replies and delivery status notifications.
GET/api/notificationsAuthenticatedGlobalReal-time member in-app push and transaction notification feed.
PUT/api/notifications/:id/readAuthenticatedGlobalMarks notification item as read.

7. Customer Support & Dispute Arbitration Endpoints ​

Mounted via [supportRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/supportRoutes.ts) and [disputeRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/disputeRoutes.ts).

MethodEndpointAuth LevelRate LimitDescription / Schema
POST/api/supportAuthenticated10 req/hOpens support ticket (subject, message, category, orderId).
GET/api/support/:id/messagesTicket Creator / StaffGlobalConversation log between user and Debelu customer support.
POST/api/support/:id/messagesTicket Creator / Staff30 req/mAppends message or signed attachment URL to support ticket.
PUT/api/support/:id/rateTicket Creator10 req/mSubmits Customer Satisfaction (CSAT) rating (1-5 stars) upon resolution.
POST/api/disputesBuyer / Vendor5 req/dEscalates order issue to formal escrow dispute (DisputeService).
POST/api/disputes/:id/evidenceBuyer / Vendor10 req/mUploads unboxing video, photo evidence, or campus hub waybill.
POST/api/disputes/:id/resolveStaff (AAL2)10 req/mArbitrates dispute; executes either buyer refund or vendor escrow payout.

8. Data Privacy & Statutory Compliance Endpoints (NDPA / GDPR) ​

Mounted via [subjectPrivacyExportRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/subjectPrivacyExportRoutes.ts), [privacyExportArtifactRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/privacyExportArtifactRoutes.ts), [privacyErasurePlanRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/privacyErasurePlanRoutes.ts), and [privacyErasureExecutionRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/privacyErasureExecutionRoutes.ts).

MethodEndpointAuth LevelRate LimitDescription / Compliance SLA
POST/api/users/me/privacy-exportsAuthenticated5 req/h (exportLimiter)Initiates NDPA Data Subject Access Request (DSAR) export job.
GET/api/users/me/privacy-exportsAuthenticatedGlobalLists status of generated personal data export archives.
GET/api/users/me/privacy-exports/:id/artifactAuthenticated10 req/hDownloads encrypted ZIP package containing user PII JSON documents.
POST/api/users/me/request-deletionAuthenticated1 req/dSubmits Right to be Forgotten (RTBF) erasure request (30-day grace period).
POST/api/users/me/cancel-deletionRestricted / SuspendedGlobalCancels pending account deletion during statutory 30-day grace period.
POST/api/privacy/erasure-plansCompliance Staff10 req/mAssembles data erasure impact assessment plan for account deletion.
POST/api/privacy/erasure-executionsCompliance Staff (AAL2)5 req/mExecutes permanent data scrubbing across all erasable database tables.

9. Platform Governance, Observability & Health Endpoints ​

Mounted via [server.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/server.ts), [campusOperationsRouter.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/campusOperationsRouter.ts), and [platformConfigurationProposalRoutes.ts](file:///c:/Users/frank/OneDrive/Desktop/Chisom/Debelu/New%20Debelu%20Marketplace/debelu-backend/src/routes/platformConfigurationProposalRoutes.ts).

MethodEndpointAuth LevelCache PolicyDescription / Key Capabilities
GET/health/livePublicNo-StoreFast liveness probe returning HTTP 200 { status: "live" }.
GET/health/readyPublicNo-StoreDeep readiness probe (checks live Postgres connection & Redis ping). Returns 503 if down.
GET/healthPublicNo-StoreComprehensive SRE diagnostic dashboard checking 7 upstream dependencies.
GET/api/statusPublicMemory (30s)Non-sensitive platform maintenance state and operational component statuses.
POST/api/csp-reportPublic30 req/15mIngests Content Security Policy (CSP) violation reports from browsers.
GET/api/campus/operations/hubsCampus Rep / StaffGlobalLists physical campus pickup locations, hours, and appointed student reps.
POST/api/platform/proposalsStaff (requireAdmin)10 req/m4-Eyes Governance: Proposes platform fee or category commission adjustments.
POST/api/platform/proposals/:id/approveStaff (AAL2)5 req/mSecond administrative officer approves and activates platform configuration change.

10. Document Revision History ​

RevisionDateLead AuthorScope of ChangesStatus
1.0.02026-10-05Principal API ArchitectComplete, exhaustive REST API endpoint catalog covering 38 route modules, authentication levels, rate limit quotas, and schemas.Active Living Standard

Released under Proprietary Enterprise License.