Webhooks Events
Webhooks Events Overview
Webhooks play a pivotal role in keeping systems synchronized and responsive by allowing seamless communication between different components. In our system, various webhook events are utilized to capture and process crucial information regarding order management and system activities.
Order Management Events
order_new
This event marks the inception of a new order within the system. Think of it as the moment a seed is planted, initiating the lifecycle of an order. When a customer places an order, this event is triggered, capturing essential details such as customer information, order specifics, and initial status.
{
"_id": "65c6c54e21b45bc19452746c",
"isPickupAnywhere": false,
"isPaid": false,
"orderType": "DELIVERY",
"paymentMethod": {
"_id": "5c3fb8dcf894321699bcce55",
"active": true,
"name": "EFECTIVO",
"scope": "BOTH",
"__v": 0,
"code": "cash"
},
"customerDetails": {
"client": "LUIS ALBERTO",
"firstName": "LUIS ALBERTO",
"firstLastName": null,
"phoneNumber": {
"countryCode": "+52",
"isCellphone": true,
"extension": null,
"phone": "6645555555"
}
},
"businessUnit": {
"id": "6381122d58ecd8780b0b9eb0",
"code": "437298ed-1c72-48ce-a9d0-18e3a9a76cae",
"name": "JELP BU"
},
"movements": [
{
"driver": null,
"location": [
0,
0
],
"changedStatusDetail": null,
"status": "PENDING",
"createdAt": "2024-02-10T00:37:34.351Z"
}
],
"orderStep": "PENDING",
"totalAmount": 320,
"folio": "42AT8WT",
"publicId": "42at8wt",
"updatedAt": "2024-02-10T00:37:34.512Z",
"endedAt": null,
"appKey": null,
"createdAt": "2024-02-10T00:37:34.358Z",
"currencyType": "MXN",
"externalService": null,
"externalId": [],
"plaza": {
"name": "JELP PLAZA",
"timeZone": "America/Mexico_City",
"id": "6381122d58ecd8780b0b9eaa"
},
"cancelationReason": null,
"completedReason": null,
"branch": {
"name": "JELP HQ",
"publicId": "eb2f46c6-723b-4711-91ba-9a92d39cf051",
"address": {
"neighborhood": "DAVILA",
"cityName": "Tijuana",
"street": "Esteban Cantú",
"zipCode": "22044",
"exteriorNumber": "325",
"interiorNumber": null,
"location": [
-117.0230477996792,
32.51860984132695
],
"fullAddress": "Esteban Cantú 325, DAVILA, 22044, TIJUANA, BAJA CALIFORNIA",
"city": "TIJUANA"
},
"phoneNumber": {
"countryCode": "+52",
"phone": "6642182508"
},
"referenceId": "eb2f46c6-723b-4711-91ba-9a92d39cf051",
"timeZone": "America/Tijuana",
"isActive": true,
"id": "6381122f58ecd8780b0b9f4e",
"comment": null,
"externalId": []
},
"destiny": {
"address": "HACIENDA AGUA CALIENTE 11830, HACIENDA AGUA CALIENTE, 22030, TIJUANA, BAJA CALIFORNIA",
"street": "Hacienda Agua Caliente",
"exteriorNumber": "11830",
"zipCode": "22030",
"neighborhood": "HACIENDA AGUA CALIENTE",
"location": [
-116.99957665158998,
32.48857892784934
],
"latitude": 32.48857892784934,
"longitude": -116.99957665158998
},
"deliveryMan": null,
"comments": [
{
"type": "TEXT",
"origin": "Panel Administrador",
"content": {
"text": "Actualizó el estatus a Pendiente"
},
"createdAt": "2024-02-10T00:37:34.350Z"
}
],
"origin": {
"id": "5c2403c7d7fa3d134b5d880f",
"name": "SAD"
},
"note": null,
"shoppingCar": {
"prescriptionAction": "NONE",
"products": []
},
"paidWith": 320,
"scheduledDate": null,
"fileMedia": [],
"customData": null,
"trackingId": "42at8wt",
"provider": null,
"userGroup": null,
"userGroupName": null,
"userData": {
"_id": "5e1d1166d4a535244dba9392v",
"fullName": "LUIS DOMINGUEZ"
},
"tags": [],
"deliveryCode": null,
"productsQuantity": 0,
"checklistOrder": [],
"supplierVehicleType": "MOTORCYCLE",
"driverAssignedBy": "Sistema",
"thirdPartyService": {},
"thirdPartyServiceAssignments": [],
"whatsapp": null,
"workspaceData": {
"name": "Jelp",
"slug": "jelp",
"logo": "https://...",
"type": "enterprise"
}
}
folio_update (old version)
The folio_update event serves as a versatile workhorse, responding to a plethora of updates within the order. From status changes to comments, assignments, and reassignments, this webhook handles it all. It's akin to the Swiss Army knife of order management, adapting to various scenarios seamlessly.
{
"_id" : "65c6bf2721b45bc1944f443d",
"isPickupAnywhere" : false,
"isPaid" : false,
"orderType" : "DELIVERY",
"paymentMethod" : {
"_id" : "5c3fb8dcf894321699bcce55",
"active" : true,
"name" : "EFECTIVO",
"scope" : "BOTH",
"__v" : 0,
"code" : "cash"
},
"customerDetails" : {
"client" : "JOSUE USCANGA",
"firstName" : "JOSUE",
"firstLastName" : "USCANGA",
"phoneNumber" : {
"countryCode" : "+32",
"isCellphone" : true,
"phone" : "6645555555"
}
},
"businessUnit" : {
"id" : "63f3dbcdc5b1cbd7c4f6c765",
"code" : "HQ",
"name" : "HQ"
},
"movements" : [
{
"driver" : null,
"location" : [
0,
0
],
"changedStatusDetail" : null,
"status" : "PENDING",
"createdAt" : "2024-02-10T00:11:19.137Z"
}
],
"orderStep" : "PENDING",
"totalAmount" : 310,
"folio" : "42AQAQ6",
"publicId" : "2423419",
"updatedAt" : "2024-02-10T00:11:19.222Z",
"endedAt" : null,
"createdAt" : "2024-02-10T00:11:19.144Z",
"currencyType" : "MXN",
"externalService" : null,
"externalId" : [
{
"name" : null,
"reference" : null,
"origin" :null
}
],
"plaza" : {
"name" : "Tijuana",
"timeZone" : "America/Tijuana",
"id" : "63cb422de3a3033d040b8fcd2"
},
"cancelationReason" : null,
"completedReason" : null,
"branch" : {
"name" : "JELP HQ",
"publicId" : "JP_HQ",
"address" : {
"neighborhood" : "Davila",
"street" : "Blvd. Cuauthemoc",
"zipCode" : "22194",
"exteriorNumber" : "24-10",
"interiorNumber" : null,
"location" : [
-117.023285,
32.518692
],
"fullAddress" : "Blvd. Cuauthemoc Sur, Davila 22194, Tijuana, B.C"
},
"phoneNumber" : {
"countryCode" : "+32",
"phone" : "6645555555"
},
"referenceId" : "32d1q",
"timeZone" : "America/Tijuana",
"isActive" : true,
"id" : "63d06361233c951ff2c4bc4c",
"comment" : "",
"externalId" : [
{
"name" : "mensajeros",
"reference" : "647"
}
]
},
"destiny" : {
"neighborhood" : "Davila",
"street" : "Blvd. Cuauthemoc",
"zipCode" : "22194",
"exteriorNumber" : "24-10",
"interiorNumber" : null,
"location" : [
-117.023285,
32.518692
],
"fullAddress" : "Blvd. Cuauthemoc Sur, Davila 22194, Tijuana, B.C"
"latitude" : 32.518692,
"longitude" : -117.023285
},
"deliveryMan" : null,
"comments" : [
],
"origin" : {
"id" : "63d002c35b8b233b1b362ad8",
"name" : "system"
},
"note" : "",
"shoppingCar" : {
"prescriptionAction" : "NONE",
"products" : [
{
"discount" : 0,
"tax" : 0,
"makeInventoryCheck" : false,
"isReceipt" : false,
"references" : [ ],
"scannedQuantity" : 0,
"image" : null,
"isVisible" : true,
"sku" : "56h565",
"name" : "Chocolatina Gol Mini Choco Power X11G",
"price" : 90,
"quantity" : 1,
"total" : 90
},
{
"discount" : 0,
"tax" : 0,
"makeInventoryCheck" : false,
"isReceipt" : false,
"references" : [ ],
"scannedQuantity" : 0,
"image" : null,
"isVisible" : true,
"sku" : "443534gy32f",
"name" : "Cerveza Tecate 6 Pack Latax330 Ml",
"price" : 220,
"quantity" : 1,
"total" : 220
}
]
},
"paidWith" : 500,
"scheduledDate" : null,
"fileMedia" : [ ],
"customData" : null,
"trackingId" : "2423419",
"provider" : null,
"userGroup" : null,
"userGroupName" : null,
"userData" : null,
"tags" : [
"DELIVERY"
],
"deliveryCode" : "648",
"productsQuantity" : 6,
"checklistOrder" : [ ],
"supplierVehicleType" : "MOTORCYCLE",
"driverAssignedBy" : "Sistema",
"thirdPartyServiceAssignments" : [ ],
"whatsapp" : null,
"workspaceData" : {
"name" : "JELP",
"slug" : "jelp",
"logo" : "https://...",
"type" : "enterprise"
}
}
order_update
This event encompasses multiple variations, each tailored to specific occurrences within the order lifecycle. Whether it's assigning a driver, canceling or completing an order, updating status, leaving a comment, or tracking the order's progress, order_update is the linchpin tying together diverse actions and updates.
The events are :
- order_update:assign_driver
- order_update:complete_order
- order_update:cancel_order
- order_update:status_change
- order_update:comment
- order_update:decline_cancel_request
- order_update:tracking
Assign Driver
When a task is assigned to an external provider like Uber, Rappi, etc. The field phone inside driver will be a string if the provider shares this information, otherwise when attended by a driver of your own fleet or a partner fleet will be an object with phone and country code properties
{
"timestamp" : "2024-02-09T23:17:05.073Z",
"folio" : "AIEW902A",
"publicId" : "WS-019930",
"workspace" : "jelp",
"deliveryCode" : "224",
"status" : "PENDING",
"trackingId" : "2422949",
"driver" : {
"name" : "REPARTIDOR EXTERNO",
"location" : {
"lat" : 0,
"lon" : 0
},
"phone" : null,
"employeeCode" : "external_driver"
},
"provider" : "QUICK",
"driverAssignedBy" : "Sistema",
"queueName" : "assign_driver"
}
Cancel/Complete Order
{
"timestamp" : "2024-02-09T23:02:28.975Z",
"folio" : "AIEW902A",
"publicId" : "WS-019930",
"workspace" : "jelp",
"deliveryCode" : null,
"status" : "COMPLETED",
"location" : [
-2.92258,
43.2555654
],
"queueName" : "complete_order",
"endedReason": null //obj with _id|code|description|reference:CanceledReason|CompletedReason
}
Status update
{
"timestamp" : "2024-02-09T23:33:38.039Z",
"folio" : "AIEW902A",
"publicId" : "WS-019930",
"workspace" : "jelp",
"deliveryCode" : "421",
"status" : "TRANSIT",
"statusBranch" : "PENDING",
"endedReason": null //Could be present only in final statuses
}
Add Comment
{
comment: "I have contacted the client and is will arrive 10 minutes after",
timestamp: "2022-09-01T00:00:00.00Z",
folio: "AIEW902A",
publicId: "WS-019930",
workspace: "jelp"
}
Decline Cancel Request
{
status: "IN TRANSIT",
timestamp: "2022-09-01T00:00:00.00Z",
folio: "AIEW902A",
publicId: "WS-019930",
workspace: "jelp"
}
Tracking URL
{
trackingUrl: "https://...",
timestamp: "2022-09-01T00:00:00.00Z",
folio: "AIEW902A",
publicId: "WS-019930",
workspace: "jelp"
}
Updated 3 months ago