Hayapass Global Logistics API Documentation
1. Introduction
API Name: Hayapass Global Logistics API
Description: This API allows users to calculate delivery costs based on distance and weight, and to place orders for deliveries.
Base URL: https://hayapassgloballogistics.com/api/
2. Authentication
Users do not include an API key in their requests.
Example:
- As Query Parameter:
https://hayapassgloballogistics.com/api/
3. Endpoints
Place an Order
Endpoint: POST /order
Description: Creates a new delivery order.
Request Headers:
Content-Type: application/json
Request Body Parameters:
action
(string, required): This lets the api gets processedpickup
(string, required): The pickup address.deliver
(string, required): The delivery address.weight
(float, required): The weight of the package in kilograms.note
(string, optional): Any additional notes for the order.name
(string, required): Sender's name.email
(string, required): Sender's email.phone
(string, required): Sender's phone number.reciever_name
(string, required): Receiver's name.reciever_email
(string, required): Receiver's email.reciever_phone
(string, required): Receiver's phone number.redirect_url
(string, required): Page to redirect user to after processing.
Request Example:
{
"pickup": "123 Main St",
"deliver": "456 Market St",
"weight": 2.5,
"note": "Fragile",
"name": "John Doe",
"email": "john@example.com",
"phone": "1234567890",
"reciever_name": "Jane Smith",
"reciever_email": "jane@example.com",
"reciever_phone": "0987654321",
"redirectlink": "https://yourdomain.com/success",
"action": "startBooking"
}
Response:
After successfully placing an order, the user will be redirected to the provided redirectlink
URL with the status
and orderno
as GET parameters.
Example Redirect:
https://yourdomain.com/success?status=success&orderno=123456
4. Error Handling
400 Bad Request: The request is missing required parameters or has invalid values.
{
"error": "Missing required parameters: pickup_address, delivery_address"
}
500 Internal Server Error: An error occurred on the server.
{
"error": "An unexpected error occurred. Please try again later."
}
5. Rate Limiting
Requests per Minute: 60 requests.
If the limit is exceeded, the API will return a 429 Too Many Requests
status code.
This cdn links are to be included as well as https://maps.googleapis.com/maps/api/js?key=YOURGOOGLEAPIKEY&callback=initAutocomplete&libraries=places&v=weekly and https://hayapassgloballogistics.com/js/map.js
6. Usage Example with HTML
Form Example for Order Placement:
<form id="orderForm" action="https://hayapassgloballogistics.com/api/order" method="POST">
<input type="text" name="pickup" placeholder="Pickup Address" required>
<input type="text" name="deliver" placeholder="Delivery Address" required>
<input type="number" name="weight" placeholder="Weight (kg)" required>
<input type="text" name="note" placeholder="Notes">
<input type="hidden" name="action" value="startBooking">
<input type="hidden" name="redirect_url" value="https://yourdomain.com/success">
<input type="text" name="name" placeholder="Your Name" required>
<input type="email" name="email" placeholder="Your Email" required>
<input type="tel" name="phone" placeholder="Your Phone Number" required>
<input type="text" name="reciever_name" placeholder="Receiver's Name" required>
<input type="email" name="reciever_email" placeholder="Receiver's Email" required>
<input type="tel" name="reciever_phone" placeholder="Receiver's Phone Number" required>
<button type="submit">Place Order</button>
</form>
7. Conclusion
This documentation provides an overview of the Hayapass Global Logistics API, detailing the endpoints, authentication, and error handling. For any further assistance, please contact the API support team.