TransitQuote API Reference – Webhooks

The TransitQuote API features are available via a free plugin which is currently in beta and available on request.

This page documents the webhooks that are currently available, the events that trigger them and the data that is sent when the webhook is triggered.

Webhooks

Webhooks are used to send real time alerts when something happens on your website.

There are three alerts that you can use within apps outside of TransitQuote.

New Quote

Triggered when a customer enters two addresses in the booking form, a price quote is generated and displayed on screen.

The New Quote webhook will send the following data in json format to any URL that you register in the settings.

Data sent

  • event_type_id
  • event_name
  • data
    • event_name
    • quote
      • job_rate (Standard, Out Of Hours, Weekend, Holiday, Dispatch, Return)
      • distance_cost
      • time_cost
      • basic_cost
      • tax_cost
      • total
    • journey
      • locations (array of locations with fields as follows)
        • journey_order
        • unit_no
        • street_address
        • district
        • state
        • postal_code
        • country
        • contact_name
        • contact_phone
        • date (custom solutions only)
        • time (custom solutions only)
      • directions (raw Google Directions json)
      • distance (full distance in the selected distance unit)
      • hours (journey length in decimal hours)
    • options
      • Contains a list of all options in the dashboard which affect the price of the job

New Job

Triggered when the customer selects the Book Online or Pay Now (WooCommerce Payment) buttons which saves the job details in the database.

  • event_type_id
  • event_name
  • data
    • timestamp
    • id (numerical id of job)
    • job_ref (job reference formatted as per user settings)
    • recieved (date and time recieved)
    • delivery_time (date and time – can be used for pick up or delivery depending on settings)
    • job_status
      • id
      • name
    • payment_method
      • id
      • name
    • payment_status
      • id
      • name
    • customer
      • first_name
      • last_name
      • email
      • phone
      • wp_user_id
    • quote
      • job_rate (Standard, Out Of Hours, Weekend, Holiday, Dispatch, Return)
      • distance_cost
      • time_cost
      • set_amount
      • basic_cost
      • tax_cost
      • total
    • journey
      • locations (array of locations with fields as follows)
        • journey_order
        • unit_no
        • street_address
        • district
        • state
        • postal_code
        • country
        • contact_name
        • contact_phone
        • date (custom solutions only)
        • time (custom solutions only)
        • directions (raw Google Directions json)
    • options
      • Contains a list of all options in the dashboard which affect the price of the job

Job Updated

Triggered when:

  • An admin changes the job status in the dashboard
  • A driver uses TransitTeam to update the job status via the my job list page
  • The job status is updated via an app using the REST API

  • event_type_id
  • event_name
  • data
    • user (user who changed job status)
      • wp_user_id (WordPress user id)
      • username (wordpress username)
      • id (driver id in TransitTeam)
      • first_name (driver first name in TransitTeam)
      • last_name (driver last name in TransitTeam)
      • email (email address of driver or wp user that performed the update)
      • phone (contact no for driver or wp user that performed the update)
    • timestamp
    • id (numerical id of job)
    • job_ref (job reference formatted as per user settings)
    • recieved (date and time recieved)
    • delivery_time (date and time – can be used for pick up or delivery depending on settings)
    • job_status
      • id
      • name
    • payment_method
      • id
      • name
    • payment_status
      • id
      • name
    • customer
      • first_name
      • last_name
      • email
      • phone
      • wp_user_id
    • quote
      • job_rate (Standard, Out Of Hours, Weekend, Holiday, Dispatch, Return)
      • distance_cost
      • time_cost
      • set_amount
      • basic_cost
      • tax_cost
      • total
    • journey
      • locations (array of locations with fields as follows)
        • journey_order
        • unit_no
        • street_address
        • district
        • state
        • postal_code
        • country
        • contact_name
        • contact_phone
        • date (custom solutions only)
        • time (custom solutions only)
        • directions (raw Google Directions json)
    • options
      • Contains a list of all options in the dashboard which affect the price of the job