Middleware Backend — Refunds
Folder: src/routes/refunds/
Mount: api/v1/bookdirect/refunds
Status: to implement.
Middleware Backend · winner
POST https://middleware-dev.bookdirect.live/api/v1/bookdirect/refunds
GET https://middleware-dev.bookdirect.live/api/v1/bookdirect/refunds/{refund_uuid}
Frontend: Manage booking.
Request
json
{
"booking_uuid": "{booking_uuid}",
"reason": "guest_cancelled",
"amount_kobo": null
}amount_kobo null = full refund of the paid payment entity.
Middleware Backend must
- JWT user is the booking
owned_byor owns the parent property (or has a Core Backend role on it). - Load paid
paymentfrom Core Backend (parent_entity_type=booking). - Call PSP refund (Paystack
refund, etc.). - Update Core Backend payment
statustorefunded/partially_refunded. PUTbookingstatus: cancelledwhen the policy says the stay is void.- Optional:
POSTemailsbooking_cancelled_guest/booking_cancelled_owner.
IDOR
A guest must not refund someone else’s booking by guessing booking_uuid. An owner must not refund a booking on a property they do not own. Enforce on Middleware Backend and assume Core Backend GET-by-uuid may be under-scoped — check ownership yourself.