Skip to main content

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

ParamsRequiredData TypeDescription
warehouse_nameYesStringName of Pickup Location
warehouse_manager_nameYesStringName of Warehouse Manager
emailYesIntegerEmail of Shipper
phoneYesIntegerMobile of Shipper
address_line1YesStringAddress Line 1 of Shipper
address_line2NoStringAddress Line 2 of Shipper
cityYesStringCity of Shipper
stateYesStringState of Shipper
countryYesStringEmail of Shipper
pincodeYesStringPincode 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

ParamsData TypeDescription
statusObjectObject containing the status of the request
status.messageStringMessage containing the outcome of the request
status.status_codeIntegerStatus Code of request
  • 200 if the request is successful
  • 400 if there is an error
status.successStringIf 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
}
}