Skip to main content
Every operation on this page requires a Portal buyer token. The session determines the buyer; do not send another buyer’s ID.

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)
A missing buyer returns 404. Clear the application’s local session after deletion.
This is not a refund, reservation cancellation, or complete financial-data erasure operation. It deletes the Portal account, not the separate payment and reservation records.

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)
Unlike GET user, the response is the buyer object without a 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)
Adding an existing favorite does not duplicate it. Missing fields or an invalid action return 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)
Reservation records include _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. 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.