{"_id":"543f0b3e15d05608005027ee","project":"543005c87d487022005b3fa8","parentDoc":null,"category":{"_id":"543ee0c055bb1008000955b6","__v":21,"pages":["543ee1d615d0560800502749","543ee5c015d0560800502758","543ee87715d0560800502763","543ee9e315d056080050276c","543f003c55bb100800095624","543f030555bb10080009563f","543f0b3e15d05608005027ee","543f0d0755bb10080009566d","543f0e8415d056080050281b","543f0f8f55bb10080009567e","543f109055bb100800095689","543f11d315d056080050282b","543f15c615d0560800502845","544aec7fa761f90800c41d32","545a7fae1d018b1400227eff","545e9dc97e32310e00f400ca","5603c5dde416560d00fa63ad","564ed2eb9209cf0d001d6917","56cb2acb245b841300806ea4","56e05f414685db1700d9480b","56e063e4f97d422900d639bf"],"project":"543005c87d487022005b3fa8","version":"543005c87d487022005b3fab","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-15T21:01:52.185Z","from_sync":false,"order":1,"slug":"iwebcab-api-tools","title":"Gazoop Internal API"},"githubsync":"","is_link":false,"user":"543005a67d487022005b3fa7","__v":7,"editedParams":true,"editedParams2":true,"version":{"_id":"543005c87d487022005b3fab","__v":6,"project":"543005c87d487022005b3fa8","createdAt":"2014-10-04T14:35:52.362Z","releaseDate":"2014-10-04T14:35:52.362Z","categories":["543005c87d487022005b3fac","54345156edce04080040964e","543ee0c055bb1008000955b6","54c82a78ab706219009e0656","57390d0e1f4b740e00b06cb2","5741d5ab28f5fb0e0063ed36"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-16T00:03:10.923Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","try":true,"basic_auth":false,"results":{"codes":[{"name":"Success","code":"{\n    \"result\": \"valid\",\n \t\t\"job_id\": \"12345\"\n}","language":"json"},{"name":"Failure","code":"{\n    \"result\": \"error\",\n\t  \"error\": \"Reason for error\"\n}","language":"json"}]},"settings":"","auth":"never","params":[{"_id":"543f0b3e15d0560800502805","ref":"","in":"body","required":true,"desc":"This is a 25 alphanumeric hash code provided to you by the fleet.","default":"","type":"string","name":"api_key"},{"_id":"543f0b3e15d0560800502804","ref":"","in":"body","required":true,"desc":"This is the mobile number for the customer account.","default":"","type":"int","name":"phone_number"},{"_id":"543f0b3e15d0560800502802","ref":"","in":"body","required":false,"desc":"You can also send the customers PIN number for verification, if this fails, the API command will fail. If left blank, no validation is done on the authenticity of the customer ID.","default":"","type":"int","name":"customer_pin"},{"_id":"5741d50b91fd8d0e00713ba6","ref":"","in":"body","required":false,"desc":"If you would like to retrieve the data stored from a quote request, put in the ID number for it here. You can override any data stored with new data by entering the appropriate fields again below.","default":"","type":"int","name":"quote_id"},{"_id":"543f0b3e15d0560800502801","ref":"","in":"body","required":false,"desc":"This should contain the lead passengers name or reference.","default":"","type":"string","name":"passenger_name"},{"_id":"543f0b3e15d0560800502800","ref":"","in":"body","required":false,"desc":"This should contain a mobile or landline number in international format for the lead passenger. (IE: in the UK: 447780123456 and in the US: 15468875544). The default is the PHONE_NUMBER value sent in the user parameters.","default":"","type":"int","name":"passenger_phone_number"},{"_id":"543f0b3e15d05608005027ff","ref":"","in":"body","required":false,"desc":"This should contain the total number of passengers. It is important to provide this value when more than 4 passengers are required as this will limit the type of vehicles that will receive this job. The default value is 1.","default":"1","type":"int","name":"passenger_total"},{"_id":"543f0b3e15d05608005027fe","ref":"","in":"body","required":false,"desc":"This should contain the total number of cases required as part of the booking so that an appropriate vehicle is sent. Please consider larger items such as golf clubs as 2 cases. The default value is 0.","default":"0","type":"int","name":"cases_total"},{"_id":"543f0b3e15d05608005027fd","ref":"","in":"body","required":false,"desc":"This should contain the full pick-up text with no line breaks. Please ensure each section of the address is separated by a comma. For example, you would send: 13 Down Town, London, SW13 9KD, UK If the address contains a POI (Point-of-interest), you can place this at the start by including it within brackets. For example: (Coffee Cafe) 13 Down Town, London, SW13 9KD, UK","default":"","type":"string","name":"pickup_address"},{"_id":"543f0b3e15d05608005027fc","ref":"","in":"body","required":false,"desc":"Latitude of the pick-up location in Decimal Degrees only. Do not use commas as decimals. For example: 51.507323","default":"","type":"double","name":"pickup_lat"},{"_id":"543f0b3e15d05608005027fb","ref":"","in":"body","required":false,"desc":"Longitude of the pick-up location in Decimal Degrees only. Do not use commas as decimals. For example: -0.127754","default":"","type":"double","name":"pickup_long"},{"_id":"543f0b3e15d05608005027fa","ref":"","in":"body","required":false,"desc":"If the booking is a pick-up at an airport, please provide the flight number in this field including the airline code. For example: ZB734","default":"","type":"string","name":"pickup_flight"},{"_id":"543f0b3e15d05608005027f9","ref":"","in":"body","required":false,"desc":"This should contain the full drop-off text with no line breaks. Please ensure each section of the address is separated by a comma. For example, you would send: 13 Down Town, London, SW13 9KD, UK If the address contains a POI (Point-of-interest), you can place this at the start by including it within brackets. For example: (Coffee Cafe) 13 Down Town, London, SW13 9KD, UK","default":"","type":"string","name":"dropoff_address"},{"_id":"543f0b3e15d05608005027f8","ref":"","in":"body","required":false,"desc":"Latitude of the drop-off location in Decimal Degrees only. Do not use commas as decimals. For example: 51.507323","default":"","type":"double","name":"dropoff_lat"},{"_id":"543f0b3e15d05608005027f7","ref":"","in":"body","required":false,"desc":"Longitude of the drop-off location in Decimal Degrees only. Do not use commas as decimals. For example: 51.507323","default":"","type":"double","name":"dropoff_long"},{"_id":"543f0b3e15d05608005027f6","ref":"","in":"body","required":false,"desc":"If the booking is a drop-off at an airport, please provide the flight number in this field including the airline code. For example: ZB734","default":"","type":"string","name":"dropoff_flight"},{"_id":"543f0b3e15d05608005027f5","ref":"","in":"body","required":false,"desc":"This should be a multidimensional JSON object with the following elements in each child array. Please look further down the page for what each object within the viapoints array should include.","default":"","type":"array_mixed","name":"viapoints"},{"_id":"543f0b3e15d05608005027f4","ref":"","in":"body","required":false,"desc":"If you have already routed this journey and wish to use your own distance data please provide this value here in miles.","default":"","type":"int","name":"distance"},{"_id":"543f0b3e15d05608005027f3","ref":"","in":"body","required":false,"desc":"If you have already routed this journey and wish to use your own time duration data please provide this value here in minutes.","default":"","type":"int","name":"duration"},{"_id":"543f0b3e15d05608005027f2","ref":"","in":"body","required":false,"desc":"Depending if the fleet operator has enabled this option this value lets you pre-define the set price rate for this booking. The fleet operator and driver still maintains the ability to modify this.","default":"","type":"double","name":"cost"},{"_id":"543f0b3e15d05608005027f1","ref":"","in":"body","required":false,"desc":"This should include any important notes regarding the booking. This will display on the fleet operators booking information screen, and also at the very top in bold on the drivers tablet/mobile device.","default":"","type":"string","name":"notes"},{"_id":"543f0b3e15d05608005027f0","ref":"","in":"body","required":false,"desc":"This is the vehicle preference for the booking. Please seek \"vehicle_types\" API for valid vehicle types to use.","default":"NA","type":"string","name":"vehicle_preference"},{"_id":"543f0b3e15d05608005027ef","ref":"","in":"body","required":false,"desc":"This should contain the date and time of the booking pickup. You must supply this using a valid date and time format as detailed here: http://uk3.php.net/manual/en/datetime.formats.php If however the booking is for now, you can either send the current date/time, or send the value NOW. This default value is NOW.","default":"NOW","type":"datetime","name":"pickup_time"},{"_id":"56cb21b70549f0130068de51","ref":"","in":"body","required":false,"desc":"This should contain the customers requested payment method. The driver can still adjust this in their mobile application, however this will be the default option when closing out the job. This should either be CASH, CREDITCARD, or ACCOUNT","default":"CASH","type":"string","name":"payment_method"},{"_id":"5741d59228f5fb0e0063ed34","ref":"","in":"body","required":false,"desc":"If this is set to Y, the fleet must mark this booking as accepted within 24 hours, if it is not confirmed within 24 hours, the booking will automatically be deleted from their system..","default":"N","type":"string","name":"require_confirmation"},{"_id":"5741d59228f5fb0e0063ed33","ref":"","in":"body","required":false,"desc":"This is a webhook URL for all status and action changes. For more information about the data sent in a webhook please seek the webhook section on the bottom left of the menu.","default":"","type":"string","name":"webhook"}],"url":"/create_booking.json"},"isReference":false,"order":11,"body":"When placing a booking you will receive a booking reference number which can be used to both track and manage the booking. It is important that you log this information when received. Additionally, when booking an instant job there is a 15 to 30 second delay before the job is sent to a driver when the fleet operator is using GPS Dispatch, which allows time for cancellation and/or testing before a driver gets receipt of the booking.\n\nWhen processing an API booking the system ignores any default booking SMS/Email triggers. However, beyond the booking if SMS is set up for any other feature, for example, driver allocation, approaching location, cancellation, delays etc, these will still be sent to the customer. If you do not wish for these messages to be sent we suggest disabling these options with the fleet operator.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Via Points\"\n}\n[/block]\nVia Points must be provided in the following format for each array object.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"text\",\n    \"0-1\": \"This should contain the full via-point address text. Seek PICKUP_ADDRESS for formatting information.\",\n    \"1-0\": \"lat\",\n    \"1-1\": \"Via-point Latitude. Seek PICKUP_LAT for formatting information.\",\n    \"2-0\": \"long\",\n    \"2-1\": \"Via-point Longitude. Seek PICKUP_LONG for formatting information.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]","excerpt":"This tool creates a brand new booking for the customer.","slug":"create_booking","type":"endpoint","title":"create_booking"}

