Webhooks
Explanation of the JSON Webhook Data Structure
The provided JSON payload represents the structure of a webhook callback for delivery updates. Each component serves a distinct purpose, ensuring that delivery details, pricing, contacts, and tracking information are communicated efficiently. Here's a breakdown of the content without specific values:
Root-Level Fields:
success
: A boolean value indicating whether the webhook call was successful. Typically, this istrue
if no errors occurred in the process.code
: Represents the HTTP status code, such as200
, confirming the server's response status.message
: A descriptive string providing context for the webhook, such as a title or explanation of the callback event.responses
: This is the main payload object or array containing all relevant delivery details.
Pickup Information (pickup
):
value
: Represents a unique identifier or description of the pickup location.country_code
: A two-letter ISO code representing the country of the pickup point.lat
&lng
: The geographic latitude and longitude of the pickup location for mapping and geolocation purposes.type
: Specifies the type of location, such as coordinates (LATLNG
) or a named address.location
: A textual representation of the pickup address or area.contact
: An object detailing the individual associated with the pickup:name
: Full name of the contact person.mobile
: Phone number for communication.email
: Email address, if available.
Dropoff Information (dropoff
):
Similar to
pickup
, this section describes the destination details:Includes location data (
lat
,lng
,type
, etc.) and the contact's information (name, mobile, email).
Pricing Details (full_price
):
discount
: The amount of any applied discount.value
: The total delivery cost after discounts.currency_code
: A three-letter ISO currency code (e.g., GHS for Ghanaian Cedis).currency_symbol
¤cy_name
: Visual and textual representations of the currency.
Contact Information (contact
):
Contains the primary contact details for the delivery:
name
,mobile
,email
: Reflects the sender or recipient’s information.
Delivery Metadata:
return_delivery
: A boolean indicating whether this is a return delivery.return_reason
: A reason for the return, if applicable.distance
: The total delivery distance, often used for pricing calculations.individual_pricing_id
: A unique identifier for the pricing structure applied to this delivery.timestamp
: A Unix epoch timestamp recording the event time.status
: Current state of the delivery (e.g., pending, assigned, completed).instructions
: Any special instructions related to the delivery.reference
: A unique identifier for referencing the delivery.start_time
&end_time
: Define the delivery time window in Unix epoch format.time_completed
: Indicates the exact completion time, if applicable.
Item Details (items
):
An array containing objects that describe each item in the delivery:
itemName
: Name of the item being delivered.itemIcon
: A URL linking to an icon representing the item.itemQuantity
: Number of units of the item.itemCost
&itemPrice
: Base and transactional prices.currency_code
: ISO code for the item's currency.description
: Detailed description of the item.itemWeight
: Weight of the item, often used for logistics.dimensions
: The physical dimensions (length, width, height).itemImages
: URLs linking to item images.
Tracking and Delivery Codes:
tracking_code
: A unique code used to track the delivery.delivery_code
: Code specific to the delivery for backend referencing.secret_code
: Used for secure verification at the dropoff point.
Agent Details (agent_details
):
agent_email
&agent_mobile
: Contact details of the assigned delivery agent.agent_picture
: URL linking to the agent’s profile picture.agent_first_name
&agent_last_name
: The agent's full name.
Agency Details (agency_details
):
name
: Name of the agency handling the delivery.logo
: A URL linking to the agency's logo.mobile_number
&email
: Contact details of the agency.
Additional Links:
tracking_link
: URL for the customer to track the delivery status.waybill_link
: URL to access the delivery waybill, containing formal documentation.
This structure ensures that all critical aspects of the delivery process are captured and communicated effectively, allowing for seamless integration and real-time updates.
NOTE: Agent Details are only available when a rider is assigned to the delivery and that is delivery status assigned,pickup, pickedup, dropoff, droppedoff,ended
Last updated
Was this helpful?