Shipday sends order update events via webhook subscription. Updates are sent over HTTP POST requests.
3rd party system needs to provide an endpoint to receive webhooks.
Along with providing an endpoint 3rd party system can provide a token (max 32 character) to validate the webhook payload data. Validation token is sent in the webhook header data as “token”.
Following is the format of a webhook payload:
{
"timestamp": 1603568070000,
"event": "ORDER_ASSIGNED",
"order_status": "NOT_ACCEPTED",
"order": {
"id": 100071,
"order_number": "12",
"order_item": "[]",
"delivery_note": "",
"order_source": "NOT PROVIDED",
"auto_assignment_status": "NOT_ASSIGNED",
"parent_id": 0,
"order_sequence_number": 0,
"total_cost": 0,
"delivery_fee": 0,
"predefined_tip": 0,
"cash_tip": 0,
"discount_amount": 0,
"tax": 0,
"driving_duration": 1631365.2152700785,
"eta": "",
"driving_distance": 11419556.50689055,
"placement_time": 1603553152000,
"expected_pickup_time": 1603511100000,
"expected_delivery_time": 1603513500000,
"assigned_time": 1603553181000
},
"company": {
"id": 1199,
"name": "ABT",
"description": "N/A",
"address": "Portland, OR, USA",
"principal_area_id": 1189,
"order_acceptance_timeout": 600,
"average_speed_mps": 8,
"fixed_driver_fee": 5,
"order_activation_time_mins": 60,
"currency_code": 840,
"schedule_order_lead_time_sec": 259200,
"max_assigned_order": 10,
"routing": 0
},
"delivery_details": {
"id": 78814,
"name": "A",
"phone": "1",
"email": "",
"address": "Uttara, Dhaka, Bangladesh",
"formatted_address": "Uttara, Dhaka, Bangladesh",
"location": {
"lat": 23.8758547,
"lng": 90.3795438
}
},
"pickup_details": {
"name": "ABT",
"phone": "000000000000000",
"address": "Seattle, WA, USA",
"formatted_address": "Seattle, WA, USA",
"location": {
"lat": 47.6062095,
"lng": -122.3320708
}
},
"carrier": {
"id": 2501,
"name": "Maruf",
"phone": "0123456789",
"email": "[email protected]",
"status": "OFFLINE",
"current_order": -1,
"vehicle_description": ""
}
}
Attributes
timestamp Long Integer
timestamp of the event
event String
type of event, Indicates the event type. Possible value can be any of the following:
Possible enum values of 'event' |
---|
ORDER_ASSIGNED |
ORDER_ACCEPTED_AND_STARTED |
ORDER_ONTHEWAY |
ORDER_COMPLETED |
ORDER_FAILED |
order_status String
order status after the event, Indicates the current status of the order.
Possible enum values of 'order_status' |
---|
NOT_ACCEPTED |
STARTED |
PICKED_UP |
ALREADY_DELIVERED |
FAILED_DELIVERY |
order Object
Details of an order. It is a JSON object. It has the following format
Child attributes
id
Integer
Unique Order Id
order_number
String
Order number to identify the order form user side
provider
String
Name of the provider
order_item
Array
Order Items Array
delivery_note
String
Provided delivery note (if given)
order_source
String
Source of the order
auto_assignment_status
String
Auto assignment status of the order
parent_id
Integer
Parent id (if available)
order_sequence_number
String
Order Sequence number
total_cost
Double
Total Cost of order
delivery_fee
Double
Delivery Fee of order
predefined_tip
Double
Predefined Tip amount
cash_tip
Double
Cash tip amount
discount_amount
Double
Discount Amount
tax
Double
Tax amount
driving_duration
Integer
Driving time duration
eta
Long Integer
Estimated timestamp of product delivery in milliseconds
driving_distance
Integer
Driving Distance in meter
placement_time
Long Integer
Order placement timestamp in milliseconds
expected_pickup_time
Long Integer
Expected pickup timestamp in milliseconds
expected_delivery_time
Long Integer
Expected delivery timestamp in milliseconds
assigned_time
Long Integer
Time that the order was assigned (timestamp in milliseconds)
start_time
Long Integer
Starting time for the order (timestamp in milliseconds)
pickedup_time
Long Integer
Order pickup timestamp in milliseconds
arrived_time
Long Integer
Order arrival timestamp in milliseconds
company Object
Details of the company to which the order belongs. It is a JSON object. It has the following format:
Child attributes
id
Integer
Company Id
name
String
Company name
description
String
Company description
address
String
Company Address
principal_area_id
Integer
Principal are id
order_acceptance_timeout
Integer
Order Acceptance timeout
average_speed_mps
Integer
Average speed in meter per sec
fixed_driver_fee
Double
Fixed Driver Fee
order_activation_time_mins
Integer
Order activation time int minutes
currency_code
Integer
Currency code
schedule_order_lead_time_sec
Integer
Schedule order lead time in sec
max_assigned_order
Integer
maximum assigned orders
routing
Integer
Routing (if available)
country
Integer
Country code
admin_area
String
Admin area
routing_cost
String
Cost for the routing
delivery_details Object
Delivery Details data. It is a JSON object. It has the following format:
Child attributes
id
Integer
Delivery Id
name
String
Delivery name
phone
String
Delivery phone
String
Delivery email
address
String
Delivery address
formatted_address
String
Delivery address Formatted
pickup_details Object
Pickup Details data. It is a JSON object. It has the following format:
Child attributes
id
Integer
Pickup Id
name
String
Pickup name
phone
String
Pickup phone
String
Pickup email
address
String
Pickup address
formatted_address
String
Pickup address Formatted
carrier Object
Details of the driver/carrier (if assigned) of the order. It is a JSON object. It has the following format:
Child attributes
id
Integer
Carrier Id
name
String
Carrier name
phone
String
Carrier phone
String
Carrier email
status
String
Carrier status.
Possible enum values of 'status' |
---|
ONLINE |
OFFLINE |
current_order
Integer
Current order id
plate_number
String
Carrier plate number
vehicle_description
String
Carrier vehicle description