postcreate_booking

This tool creates a brand new booking for the customer.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

api_key:
required
string
This is a 25 alphanumeric hash code provided to you by the fleet.
phone_number:
required
integer
This is the mobile number for the customer account.
customer_pin:
integer
You can also send the customers PIN number for verification, if this fails, the API command will fail. If left blank, no validation is done on the authenticity of the customer ID.
quote_id:
integer
If you would like to retrieve the data stored from a quote request, put in the ID number for it here. You can override any data stored with new data by entering the appropriate fields again below.
passenger_name:
string
This should contain the lead passengers name or reference.
passenger_phone_number:
integer
This should contain a mobile or landline number in international format for the lead passenger. (IE: in the UK: 447780123456 and in the US: 15468875544). The default is the PHONE_NUMBER value sent in the user parameters.
passenger_total:
integer1
This should contain the total number of passengers. It is important to provide this value when more than 4 passengers are required as this will limit the type of vehicles that will receive this job. The default value is 1.
cases_total:
integer0
This should contain the total number of cases required as part of the booking so that an appropriate vehicle is sent. Please consider larger items such as golf clubs as 2 cases. The default value is 0.
pickup_address:
string
This should contain the full pick-up text with no line breaks. Please ensure each section of the address is separated by a comma. For example, you would send: 13 Down Town, London, SW13 9KD, UK If the address contains a POI (Point-of-interest), you can place this at the start by including it within brackets. For example: (Coffee Cafe) 13 Down Town, London, SW13 9KD, UK
pickup_lat:
double
Latitude of the pick-up location in Decimal Degrees only. Do not use commas as decimals. For example: 51.507323
pickup_long:
double
Longitude of the pick-up location in Decimal Degrees only. Do not use commas as decimals. For example: -0.127754
pickup_flight:
string
If the booking is a pick-up at an airport, please provide the flight number in this field including the airline code. For example: ZB734
dropoff_address:
string
This should contain the full drop-off text with no line breaks. Please ensure each section of the address is separated by a comma. For example, you would send: 13 Down Town, London, SW13 9KD, UK If the address contains a POI (Point-of-interest), you can place this at the start by including it within brackets. For example: (Coffee Cafe) 13 Down Town, London, SW13 9KD, UK
dropoff_lat:
double
Latitude of the drop-off location in Decimal Degrees only. Do not use commas as decimals. For example: 51.507323
dropoff_long:
double
Longitude of the drop-off location in Decimal Degrees only. Do not use commas as decimals. For example: 51.507323
dropoff_flight:
string
If the booking is a drop-off at an airport, please provide the flight number in this field including the airline code. For example: ZB734
viapoints:
array of mixed
This should be a multidimensional JSON object with the following elements in each child array. Please look further down the page for what each object within the viapoints array should include.
distance:
integer
If you have already routed this journey and wish to use your own distance data please provide this value here in miles.
duration:
integer
If you have already routed this journey and wish to use your own time duration data please provide this value here in minutes.
cost:
double
Depending if the fleet operator has enabled this option this value lets you pre-define the set price rate for this booking. The fleet operator and driver still maintains the ability to modify this.
notes:
string
This should include any important notes regarding the booking. This will display on the fleet operators booking information screen, and also at the very top in bold on the drivers tablet/mobile device.
vehicle_preference:
stringNA
This is the vehicle preference for the booking. Please seek "vehicle_types" API for valid vehicle types to use.
pickup_time:
datetimeNOW
This should contain the date and time of the booking pickup. You must supply this using a valid date and time format as detailed here: http://uk3.php.net/manual/en/datetime.formats.php If however the booking is for now, you can either send the current date/time, or send the value NOW. This default value is NOW.
payment_method:
stringCASH
This should contain the customers requested payment method. The driver can still adjust this in their mobile application, however this will be the default option when closing out the job. This should either be CASH, CREDITCARD, or ACCOUNT
require_confirmation:
stringN
If this is set to Y, the fleet must mark this booking as accepted within 24 hours, if it is not confirmed within 24 hours, the booking will automatically be deleted from their system..
webhook:
string
This is a webhook URL for all status and action changes. For more information about the data sent in a webhook please seek the webhook section on the bottom left of the menu.

Result Format


Documentation

When placing a booking you will receive a booking reference number which can be used to both track and manage the booking. It is important that you log this information when received. Additionally, when booking an instant job there is a 15 to 30 second delay before the job is sent to a driver when the fleet operator is using GPS Dispatch, which allows time for cancellation and/or testing before a driver gets receipt of the booking. When processing an API booking the system ignores any default booking SMS/Email triggers. However, beyond the booking if SMS is set up for any other feature, for example, driver allocation, approaching location, cancellation, delays etc, these will still be sent to the customer. If you do not wish for these messages to be sent we suggest disabling these options with the fleet operator. [block:api-header] { "type": "basic", "title": "Via Points" } [/block] Via Points must be provided in the following format for each array object. [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-0": "text", "0-1": "This should contain the full via-point address text. Seek PICKUP_ADDRESS for formatting information.", "1-0": "lat", "1-1": "Via-point Latitude. Seek PICKUP_LAT for formatting information.", "2-0": "long", "2-1": "Via-point Longitude. Seek PICKUP_LONG for formatting information." }, "cols": 2, "rows": 3 } [/block]

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}