Send hotel reservation messages

To send a hotel reservation message, you must first retrieve the transactionID of the user for whom you want to generate a message. Provide the transactionId for every transaction.

After getting the user transactionId, pass the hotel reservation message template parameters in the message payload.

To send a hotel reservation message to a user, make the following POST request to the API:

POST https://nbupayments.googleapis.com/v1/merchantCommunications:send
Content-type: application/json

{
  "merchantInfo": {
    "googleMerchantId": "Google assigned merchant ID."
  },
  "recipients": [
    {
      "vendorPaymentTransactionId": "35 digit UPI transaction ID"
    }
  ],
  "messagePayload": {
    "merchantMessageId": "Unique message ID",
    "components": [
      {
        "template": {
          "templateType": "HOTEL_RESERVATION",
          "templateParameters": {
            "merchantBookingId": "Merchant assigned booking ID",
            "hotelInfo": {
              "hotelName": "Hotel name",
              "cityName": "City name",
              "hotelAddress": {
                "addressLine": [
                  "Address line 1",
                  "Address line 2"
                ]
              }
            },
            "roomInfo": {
              "roomType": "Type / category of room (executive / classic etc)"
            },
            "checkInTime": "Check-in time in RFC 3339 format (2018-06-02T11:50:30Z)",
            "checkOutTime": "Check-in time in RFC 3339 format (2018-06-02T11:50:30Z)",
            "guestInfo": [
              {
                "guestName": "Guest name"
              },
              {
                "guestName": "Guest name"
              }
            ]
          }
        }
      }
    ]
  }
}

Parameters

User and merchant

The following data parameters for the user object must be passed in the API request:

Parameters Type of value Description Required/Optional
googleMerchantId String The ID provided by Google for a business. Required
vendorPaymentTransactionId String The 35-digit UPI transaction ID generated either by vendor (payment service provider) or merchant for every transaction. Required

Message payload

You must pass the merchant-created unique ID for every message in the merchantMessageId.

Template type

You must pass the value for templateType object as HOTEL_RESERVATION. Pass the merchant-created unique ID for every message in the merchantBookingId.

Hotel info object

The following are the data parameters to pass into the hotelInfo object:

Parameters Type of value Description Required/Optional
hotelName String Name of the hotel where guest is staying. Required
cityName String Name of the city where the guest reserved hotel is located. Required
hotelAddress String Address of the hotel where the guest is saying. Optional

Room info object

The following is the data parameters to pass into the roomInfo object:

Parameter Type of value Description Required/Optional
roomType String The type of room that has been reserved. For example, executive, classic, suite, and so on. Required

You must pass the hotel check-in time in the checkInTime key and hotel check-out time in the checkOutTime key. The startTime must be defined in the RFC 3339 format (2018-06-02T11:50:30Z).

Guest info

The following is the data parameters to pass into the guestInfo array:

Parameter Type of value Description Required/Optional
guestName String Name of the guest. Required

If more than one guest is staying in the hotel, define the key-value pair as guestName for each guest in the guestInfo array as shown in the sample request.

Response

The API returns the following response if the request is successful:

{
  "sendMessageResults": [
    {
      "recipient": {
        "vendorPaymentTransactionId": "35 digit UPI transaction ID"
      },
      "status": {
        "code": 200,
        "message": "Success response message"
      }
    }
  ]
}

The response contains the recipient vendorPaymentTransactionId, API response status, and the relevant message.