Get current buyer
GET /api/portal/user
No query or body fields are required.
Response (200)
favoriteUnits and reservations contain IDs, not populated documents. Password and reset-token fields are excluded. A missing buyer returns 404; invalid sessions return 401.
Delete current buyer
DELETE /api/portal/user
No body is required. Deletes the buyer in the session’s project or group.
Response (200)
404. Clear the application’s local session after deletion.
Update profile
PUT /api/portal/profile
Optional email must be a valid email address. Send other profile fields at the top level: they are sanitized and merged into the existing data object.
Request
Response (200)
user wrapper. Email is normalized to lowercase. A collision with another buyer in the same scope returns 409 with "That email is already in use." Invalid input returns 400; a missing buyer returns 404. Updating a profile is not a password change or email-verification flow.
List favorites
GET /api/portal/favorite-unit
For project sessions, optional query projectId defaults to the token’s project. Group sessions return that group buyer’s complete favorites list rather than filtering it by project.
Response (200)
Update favorites
POST /api/portal/favorite-unit
Request
Response (200)
400; a project mismatch returns 403; a missing buyer returns 404. Favorites do not put inventory on hold.
List reservations
GET /api/portal/reservations
No request fields are required. Returns reservations linked to and owned by the current buyer, with unit populated when its referenced record is available.
Response (200, no reservations)
_id, project, unit, unitModel, portalUserId, reservationDate, and status. Depending on the payment, they can also contain reference, customerName, customerEmail, paymentAmount, paymentCurrency, paymentProvider, notes, buyNow, and buyNowFee.
status is succeeded, pending, or cancelled. unitModel is Unit or CommercialSpace; paymentProvider can be stripe or paystack. Treat an unresolved unit as nullable and payment fields as optional. These statuses are separate from inventory availability.
Update reservation links
POST /api/portal/reservations
All three fields are required, including projectId for group sessions.
Request
Response (200)
action must be add or remove. Adding requires an existing reservation owned by this buyer and belonging to the supplied project. A missing, other-buyer, or wrong-project reservation returns the same 404 "Reservation not found" response. Project sessions also require a matching token project (403 on mismatch). Invalid input returns 400.
The POST response contains reservation IDs, whereas GET returns populated reservation records. Removing a link only removes it from the buyer’s list; it does not cancel the reservation, release inventory, or refund a charge.