Delivery

Delivery consists of three stages:

1 - Estimate ride.
2 - Book ride.
3 - Cancel ride. 

The developer should configure the app URL for each stage in the app dashboard.

POSRocket will use these URLs to send a POST request to them.

 


 Here are the requests and responses related to delivery: 

1. Estimate Ride:

POST URL: The developer should configure it in the app dashboard

POST Body:

{
  "shop": {
    "id": "buesiness_id",
    "name": "business_name"
  },
  "pickup": {
    "branch": {
      "id": "location_id",
      "name": "location_name"
    },
    "address": {
      "city": "Amman",
      "area": "7th circle",
      "block": "7",
      "avenue": "12",
      "longitude": "35.860982",
      "latitude": "31.97602"
    }
  },
  "dropoff": {
    "customer": {
      "id": "customer_id",
       "name": "Jack",
       "phone_no": "962791823167"
    },
    "address": {
      "city": "Zarqa",
      "area": "51",
       "block": "3",
       "avenue": "5",
       "long": "38.860982",
       "lat": "15.860982"
    }
  },
  "order": {
    "preperation_time": "9"
    }
  }

 

POST Response:

{
    "distance_km": 4.5,
    "fees": 8000,
    "status": "REQUESTED",
    "duration_time": 8,
    "ride_id": 1
}
 Note: The delivery fees value will be multiplied by 1000*

 


 2. Book Ride 

POST URL: The developer should configure it in the app dashboard

POST Body:

{
   "shop": {
     "id": "buesiness_id",
     "name": "business_name"
   },
   "pickup": {
     "branch": {
       "id": "location_id",
       "name": "location_name"
     },
     "address": {
       "city": "Amman",
       "area": "7th circle",
       "block": "7",
       "avenue": "12",
       "longitude": "35.860982",
       "latitude": "31.97602"
     }
   },
   "dropoff": {
     "customer": {
       "id": "customer_id",
        "name": "Jack",
        "phone_no": "962791823167"
     },
     "address": {
       "city": "Zarqa",
       "area": "51",
        "block": "3",
        "avenue": "5",
        "long": "38.860982",
        "lat": "15.860982"
     }
   },
   "order": {
      id": "order_id",
     "preperation_time": "9"
     },
   "ride_id": "ride_id"
   }

 

POST Response divided into two types: 

  • Asynchronous  
    {
        "status": "WAIT",
        "ride_id": "ride_id"
    }
  • Synchronous  
    {
        "status": "BOOKED",
        "distance": 4.5,
        "fees": 10000,
        "duration_time": 8,
        "ride_id": "ride_id"
    }

     Note: The delivery fees value will be multiplied by 1000*

 


 3. Cancel Ride:

POST URL: The developer should configure it in the app dashboard

POST Body: 

reason is not required*

     {
        "reason": "too late",
        "ride_id": "ride_id"
     }

 

POST Response: 

    {
        "status": "CANCELED",
        "ride_id": "ride_id"
    }