Booking APIs
The Booking API finalizes reserved slots into confirmed bookings. It validates reservation status, capacity constraints, and business rules before committing the booking. Bookings represent the final state of slot assignment, used for downstream workflows like shipment scheduling or vehicle dispatch.
Base URL
https://sandbox-apis.prayog.io/slotsAPI Response Status Codes
| Code | Description |
|---|---|
| 1000 | OK |
| 1001 | Success |
| 1002 | Partial Success |
| 4000 | Bad Request |
| 4004 | Not Found |
| 5000 | Internal Server Error |
HTTP Response Status Codes
| Code | Description |
|---|---|
| 200 | OK |
| 201 | Created |
| 207 | Multi Status |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Available Endpoints
1. Get Booking By Id
To get the booking by Id.
Method: GET
Endpoint: /api/v1/booking/{id}
Request Headers:
{ "Content-Type": "application/json", "X-Tenant-ID": "Tenant id", "X-User-ID": "User id"}Request Params Parameters
| Field | Type | Mandatory | Description | Example |
|---|---|---|---|---|
| id | int number | Yes | Reservation Id | 37 |
Sample Success Response
{ "status": "success", "message": "Booking fetched successfully.", "data": { "reservationId": 37, "slotId": 1, "status": "confirmed", "date": "2025-05-27", "reservedAt": "2025-04-28T07:39:48.672Z", "confirmedAt": "2025-04-28T07:40:00.221Z", "cancelledAt": null, "releasedAt": null, "expiredAt": null, "createdAt": "2025-04-28T07:39:48.671Z", "updatedAt": "2025-04-28T07:40:00.222Z", "bookedCapacity": { "volumetricWeight": 3, "physicalWeight": 5 }, "bookedSpaces": { "length": 6, "width": 1, "height": 9, "x": 0, "y": 0, "z": 16 } }, "statusCode": 1000}Sample Error Response
{ "status": "error", "error": "Id must be a positive integer number.", "statusCode": 4000}Sample Not Found Response
{ "status": "error", "error": "Booking not found.", "statusCode": 4004}2. Get Bookings
To get the bookings.
Method: GET
Endpoint: /api/v1/bookings
Request Headers:
{ "Content-Type": "application/json", "X-Tenant-ID": "Tenant id", "X-User-ID": "User id"}Request Query Parameters
| Field | Type | Mandatory | Description | Example |
|---|---|---|---|---|
| page | int number | No | Page | 1 |
| limit | int number | No | Page limit | 10 |
| status | string | No | Reservation status ( ‘reserved’,‘confirmed’,‘cancelled’,‘released’,‘expired’) | confirmed |
| date | string | No | Slot date (YYYY-MM-DD) | 2025-05-27 |
| slotId | int number | No | Slot Id | 1 |
Sample Success Response
{ "status": "success", "message": "Bookings fetched successfully.", "data": [ { "reservationId": 1, "slotId": 1, "status": "expired", "date": "2025-05-25", "reservedAt": "2025-05-09T13:12:29.883Z", "confirmedAt": null, "cancelledAt": null, "releasedAt": null, "expiredAt": "2025-05-09T13:12:40.143Z", "createdAt": "2025-05-09T13:12:29.881Z", "updatedAt": "2025-05-09T13:12:40.145Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 0, "y": 0, "z": 0 } }, { "reservationId": 2, "slotId": 1, "status": "cancelled", "date": "2025-05-26", "reservedAt": "2025-05-09T13:12:20.594Z", "confirmedAt": "2025-05-09T13:12:25.359Z", "cancelledAt": "2025-05-09T13:12:29.099Z", "releasedAt": null, "expiredAt": null, "createdAt": "2025-05-09T13:12:20.592Z", "updatedAt": "2025-05-09T13:12:29.100Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 4, "y": 2, "z": 0 } }, { "reservationId": 3, "slotId": 1, "status": "confirmed", "date": "2025-05-26", "reservedAt": "2025-05-09T13:12:20.594Z", "confirmedAt": "2025-05-09T13:12:25.359Z", "cancelledAt": null, "releasedAt": null, "expiredAt": null, "createdAt": "2025-05-09T13:12:20.592Z", "updatedAt": "2025-05-09T13:12:25.360Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 5, "y": 3, "z": 0 } }, { "reservationId": 4, "slotId": 1, "status": "released", "date": "2025-05-26", "reservedAt": "2025-05-09T13:12:20.594Z", "confirmedAt": "2025-05-09T13:12:25.359Z", "cancelledAt": null, "releasedAt": "2025-05-09T13:12:36.306Z", "expiredAt": null, "createdAt": "2025-05-09T13:12:20.592Z", "updatedAt": "2025-05-09T13:12:36.307Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 3, "y": 1, "z": 0 } }, { "reservationId": 5, "slotId": 1, "status": "reserved", "date": "2025-05-27", "reservedAt": "2025-05-09T13:12:48.537Z", "confirmedAt": null, "cancelledAt": null, "releasedAt": null, "expiredAt": null, "createdAt": "2025-05-09T13:12:48.535Z", "updatedAt": "2025-05-09T13:12:48.535Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 6, "y": 4, "z": 0 } }, { "reservationId": 6, "slotId": 1, "status": "reserved", "date": "2025-05-28", "reservedAt": "2025-05-09T13:12:50.000Z", "confirmedAt": null, "cancelledAt": null, "releasedAt": null, "expiredAt": null, "createdAt": "2025-05-09T13:12:50.000Z", "updatedAt": "2025-05-09T13:12:50.000Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 7, "y": 5, "z": 0 } }, { "reservationId": 7, "slotId": 1, "status": "confirmed", "date": "2025-05-29", "reservedAt": "2025-05-09T13:13:00.000Z", "confirmedAt": "2025-05-09T13:13:05.000Z", "cancelledAt": null, "releasedAt": null, "expiredAt": null, "createdAt": "2025-05-09T13:13:00.000Z", "updatedAt": "2025-05-09T13:13:05.000Z", "bookedCapacity": { "volumetricWeight": 2, "physicalWeight": 2 }, "bookedSpaces": { "length": 2, "width": 1, "height": 1, "x": 0, "y": 1, "z": 0 } }, { "reservationId": 8, "slotId": 1, "status": "released", "date": "2025-05-29", "reservedAt": "2025-05-09T13:13:10.000Z", "confirmedAt": "2025-05-09T13:13:15.000Z", "cancelledAt": null, "releasedAt": "2025-05-09T13:13:25.000Z", "expiredAt": null, "createdAt": "2025-05-09T13:13:10.000Z", "updatedAt": "2025-05-09T13:13:25.000Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 1, "y": 1, "z": 0 } }, { "reservationId": 9, "slotId": 1, "status": "cancelled", "date": "2025-05-30", "reservedAt": "2025-05-09T13:13:30.000Z", "confirmedAt": "2025-05-09T13:13:35.000Z", "cancelledAt": "2025-05-09T13:13:40.000Z", "releasedAt": null, "expiredAt": null, "createdAt": "2025-05-09T13:13:30.000Z", "updatedAt": "2025-05-09T13:13:40.000Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 2, "height": 1, "x": 2, "y": 2, "z": 0 } }, { "reservationId": 10, "slotId": 1, "status": "expired", "date": "2025-05-31", "reservedAt": "2025-05-09T13:13:50.000Z", "confirmedAt": null, "cancelledAt": null, "releasedAt": null, "expiredAt": "2025-05-09T13:14:00.000Z", "createdAt": "2025-05-09T13:13:50.000Z", "updatedAt": "2025-05-09T13:14:00.000Z", "bookedCapacity": { "volumetricWeight": 1, "physicalWeight": 1 }, "bookedSpaces": { "length": 1, "width": 1, "height": 1, "x": 2, "y": 3, "z": 0 } } ], "pagination": { "page": 1, "limit": 10, "offset": 0, "totalPage": 11, "totalItem": 107 }, "statusCode": 1000}Sample Error Response
{ "status": "error", "error": "Limit must be an integer number.", "statusCode": 4000}Sample No Match Response
{ "status": "success", "message": "Bookings fetched successfully.", "data": [], "pagination": { "page": 1, "limit": 10, "offset": 0, "totalPage": 14, "totalItem": 137 }, "statusCode": 1000}