Booking API
Create a new hotel booking.
Endpointβ
POST https://mg.mescogo.com/gw/api/booking/book
| Property | Value |
|---|---|
| URI | /api/booking/book |
| Method | POST |
| Content-Type | application/json |
Request Parametersβ
Note: RoomBookingCodes must contain exactly one booking code.
| Parameter | Type | Description |
|---|---|---|
RoomBookingCodes | guid list | Exactly one booking code for the room you want to book |
CustomerDetails | object list | Customer information |
ClientReferenceId | string | API client system reference ID. Recommended for request/response correlation. |
BookingReferenceId | string | API client system booking, PNR, order, or reservation reference. Can be empty if not applicable. |
TotalFare | decimal | Total price to be charged |
EmailId | string | Email id of the first person in the customer list |
PhoneNumber | string | Required. Must be a valid phone number and max 20 characters. |
BookingType | string | Fixed booking mode. Send Voucher. This is the only supported value and indicates a confirmed booking/voucher flow. |
PaymentMode | string | Limit or NewCard. Default is Limit |
PaymentInfo | object | Customer payment info (required if PaymentMode is NewCard) |
BillingAmount | decimal | Total amount to bill (should match booking total) |
BillingCurrency | string | Required 3-character ISO currency code. |
CardHolderAddress | object | Customer card address (required if PaymentMode is NewCard) |
Reference Identifiers Noteβ
ClientReferenceId and BookingReferenceId are optional API client-supplied reference values. They are not generated by MG.
- ClientReferenceId: API client system value recommended for request/response correlation. If provided, the same value is returned in the success response.
- BookingReferenceId: API client system reservation, order, PNR, booking, or reference number. Use it when a separate reference is available. Note: Neither value currently claims persistence or idempotency.
How To Populate These Fieldsβ
ClientReferenceIdshould identify the booking request on the API client system side.- Recommended values: request number, cart/order number, CRM correlation ID, or session-based booking attempt ID.
- Example values:
REQ-20260407-000123,ORDER-458921,B2B-WEB-90017. BookingReferenceIdcan be used when a reservation, order, PNR, or booking reference already exists in the API client system before calling MG.- If the final reservation number is created only after MG confirms the booking,
BookingReferenceIdcan be sent as an empty string. - These values are supplied in the request and cannot be fetched from MG endpoints in advance.
BookingTypeβ
BookingType is currently not a selectable option. The API expects Voucher for booking creation. Do not send other values.
PaymentMode Valuesβ
| Value | Description |
|---|---|
Limit | Pay with balance/credit limit |
NewCard | Pay with card |
Payment Notesβ
- To pay with balance/credit limit, send
PaymentMode = "Limit".PaymentInfoandCardHolderAddressare not required. - To pay with card, send
PaymentMode = "NewCard"with completePaymentInfoandCardHolderAddress. - If complete card information is sent, the request is processed as a card payment.
- Important: When balance/credit-limit payment is used, the API validates the available balance/credit limit before confirming the booking.
BillingAmountandTotalFareshould represent the same total amount
CustomerDetailsβ
| Parameter | Type | Description |
|---|---|---|
Title | string | Customer title |
FirstName | string | Customer firstname |
LastName | string | Customer last name |
BirthDate | datetime | Customer birthdate |
Type | string | Adult for adult guests, Child for child guests |
PaymentInfoβ
| Parameter | Type | Description |
|---|---|---|
CvvNumber | string | Customer card cvv number |
CardNumber | string | Customer card number |
CardExpirationMonth | string | Customer card expiration month |
CardExpirationYear | string | Customer card expiration year |
CardHolderFirstName | string | Customer card first name |
CardHolderLastName | string | Customer card last name |
CardHolderAddressβ
| Parameter | Type | Description |
|---|---|---|
AddressLine1 | string | Address 1 |
AddressLine2 | string | Address 2 |
City | string | Customer city |
PostalCode | string | Customer postal code |
CountryCode | string | Customer country code |
Example Requestsβ
Example Request - Balance Paymentβ
{
"RoomBookingCodes": ["<room-booking-guid>"],
"CustomerDetails": [
{
"Title": "<customer-title>",
"FirstName": "<customer-first-name>",
"LastName": "<customer-last-name>",
"BirthDate": "<customer-birthdate>",
"Type": "<customer-type>"
}
],
"ClientReferenceId": "REQ-10023",
"BookingReferenceId": "BKG-99482",
"TotalFare": 100.0,
"EmailId": "<email-id>",
"PhoneNumber": "<phone-number>",
"BookingType": "Voucher",
"PaymentMode": "Limit",
"BillingAmount": 100.0,
"BillingCurrency": "<billing-currency>"
}
Example Request - Card Paymentβ
{
"RoomBookingCodes": ["<room-booking-guid>"],
"CustomerDetails": [
{
"Title": "<customer-title>",
"FirstName": "<customer-first-name>",
"LastName": "<customer-last-name>",
"BirthDate": "<customer-birthdate>",
"Type": "<customer-type>"
}
],
"ClientReferenceId": "REQ-10023",
"BookingReferenceId": "BKG-99482",
"TotalFare": 100.0,
"EmailId": "<email-id>",
"PhoneNumber": "<phone-number>",
"BookingType": "Voucher",
"PaymentMode": "NewCard",
"BillingAmount": 100.0,
"BillingCurrency": "<billing-currency>",
"PaymentInfo": {
"CvvNumber": "<cvv-number>",
"CardNumber": "<card-number>",
"CardExpirationMonth": "<card-expiration-month>",
"CardExpirationYear": "<card-expiration-year>",
"CardHolderFirstName": "<card-holder-first-name>",
"CardHolderLastName": "<card-holder-last-name>"
},
"CardHolderAddress": {
"AddressLine1": "<address-line-1>",
"AddressLine2": "<address-line-2>",
"City": "<city>",
"PostalCode": "<postal-code>",
"CountryCode": "<country-code>"
}
}
Success Responseβ
{
"Status": {
"Code": 200,
"Description": "Successful"
},
"ClientReferenceId": "REQ-10023",
"ConfirmationNumber": "1531561"
}
Error Casesβ
Business validation errors return a Status object.
Payment Information Not Foundβ
{
"Status": {
"Code": 404,
"Description": "Payment Information Not Found"
}
}
Insufficient Account Balanceβ
{
"Status": {
"Code": 404,
"Description": "Insufficient account balance"
}
}
Account Not Foundβ
{
"Status": {
"Code": 404,
"Description": "Account Not Found"
}
}
Processing Errorβ
{
"StatusCode": 500,
"Reason": "<reason-phrase>",
"Error": "<error-message>",
"ErrorDetails": "<serialized-error-details>"
}