Add Pickup Location
The Pickup Location API Route will create a pickup location in Openleaf.
You have to pass all the required params at the minimum to create a pickup location. You can add additional parameters as per your preference.
Request
POST REQUEST
https://api.openleaf.tech/api/v1/pickup/createPickupLocation
| Params | Required | Data Type | Description |
|---|---|---|---|
| warehouse_name | Yes | String | Name of Pickup Location |
| warehouse_manager_name | Yes | String | Name of Warehouse Manager |
| Yes | Integer | Email of Shipper | |
| phone | Yes | Integer | Mobile of Shipper |
| address_line1 | Yes | String | Address Line 1 of Shipper |
| address_line2 | No | String | Address Line 2 of Shipper |
| city | Yes | String | City of Shipper |
| state | Yes | String | State of Shipper |
| country | Yes | String | Email of Shipper |
| pincode | Yes | String | Pincode of Shipper |
Header Example
{
"Authorization": "Bearer {{your_token}}",
"Content-Type": "application/json"
}
Request Example
{
"warehouse_name": "Apple WH",
"warehouse_manager_name": "Bill Gates",
"email": "billgates@gmail.com",
"phone": 9999889999,
"address_line1": "Thane, 400604",
"address_line2": "Maharashtra",
"city": "Thane",
"state": "Maharashtra",
"country": "India",
"pincode": 400604
}
Response
| Params | Data Type | Description |
|---|---|---|
| status | Object | Object containing the status of the request |
| status.message | String | Message containing the outcome of the request |
| status.status_code | Integer | Status Code of request
|
| status.success | String | If the response is successful then true else false |
Response Example
{
"status": {
"message": "Pickup Location Added!",
"status_code": 200,
"success": true
}
}
Error Response Example
{
"status": {
"message": "There was an error while adding the pickup location",
"status_code": 500,
"success": false
}
}
IN CASE OF FAILURE
Please note, in case of any validation failure - pickup location will not get created. Please wait for 10-15 seconds before you cancel the request for latency.
Example
Curl Command
curl --location --request POST 'https://api.openleaf.tech/api/v1/pickup/createPickupLocation' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{token}}' \
--data-raw '{
"warehouse_name": "Apple WH",
"warehouse_manager_name": "Bill Gates",
"email": "billgates@gmail.com",
"phone": 9999889999,
"address_line1": "Thane, 400604",
"address_line2": "Maharashtra",
"city": "Thane",
"state": "Maharashtra",
"country": "India",
"pincode": 400604
}'
Output:
{
"status": {
"message": "Pickup Location Added!",
"status_code": 200,
"success": true
}
}