Booking Cancel API
This method is used to cancel an existing booking.
π Endpointβ
POST https://mg.mescogo.com/gw/api/booking/cancel
| Property | Value |
|---|---|
| URI | BaseURL/api/booking/cancel |
| Method | POST |
| Content-Type | application/json |
π Request Parametersβ
| Parameter | Type | Description |
|---|---|---|
ConfirmationNumber | String | Confirmation number of the booking to be cancelled |
π Authorizationβ
This endpoint requires a Basic Authorization header, using the same API client credentials as the other booking endpoints.
π€ Example Requestβ
{
"ConfirmationNumber": "1531561"
}
π₯ Successful Responseβ
{
"Status": {
"Code": 200,
"Description": "Canceled"
},
"ConfirmationNumber": "1531561"
}
π₯ Response Parametersβ
| Parameter | Type | Description |
|---|---|---|
Status | Object | Response status |
Status.Code | Integer | API status code |
Status.Description | String | Success response description |
ConfirmationNumber | String | Confirmation number that was sent in the request |
β οΈ Error Casesβ
Processing Errorβ
When cancellation cannot be completed or an exception occurs, the API returns HTTP 200 with the payload below:
{
"StatusCode": 500,
"Message": "An error occurred during processing",
"Error": "An error occurred during processing"
}
Authorization Errorβ
When the Basic Authorization header is missing or invalid, the endpoint returns a status object:
{
"Status": {
"Code": 401,
"Description": "No Header in Authorization"
}
}
β οΈ Notesβ
- The success response does not include
CancellationStatus,CancellationCharge,RefundAmount, orCurrency. - Send the confirmation number exactly as returned by the booking response.
- Invalid API credentials return a
Statusobject with an error description, typically with HTTP 401 or 404 depending on the failure point.