The InstaLeap Job Tracking Webhook provides a simple way to track all the changes of the jobs you created. Remember that a webhook works like a reverse API and you would have to provide a POST URL in which our systems are going to notify the changes.
Why?
In some steps of the fulfillment process, InstaLeap and your systems would need to communicate and react to certain changes. For example, to confirm the payment of the order and unblock a picker.
You can add up to 3 Webhooks to receive Job Notifications.
Events
Events are composed by type (take a look at the request payload), id, and job.
Event types
InstaLeap webhooks events have different types, that allow you to identify why the job has changed. They are also differentiated by category. The possible categories and their event types are:
Job-level events
-
CREATED
-
CANCELLED
-
RESCHEDULED
-
REFUSED
-
ALLOCATED
-
RE_ALLOCATED
-
EXTERNAL_DATA_UPDATED
-
STORE_CHANGED
-
JOB_COMMENT_UPDATED
Picking process
-
ITEMS_UPDATED
-
PACKAGES_CREATED
-
PACKAGES_UPDATED
Invoicing process
-
INVOICE_UPDATED
-
PRICES_UPDATED
-
PAYMENT_UPDATED
Steps & Tasks
Steps
-
GOING_TO_ORIGIN_STARTED
-
ARRIVED_TO_ORIGIN
-
PICKING_STARTED
-
PICKING_FINISHED
-
CHECKING_OUT_STARTED
-
CHECKED_OUT
-
TRANSFERRING_STARTED
-
TRANSFERRED
-
GOING_TO_DESTINATION_STARTED
-
ARRIVED_TO_DESTINATION
-
DELIVERING_STARTED
-
CLIENT_RECEIVED
-
STORING_STARTED
-
STORING_UPDATED
-
STORING_FINISHED
Zone Picking Steps:
-
ZONE_PICKING_STARTED
-
ZONE_PICKING_FINISHED
-
PARKING_STARTED
-
PARKING_FINISHED
Consolidation Steps:
-
PICKING_STARTED
-
PICKING_FINISHED
-
CHECKING_OUT_STARTED
-
CHECKED_OUT
-
STORING_STARTED
-
STORING_FINISHED
Tasks
PICKING
DELIVERY
FULL_SERVICE
STORAGE
PICKING_WITH_STORAGE
PICK_UP
DELIVERY_WITH_STORAGE
PICK_UP_FOR_DELIVERY
PICKING_AND_STORAGE
ZONE_PICKING
CONSOLIDATION
Tasks resets per operational models
-
Full Service
TASK_RESET_FULL_SERVICE -
Pick & Collect
TASK_RESET_PICK_UP
TASK_RESET_PICKING_WITH_STORAGE -
Pick & Collect no transfer
TASK_RESET_PICKING_AND_STORAGE
TASK_RESET_PICK_UP -
Pick & Delivery
TASK_RESET_PICKING
TASK_RESET_DELIVERY -
Pick & Delivery with storage
TASK_RESET_PICKING_WITH_STORAGE
TASK_RESET_STORAGE
TASK_RESET_PICK_UP_FOR_DELIVERY
TASK_RESET_DELIVERY_WITH_STORAGE -
Pick & Delivery with storage no transfer
TASK_RESET_PICKING_AND_STORAGE
TASK_RESET_PICK_UP_FOR_DELIVERY
TASK_RESET_DELIVERY_WITH_STORAGE
Authentication
In order to protect your systems from external attacks, InstaLeap signs the webhook events it sends to your endpoints. We do so by including a signature in each event’s InstaLeap-Signature
header. We have different security options that you can select to recognize where the events come from:
Where Instaleap implement this auth?
The same auth type is going to be used for the following modules:
Status Webhooks events
Chat Webhooks
Replacements Search
Stock query
1. Security Instaleap signature:
This allows you to verify that the events were sent by InstaLeap, not by a third party. You can verify signatures using standard libraries such as crypto
for NodeJS. The hash algorithm used is SHA-256
and it is hashed with a secret provided to you by InstaLeap for each environment.
How to check the signature?
To verify that the InstaLeap-Signature
is valid, please follow these steps:
- Once you receive the request, create a string joining
id
,created_at
, andtype
by an&
character from the event payload. - Hash the string with the secret provided to you, using an SHA-256 algorithm.
- Compare the resulting hash with the
InstaLeap-Signature
header. - If the signature is correct, process the event in your system.
2. Static token:
To implement this type of authentication you should send two requirements:
Header:
The header name where you want us to send the auth token.Token:
The static token that you want us to send to your services to perform the auth.
3. DynamicToken:
To implement this type of authentication we need the below requirements:
RenewURL:
The URL where we should request new dynamic tokens.Credentials:
The credentials we should send to the renewURL to retrieve new dynamic tokens. This can be headers and body credentials depending on your auth server.formatOfCredentials:
The format in which we should send the credentials to the renewURL. It can be JSON or formData.Response:
The details of the response we will receive from auth server. The status code expected, the body expected, and the field name of the body where the dynamic token is located.
For DynamicToken we recommend you send us a Postman collection tested and work with his auth server to make things easier.
formatOfCredentials - DynamicToken
We only support these formats:
• JSON
• formData
• urlEncoded
Added by
Explains who added the item into the job. Usual values are
CLIENT
,PICKER
,ISSUE
,AGENT
, orCONTROL_TOWER
Job cancelled
CANCELLED
event has a field calledcancellationSource
and the options could beCUSTOMER
orCONTROL_TOWER
{
"clientId": "YINGYANG",
"created_at": "2022-06-01T15:38:26Z",
"id": "267c47d4-a767-4a90-bd1b-e2dkl28j8c03",
"job": {
"cancellationSource": null,
"client_reference": "EUDFM97HY",
"created_at": "2022-05-30T17:06:45.458Z",
"declared_value": 3194,
"delivery_code": "0000",
"destination": {
"address": "Calle 26 # 32-54",
"address_two": "",
"city": "Bog",
"country": "COL",
"description": "",
"latitude": 4.692281,
"longitude": -74.09083,
"name": "",
"state": "",
"zip_code": "0"
},
"externalData": {},
"id": "a7ec4fbc-070e-4b18-ac69-31ckld7329j671",
"issue_of": null,
"job_items": [
{
"added_by": "CLIENT",
"attributes": {
"category": "Aceites de Cocina",
"ean": "7502223770959",
"product_id": "598701",
"sku": "00750222377095"
},
"barcodes": [
"7502223770959"
],
"comment": "",
"found_quantity": 36,
"id": "00750222377095",
"is_substitute": false,
"name": "Aceite Capullo 100% puro de canola 845 ml",
"photo_url": "https://res.cloudinary.com/walmart-labs/image/upload/v1591796520/gr/images/product-images/img_large/00750222377095L.jpg",
"presentation": {
"dimensions": [],
"name": "Aceite Capullo 100% puro de canola 845 ml",
"price": 45,
"quantity": 1,
"unit": "pz",
"weight": 1
},
"quantity": 36,
"replacements": [],
"scannedBarcode": "",
"status": "ADDED"
},
{
"added_by": "CLIENT",
"attributes": {
"category": "Crema",
"ean": "7501055909537",
"product_id": "604880",
"sku": "00750105590953"
},
"barcodes": [
"7501055909537"
],
"comment": "",
"found_quantity": 6,
"id": "00750105590953",
"is_substitute": false,
"name": "Crema Alpura ácida regular 450 ml",
"photo_url": "https://res.cloudinary.com/walmart-labs/image/upload/v1591796520/gr/images/product-images/img_large/00750105590953L.jpg",
"presentation": {
"dimensions": [],
"name": "Crema Alpura ácida regular 450 ml",
"price": 27.85,
"quantity": 1,
"unit": "pz",
"weight": 1
},
"quantity": 6,
"replacements": [],
"scannedBarcode": "",
"status": "ADDED"
}
],
"operationalModel": "PICK_AND_DELIVERY",
"origin": {
"address": "Calle 45A Bis #21A-31",
"address_two": "",
"city": "Bog",
"country": "COL",
"description": "",
"latitude": 4.673374964693172,
"longitude": -74.06325497710803,
"name": "YinYang Store",
"state": "",
"store_reference": "4016",
"zip_code": ""
},
"original_prices": {
"discounts": 838.7,
"paymentValue": 3194,
"shippingFee": 0,
"subtotal": 4032.7,
"taxes": 0
},
"paymentInfo": {
"currency_code": "COP",
"invoice": null,
"payment": {
"blocking_policy": null,
"id": null,
"metadata": null,
"method": "CASH",
"method_details": null,
"payment_status": null,
"payment_status_details": null,
"reference": null,
"value": 0
},
"prices": {
"discounts": 838.7,
"order_value": 3194,
"shipping_fee": 0,
"subtotal": 4032.7,
"taxes": 0
}
},
"payment_method": "CASH",
"payment_value": 3194,
"recipient": {
"email": "[email protected]",
"identification": {
"encryptedData": "3qgrbCNdrtwetrwetYKoqLPGVpg==",
"iv": "lbAhwetrwecE7q4CO/xg=="
},
"name": "Maria Pepita",
"phone_number": "432534523"
},
"slot": {
"expires_at": "2022-05-30T17:21:34.617Z",
"from": "2022-06-01T15:00:00.000Z",
"id": "d2b5b748-aee9-450b-b88e-66c8b52faa09",
"to": "2022-06-01T15:59:00.000Z"
},
"status": "PROCESSING",
"tasks": [
{
"id": "47f30cf5-decb-4054-b04a-12W43345a0a",
"resource": {
"clientId": "YINGYANG",
"dni": "4016",
"email": "[email protected]",
"firstName": "Turno Apertura",
"fleetId": "Pickers",
"id": "d26a7bf2-88dc-4466-b8d9-15a6234532r6fd",
"lastName": "Picker",
"lastUpdatePosition": "2022-05-13T19:53:30.732Z",
"phoneNumber": "34523562",
"photoUrl": "https://instaleap.s3.amazonaws.com/user-placeholder.png",
"position": {
"latitude": 20.649218333,
"longitude": -87.06992
},
"vehicle": null
},
"resource_id": "d26a7bf2-88dc-4466-b8d9-15a67aa7bffd",
"status": "DOING",
"steps": [
{
"actualEnd": "2022-06-01T15:38:26.222Z",
"actualStart": "2022-06-01T14:28:23.404Z",
"id": "93836aae-3c29-4109-a7a7-0ea126ad7df1",
"optimalEnd": "2022-06-01T14:20:00.000Z",
"optimalStart": "2022-06-01T13:53:00.000Z",
"status": "DONE",
"type": "PICKING"
},
{
"actualEnd": "",
"actualStart": "2022-06-01T15:38:26.222Z",
"id": "2c6a5163-aaec-4844-b7a1-e1ef65415263",
"optimalEnd": "2022-06-01T14:35:00.000Z",
"optimalStart": "2022-06-01T14:20:00.000Z",
"status": "DOING",
"type": "CHECKING_OUT"
},
{
"actualEnd": "",
"actualStart": "",
"id": "33f9a224-e5c1-4ba0-ba49-2a624107e01f",
"optimalEnd": "2022-06-01T14:40:00.000Z",
"optimalStart": "2022-06-01T14:35:00.000Z",
"status": "PENDING",
"type": "TRANSFERRING_TO"
}
],
"type": "PICKING"
},
{
"id": "7321955c-12c4-44eb-88b3-9ee1879cf92e",
"resource": null,
"resource_id": null,
"status": "PROCESSING",
"steps": [
{
"actualEnd": "",
"actualStart": "",
"id": "1630481f-6b43-4bf4-8b11-d0089b147db8",
"optimalEnd": "2022-06-01T14:35:00.000Z",
"optimalStart": "2022-06-01T14:15:00.000Z",
"status": "PENDING",
"type": "GOING_TO_ORIGIN"
},
{
"actualEnd": "",
"actualStart": "",
"id": "5cf7df93-7808-4f20-be54-bd55863788b0",
"optimalEnd": "2022-06-01T14:40:00.000Z",
"optimalStart": "2022-06-01T14:35:00.000Z",
"status": "PENDING",
"type": "TRANSFERRING_FROM"
},
{
"actualEnd": "",
"actualStart": "",
"id": "540b9a6f-55b0-42b5-9ab2-79b7fc2f1f09",
"optimalEnd": "2022-06-01T14:52:00.000Z",
"optimalStart": "2022-06-01T14:40:00.000Z",
"status": "PENDING",
"type": "GOING_TO_DESTINATION"
},
{
"actualEnd": "",
"actualStart": "",
"id": "0001f309-6c2b-45dd-b02d-05fd0269a21b",
"optimalEnd": "2022-06-01T14:57:00.000Z",
"optimalStart": "2022-06-01T14:52:00.000Z",
"status": "PENDING",
"type": "DELIVERING"
}
],
"type": "DELIVERY"
}
],
"updated_prices": {
"discounts": 838.7,
"paymentValue": 3194,
"shippingFee": 0,
"subtotal": 4032.7,
"taxes": 0
},
"volume": 0,
"weight": 0
},
"type": "PICKING_FINISHED"
}