Delivery

Delivery consists of three stages.

Estimate ride, Book ride, Cancel ride. 

 

The developer should configure his app URL for each stage in his 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: 

{ "location_id": "131e22c1-074b-4358-a7bd-a20dbf67a64e", "customer_id": "61fdda3f-b56d-4756-9818-06f68bb80a8a", "address_id": "61fdda3f-b56d-4756-9818-06f68bb80a8a","register_id": "6c7cf0be-d391-4535-8984-c9cbab91fde7" } 

POST Response: 

{ "distance_km": 4.5, "fees": 8, “status":”REQUESTED” , "duration_time": 8, "ride_id": "1" }

 

2. Book ride 

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

POST Body: 

{ "ride_id": "1", "delivery_info":{ "location_id": "131e22c1-074b-4358-a7bd-a20dbf67a64e", "customer_id": "61fdda3f-b56d-4756-9818-06f68bb80a8a", "address_id": "61fdda3f-b56d-4756-9818-06f68bb80a8a" ,"register_id": "6c7cf0be-d391-4535-8984-c9cbab91fde7"} }  

POST Response devided to two types: 

  • Asynchronous  

{ “status” : ”WAIT”, "ride_id": "1" }

  • Synchronous  

{ “status”:”BOOKED” ,"distance_km": 4.5, "fees": 10, "duration_time": 8, "ride_id": "1" } 

 

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" :"1" } 

POST Response: 

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