Webhooks

Webhooks

Fery sends events to the webhookURL provided in Create Order.

That URL is saved on the ride. The same URL is used for:

  • ride status updates
  • partner location updates

Registering the webhook

There is no separate webhook registration API.

  1. Host an HTTPS endpoint
  2. Pass it as webhookURL in create order
  3. Fery POSTs events to that URL for the ride
1{
2 "webhookURL": "https://your-domain.com/fery/updates",
3 "metadata": {
4 "partnerOrderId": "DMRC-ORDER-1001"
5 }
6}

Endpoint requirements

RequirementValue
MethodPOST
BodyJSON
Auth headersecretkey: <WEBHOOK_SECRET>
Success responseHTTP 200 or 201

Case A — Status update

Sent when the ride status changes.

Identify this case when status is not location_updated.

Status values

statusMeaning
acceptedPartner confirmed the ride
arrivedPartner arrived at pickup
startedTrip started
droppedTrip completed
customer_cancelledCancelled by customer via Cancel API
rydr_cancelledCancelled by partner
expiredNo partner found
abortedCancelled operationally by the system

Example — accepted

1{
2 "orderId": "1717235676225158",
3 "status": "accepted",
4 "otp": "1234",
5 "metadata": {
6 "partnerOrderId": "DMRC-ORDER-1001"
7 },
8 "captainDetails": {
9 "name": "Priya",
10 "mobile": "9888888888",
11 "currentVehicle": {
12 "number": "DL1SAA0001"
13 }
14 }
15}

Example — dropped

1{
2 "orderId": "1717235676225158",
3 "status": "dropped",
4 "amount": 52,
5 "distanceTravelled": 2.1,
6 "travelDuration": 12,
7 "dropTime": "2026-08-27T08:30:00.000Z",
8 "metadata": {
9 "partnerOrderId": "DMRC-ORDER-1001"
10 }
11}

Fields

FieldTypeDescription
orderIdstringOrder id from create order
statusstringStatus value from the table above
metadataobjectPresent when sent on create order
otpstringRide OTP, when applicable
etanumberETA in minutes, when applicable
captainDetailsobjectPartner details when available
locationobjectOptional coordinates on some status events
amountnumberFare amount when applicable
reasonstringReason for cancel / expiry when applicable
distanceTravellednumberWhen available
travelDurationnumberWhen available
dropTimestringCompletion time when available

captainDetails shape:

1{
2 "name": "Priya",
3 "mobile": "9888888888",
4 "currentVehicle": {
5 "number": "DL1SAA0001"
6 }
7}

Case B — Location update

Sent when partner location is updated for an active ride.

Identify this case when status is location_updated.

Example

1{
2 "orderId": "1717235676225158",
3 "status": "location_updated",
4 "location": {
5 "latitude": 28.46102,
6 "longitude": 77.07411
7 },
8 "timestamp": 1756281000000,
9 "metadata": {
10 "partnerOrderId": "DMRC-ORDER-1001"
11 }
12}

Fields

FieldTypeRequiredDescription
orderIdstringyesOrder id
statusstringyesAlways location_updated
location.latitudenumberyesPartner latitude
location.longitudenumberyesPartner longitude
timestampnumbernoEvent timestamp
metadataobjectnoFrom create order when present

Handling both cases

if status == "location_updated":
handle location update
else:
handle ride status update

Headers sent by Fery

1Content-Type: application/json
2secretkey: <WEBHOOK_SECRET>