📘 API Documentation: List Sales
Base URL
https://property.ysgcloud.com.ng
Endpoint
/api/listsales
Authentication
No authentication required. If added later, use Authorization: Bearer <token>.
Request
- Method: GET
- Headers:
Accept: application/json
Response
Returns an array of sales/invoice objects with the following fields:
- PropertyNo
- PropertyName
- TenantName
- InvoiceNo
- InvoiceDate
- TotalAmount
- AmountPaid
- Outstanding
- InvoiceStatus
Example Success Response
[
{
"PropertyNo": "P001",
"PropertyName": "Broad Street Apartments",
"TenantName": "Samuel Johnson",
"InvoiceNo": "INV1001",
"InvoiceDate": "2025-01-15",
"TotalAmount": 150000,
"AmountPaid": 100000,
"Outstanding": 50000,
"InvoiceStatus": "Partially Paid"
},
{
"PropertyNo": "P002",
"PropertyName": "Marina Towers",
"TenantName": "Mary Adams",
"InvoiceNo": "INV1002",
"InvoiceDate": "2025-02-01",
"TotalAmount": 200000,
"AmountPaid": 200000,
"Outstanding": 0,
"InvoiceStatus": "Paid"
}
]
Error Response
{
"status": "error",
"message": "Invalid request or server error"
}
Example Usage
JavaScript (Browser)
<script>
fetch("https://property.ysgcloud.com.ng/api/listsales")
.then(response => {
if (!response.ok) throw new Error("Network error");
return response.json();
})
.then(sales => {
console.log("Retrieved sales:", sales);
sales.forEach(s => {
console.log(
`PropertyNo: ${s.PropertyNo}, PropertyName: ${s.PropertyName}, Tenant: ${s.TenantName},
InvoiceNo: ${s.InvoiceNo}, Date: ${s.InvoiceDate}, Total: ${s.TotalAmount},
Paid: ${s.AmountPaid}, Outstanding: ${s.Outstanding}, Status: ${s.InvoiceStatus}`
);
});
})
.catch(err => console.error("Error:", err));
</script>
Postman
GET Request
- Method: GET
- URL:
https://property.ysgcloud.com.ng/api/listsales - Headers:
Accept: application/json
Live Demo
Open your browser console to see the retrieved sales data: