My favorites | Sign in
Project Home Downloads Wiki Issues
Search
for
delbooking_v2_1  
car2go API Documentation - Cancel booking
Updated Feb 6, 2012 by claus.na...@daimler.com

Cancel booking

This function provides cancellation of an existing booking. Currently only HTTP DELETE is allowed. Access to this function is restricted. See OAuth documentation for more details.

Access: protected
URL: https://www.car2go.com/api/v2.1/booking/bookingId
Method: DELETE

Parameters

Name Mandatory Description
bookingId true the identifier of the reservation to be canceled.
format false defines response format. Value "json" => JSON format, otherwise xml format is used
callback false defines JSONP (JSON with Padding) callback function used as wrapper
test false activates test mode if set to "1". See below for more details.

Request Examples

DELETE https://www.car2go.com/api/v2.1/booking/1234
DELETE https://www.car2go.com/api/v2.1/booking/8152

Response

The cancellation information of a booking consists of:

  • returnValue - see list of return codes below and return values for more details
  • cancelFeeExists - flag indicating if any cancel fee exists
  • cancelFee - the amount of the cancellation fee. Period is used as decimal separator.
  • cancelFeeCurrency - the currency of the cancellation fee

Response Examples

A XML response example of cancel booking request:

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <cancelBookingResponse xmlns="http://www.car2go.com/openapi/xmlschema">                          
     <returnValue>
         <code>0</code> 
         <description>Operation successful.</description> 
     </returnValue>
     <cancelBooking>
         <cancelFeeExists>true</cancelFeeExists> 
         <cancelFee>4.00</cancelFee> 
         <cancelFeeCurrency>EUR</cancelFeeCurrency> 
     </cancelBooking>
 </cancelBookingResponse>
 

A JSON example:

 {"cancelBooking":[{
   "cancelFee":"4.00",
   "cancelFeeCurrency":"EUR",
   "cancelFeeExists":true
 }],
 "returnValue":{
   "code":0,
   "description":"Operation successful."
 }}
 

TestMode

Deletion of a booking in test mode requires one of test booking ids to be passed.

Note: You won't be charged any cancellation fees even if the result says "cancelFeeExists=true"

Furthermore the deletion has no impact on the result of Get Bookings called in test mode.

Return Codes

The following return codes may occur:

Code Description Note
0 Operation successful.
2 UserId invalid.
6 Invalid url parameter provided.
11 Booking id invalid.

(c) 2010 car2go GmbH. All rights reserved. Generated 03.02.12 08:59


Sign in to add a comment
Powered by Google Project Hosting