Customer Lease APIs
Base URL: http://localhost:8000/api/v1
Prefix: /customers
Auth: Bearer token with customer role
Headers: Content-Type: application/json
1. Submit Lease Reservation
Creates a rental application and submits the configured lease-reservation payment for admin verification.
/customers/properties/{property_id}/lease-reservations/Auth: Required
Headers
Authorization: Bearer {{access_token}}
Content-Type: application/jsonRequest Body
{
"preferred_move_in_date": "2026-10-01",
"preferred_duration_months": 12,
"message": "I would like to lease this property for 12 months.",
"transaction_id": "BFT-LEASE-RESERVATION-001",
"payment_proof_url": "https://example.com/payment-proofs/lease-reservation-001.jpg"
}Success Example
{
"success": true,
"message": "Lease reservation payment submitted for verification.",
"data": {
"rental_application": {
"id": "923089a0-69e0-4377-a107-2d0289831203",
"status": "submitted",
"preferred_move_in_date": "2026-10-01",
"preferred_duration_months": 12,
"preferred_move_out_date": "2027-09-30",
"message": "I would like to lease this property for 12 months.",
"created_at": "2026-09-15T10:00:00Z"
},
"payment": {
"id": "183e7ac0-df37-4f5a-8f09-a360a54037b4",
"payment_for": "rental_reservation",
"method": "bank_transfer",
"status": "submitted",
"transaction_id": "BFT-LEASE-RESERVATION-001",
"payment_proof_url": "https://example.com/payment-proofs/lease-reservation-001.jpg"
},
"next_action": "Your lease reservation payment is awaiting admin verification."
}
}Notes
-
property_idmust identify a property listed for rent. -
The property must have
availablestatus. -
The backend calculates the reservation amount from the administrator rental reservation setting: percentage or fixed amount, defaulting to 2% of the listed price.
-
The customer cannot provide or modify the reservation amount.
-
preferred_move_in_dateis required. -
preferred_duration_monthsis required and must be between 1 and 120. -
messageis optional. -
transaction_idis required and may contain up to 120 characters. -
payment_proof_urlis optional but must be a valid URL when supplied. -
The payment method is
bank_transfer. -
The payment is created with
submittedstatus. -
The rental application is created with
submittedstatus. -
The property remains available until the reservation payment is verified by an admin.
-
Another active rental application prevents a new reservation for the same property.
-
Save
data.rental_application.id; it is required by the remaining-payment API. -
A successful request returns HTTP
201 Created. -
HTTP
400 Bad Requestis returned when validation fails or the property cannot be reserved. -
HTTP
401 Unauthorizedis returned when authentication is missing or invalid. -
HTTP
403 Forbiddenis returned when the authenticated user is not a customer.
2. Submit Lease Remaining Payment
Submits a full or partial bank-transfer payment against the outstanding initial lease balance.
/customers/remaining-payments/leases/{rental_application_id}/Auth: Required
Headers
Authorization: Bearer {{access_token}}
Content-Type: application/jsonRequest Body
{
"amount": "2000.00",
"transaction_id": "BFT-LEASE-REMAINING-001",
"payment_proof_url": "https://example.com/payment-proofs/lease-remaining-001.jpg"
}Success Example
{
"success": true,
"message": "Remaining lease payment submitted for verification.",
"data": {
"rental_application_id": "923089a0-69e0-4377-a107-2d0289831203",
"payment": {
"id": "05bf6841-b2e4-4fc5-b034-c60271451170",
"payment_for": "rent",
"amount": "2000.00",
"currency": "USD",
"method": "bank_transfer",
"status": "submitted",
"transaction_id": "BFT-LEASE-REMAINING-001",
"payment_proof_url": "https://example.com/payment-proofs/lease-remaining-001.jpg",
"created_at": "2026-09-16T11:30:00Z"
},
"total_amount": "2250.00",
"verified_amount": "45.00",
"remaining_amount": "2205.00",
"next_action": "This payment is awaiting admin verification."
}
}Notes
-
rental_application_idis obtained fromdata.rental_application.idin the lease-reservation response. -
The rental application must belong to the authenticated customer.
-
The rental application must have
reservedstatus. -
The initial lease-reservation payment must have
verifiedorpaidstatus. -
The total initial lease amount is the property’s listed rental price.
-
The outstanding balance is calculated as the total amount minus all verified reservation and rent payments.
-
amountis required and must be at least1.00. -
The payment can cover part or all of the outstanding balance.
-
The submitted amount cannot exceed the outstanding balance.
-
transaction_idis required and may contain up to 120 characters. -
payment_proof_urlis optional but must be a valid URL when supplied. -
The payment method is
bank_transfer. -
The payment is created with
payment_for: rentandstatus: submitted. -
Only one pending, submitted, or partial remaining lease payment may exist at a time.
-
verified_amountincludes the verified reservation payment and any previously verified remaining payments. -
remaining_amountrepresents the balance before the newly submitted payment is verified. -
The submitted amount is deducted only after admin verification.
-
Admins receive a payment-verification notification.
-
A successful request returns HTTP
201 Created. -
HTTP
400 Bad Requestis returned for an invalid amount, unverified reservation, invalid status, or an existing payment awaiting verification. -
HTTP
401 Unauthorizedis returned when authentication is missing or invalid. -
HTTP
403 Forbiddenis returned when the authenticated user is not a customer. -
HTTP
404 Not Foundis returned when the rental application does not exist or belongs to another customer.
Common Success Format
{
"success": true,
"message": "Operation completed successfully.",
"data": {}
}Common Error Format
{
"success": false,
"message": "Validation failed.",
"errors": {
"field_name": [
"Error description."
]
}
}