Car Cancel Booking API

Guidance and examples for accessing the Car Cancel Booking API

The Car Cancel Booking API allows you to cancel an existing booking. It requires data that is only available at time of booking, so you will only be able to cancel trips that you have booked.

Endpoint

MethodEndpointPrerequisites*
PUThttps://apim.expedia.com/cars/bookings/[TripNumber]An active TripNumber from the Car Booking API.

Required Headers

Key:Expedia API key
Authorization:Expedia API Authorization String
Accept:application/vnd.exp-car.v3+json
User-Id:username@domain.com

The email address associated to the booking.
Partner-Transaction-Id:Partner TransactionID String

Example of Cancel Request

Request

https://apim.expedia.com/cars/bookings/1065756938

Cancel Body

Optional - only include if partner wants to store meta data about cancellation for later retrieval.

{
	"PartnerMetaData": {
		"SampleKey1": "SampleValue1",
		"SampleKey2": "SampleValue2"
	}
}

Cancel Response

{
    
    "TransactionId": "f06edfa3-27f4-44e6-838c-b8dd3d0a3210",
    "SupplierConfirmationNumber": "221542",
    "CancellationDateTime": "2021-07-20T22:01:00-0800",
    "TotalRefund": {
        "Value": "1487.12",
        "Currency": "USD"
    },
    "TotalPenalty": {
        "Value": "100.08",
        "Currency": "USD"
    },
     "DeepLinkUrls": {
        "WebItinRetrieve": {
            "Href": "https://www.expedia.com/1234567"
        },
        "ApiItinRetrieve": {
            "Accept": "application/vnd.exp-booking.v3+json",
            "Method": "Get",
            "Href": "https://apim.expedia.com/cars/bookings/12345"
        }
    }
}


Error Codes

Common Error Codes

HTTP Status CodeError CodeError Message
400UNKNOWN_PATHUnknown request path.
400INVALID_ACCEPT Accept is either missing or invalid. Please provide a correct Accept header as following: Accept:application/vnd.exp-<product>.<version>+<format> (product={car,flight,hotel},version={v3},format={json}).
400Only one Accept header is allowed.
400INVALID_PARTNER_TRANSACTION_ID Partner-Transaction-Id is missing.
400Only one Partner-Transaction-Id header is allowed.
400INVALID_CLIENT_KEY Invalid client key: XXX.
400Only one Key header is allowed.
400INVALID_USER_ID User-Id in http headers is missing or invalid. It must be a valid email.
400Only one User-Id header is allowed.
400INVALID_USER_CREDENTIALSUser credentials are either missing or invalid.
400ITINERARY_NOT_FOUNDThe itinerary was not found. Please provide valid user-id and tripNumber.
400BOOKING_NOT_FOUNDThe itinerary was not booked.
400BOOKING_ALREADY_CANCELEDThe booking was already canceled.
400BOOKING_CANNOT_BE_CANCELEDThe booking cannot be canceled.
400INVALID_PARTNER_META_DATAThe size of partner meta data exceeds the limit.
500CANCEL_APPLICATION_ERRORCancellation failed. Application Error.
500INVALID_CANCEL_CAR_RESERVATION_STATECancellation failed. The booking is currently being processed. Please try again later.
400CONFIRMATION_NUMBERS_NOT_FOUNDThe confirmation numbers are invalid.

Warning Codes

Common Warning Codes

CodeMessageDescription
UNSUPPORTED_PRODUCT_TYPEThis booking contains unsupported product types: xxx. Only product type Car is processed by our API. Please handle xxx separately.This warning is returned when booking with unsupported products.

API details

Here, you can explore the endpoint definitions for this API, then go to the API Explorer to try out all the XAP endpoints, download OpenAPI specs, or download our Postman collections. Testing with one or all of these options will give you an understanding of how the examples and schema definitions compare to the actual output.


Did you find this page helpful?
How can we improve this content?
Thank you for helping us improve!