Skip to main content

Booking API

Create a new hotel booking.

Endpoint​

POST https://mg.mescogo.com/gw/api/booking/book
PropertyValue
URI/api/booking/book
MethodPOST
Content-Typeapplication/json

Request Parameters​

Note: RoomBookingCodes must contain exactly one booking code.

ParameterTypeDescription
RoomBookingCodesguid listExactly one booking code for the room you want to book
CustomerDetailsobject listCustomer information
ClientReferenceIdstringAPI client system reference ID. Recommended for request/response correlation.
BookingReferenceIdstringAPI client system booking, PNR, order, or reservation reference. Can be empty if not applicable.
TotalFaredecimalTotal price to be charged
EmailIdstringEmail id of the first person in the customer list
PhoneNumberstringRequired. Must be a valid phone number and max 20 characters.
BookingTypestringFixed booking mode. Send Voucher. This is the only supported value and indicates a confirmed booking/voucher flow.
PaymentModestringLimit or NewCard. Default is Limit
PaymentInfoobjectCustomer payment info (required if PaymentMode is NewCard)
BillingAmountdecimalTotal amount to bill (should match booking total)
BillingCurrencystringRequired 3-character ISO currency code.
CardHolderAddressobjectCustomer 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​

  • ClientReferenceId should 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.
  • BookingReferenceId can 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, BookingReferenceId can 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​

ValueDescription
LimitPay with balance/credit limit
NewCardPay with card

Payment Notes​

  • To pay with balance/credit limit, send PaymentMode = "Limit". PaymentInfo and CardHolderAddress are not required.
  • To pay with card, send PaymentMode = "NewCard" with complete PaymentInfo and CardHolderAddress.
  • 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.
  • BillingAmount and TotalFare should represent the same total amount

CustomerDetails​

ParameterTypeDescription
TitlestringCustomer title
FirstNamestringCustomer firstname
LastNamestringCustomer last name
BirthDatedatetimeCustomer birthdate
TypestringAdult for adult guests, Child for child guests

PaymentInfo​

ParameterTypeDescription
CvvNumberstringCustomer card cvv number
CardNumberstringCustomer card number
CardExpirationMonthstringCustomer card expiration month
CardExpirationYearstringCustomer card expiration year
CardHolderFirstNamestringCustomer card first name
CardHolderLastNamestringCustomer card last name

CardHolderAddress​

ParameterTypeDescription
AddressLine1stringAddress 1
AddressLine2stringAddress 2
CitystringCustomer city
PostalCodestringCustomer postal code
CountryCodestringCustomer 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>"
}