http://localhost:8000/api/booking
All routes below are prefixed with this base URL.
Authorization: Bearer <customer_token>
Content-Type: application/json
{
"category": [
{
"categoryId": "paper",
"name": "Paper",
"estimatedWeight": 13,
"subcategories": [
{
"subCategoryId": "newspaper",
"name": "Newspaper"
}
]
}
],
"scrapImages": [
{
"imageUrl": "/upload/file/file1.jpg",
"size": 204800,
"type": "image/jpeg"
}
],
"pickupLocation": {
"doorNo": "12A",
"flat": "3rd Floor",
"area": "MG Road",
"city": "Bangalore",
"state": "Karnataka",
"pincode": "560001",
"coordinates": {
"lat": 12.9716,
"lng": 77.5946
}
},
"estimatedPrice": 195
}
{
"success": true,
"message": "Booking created successfully",
"data": {
"_id": "bookingId",
"status": "requested",
"type": "online",
"estimatedPrice": 195,
"createdAt": "timestamp"
}
}
400 At least one category is required
400 Valid pickup location is required
400 Estimated price must be a number
400 Only 3 active pickup bookings are allowed
401 Unauthorized
Authorization: Bearer <customer_token>
{
"success": true,
"bookings": [
{
"_id": "bookingId",
"status": "requested",
"estimatedPrice": 195,
"pickupLocation": {...},
"createdAt": "timestamp"
}
]
}
{
"success": true,
"bookings": [],
"message": "No active bookings found"
}
Authorization: Bearer <customer_token>
{
"success": true,
"bookings": [
{
"_id": "bookingId",
"status": "completed",
"estimatedPrice": 220,
"createdAt": "timestamp"
}
]
}
Authorization: Bearer <vendor_token>
{
"success": true,
"bookings": [
{
"_id": "bookingId",
"status": "requested",
"estimatedPrice": 195
}
]
}
Authorization: Bearer <vendor_token>
{
"success": true,
"bookings": [
{
"_id": "bookingId",
"status": "completed",
"estimatedPrice": 220
}
]
}