The sample code covers the following business scenarios:
- Scenario #1: Jane decides to make a reservation for tomorrow night based on the availability check done previously.
- Validate Cache (Optional for caching partners)
A specific shop containing the chosen rate plan/room type is sent to Hilton to validate rate/inventory is what is expected compared to what partner has in cache. Specific Shop details here - Create Reservation
The details received in the single property shop are used to reserve a room for tomorrow night
- Validate Cache (Optional for caching partners)
- Scenario #2: John decides to make a reservation for next week. He then decides to change the guest name listed on the reservation. And later, he decides to cancel the reservation. These are the tasks performed:
- Create Reservation
The details received in the multi property shop are used to reserve a room for next week tomorrow night - Modify Reservation
-The confirmation number and GNRA GNR (Guest Name Record) holds all the guest arrival and accommodation information for the reservation being filed into the system. There can be one or multiple GNRs for a reservation.
(Synonym(s) - Stay) numbers are used to retrieve the reservation to ensure accurate reservation data is passed on the modify request (Retrieve a specific reservation).
-The reservation info is then sent on the modify along with the changed guest name (Modify a specific GNR) - Cancel Reservation
-The confirmation number and GNR number can be used to retrieve the reservation to ensure reservation is still confirmed and additional details such as cancelation deadline.(Retrieve a specific GNR).
-The confirmation and GNR numbers are used to cancel the reservation (Cancel a specific GNR)
- Create Reservation
These samples begin after the Access Token has been received. See the Authenticate Your App page for this sample.
Create a Reservation
Use this API to create a reservation for the selected hotel, room, rate and occupancy. Payment information is provided directly within the request.
Multiple rooms may be booked in a single request. Up to 9 rooms may be requested at once. Refer to the Multi-room Shopping and Reservation page here for more information. If you need to book more than 9 rooms at once, please consult with your account manager about our group booking partnership.
Note: Rate changes over the stay will be indicated by multiple rateDetail elements as shown in example below
POST https://kapip-s.hilton.io/hospitality-partner/v2/dcres
Content-Type: application/json
accept: application/json
Authorization: "Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET"
Request Body:
{
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
}
Response 200:
[
{
"adultAge": 18,
"ageBasedPricing": true,
"arrivalDate": "2020-11-26",
"confNumber": "84141916",
"departureDate": "2020-11-28",
"externalResId": "324725898",
"gnrNumber": 77549775,
"numAdults": 2,
"numRooms": 1,
"propCode": "CHIDT",
"resCreateDate": "2020-09-01T19:32:31Z",
"cost": {
"amountAfterTax": 274.24,
"amountBeforeTax": 240.56,
"currencyCode": "USD",
"serviceChargesInTaxCalc": false,
"totalServiceCharges": 0.0,
"totalTaxes": 33.68,
"meals": {
"mealPlan": "N",
"mealPlanDesc": "None"
},
"rateDetails": [
{
"cribRate": 0.0,
"discountAmount": 2.0,
"effectiveDate": "2020-11-26",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 121.52,
"rate2Person": 121.52,
"rate3Person": 131.32,
"rate4Person": 141.12,
"rollawayRate": 0.0,
"roomRate": 121.52,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
},
{
"cribRate": 0.0,
"discountAmount": 4.0,
"effectiveDate": "2020-11-27",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 119.04,
"rate2Person": 119.04,
"rate3Person": 128.64,
"rate4Person": 138.24,
"rollawayRate": 0.0,
"roomRate": 119.04,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
}
]
},
"guarantee": {
"cxlPolicyCode": "04D",
"cxlPolicyDesc": "4 DAY CANCELLATION REQUIRED",
"guarMethodCode": "CC",
"guarMethodDesc": "GUARANTEED BY CREDIT CARD",
"guarPolicyCode": "GTD",
"guarPolicyDesc": "Hold for Arrival",
"paymentCard": {
"cardCode": "VS",
"cardExpireDate": "1120",
"cardNumber": "8041804116964411"
}
},
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV",
"addressType": "home"
},
{
"addressLine1": "500 1st St",
"city": "DALLAS",
"company": "Corporate Account ABCDEF ",
"country": "US",
"postalCode": "123456",
"state": "TX",
"addressType": "travel"
},
{
"addressLine1": "UNKNOWN",
"city": "X",
"company": "Corporate Account ABCDEF ",
"country": "US",
"postalCode": "00000",
"state": "XX",
"addressType": "business"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
],
"phones": [
{
"phoneNumber": "123456789",
"phoneType": "home"
},
{
"phoneNumber": "12032998000",
"phoneType": "travel"
},
{
"phoneNumber": "12032998970",
"phoneType": "fax"
}
]
},
"ratePlan": {
"advancePurchase": false,
"ratePlanCode": "LDT3XF",
"ratePlanName": "Expedia ST SEMI FLEX",
"serviceChargesAndTaxesIncluded": false
},
"roomType": {
"extraBedPermitted": false,
"roomOccupancy": 4,
"roomTypeCode": "ND2",
"smokingRoom": false,
"roomTypeDesc": [
"2 DOUBLE BEDS NONSMOKING"
]
},
"comments": [
"Test comments ABC,"
],
"bookingMessages": [
{
"endDate": "2173-10-14",
"message": "GUEST MUST BE 21 YEARS OF AGE OR OLDER TO CHECK IN",
"startDate": "2013-03-11"
},
{
"endDate": "2173-10-14",
"message": "HOTEL HAS SHIPPING FEES. CONTACT PROPERTY FOR PRICING.",
"startDate": "2016-11-09"
},
{
"endDate": "2173-10-14",
"message": "FYI: INTERNATIONAL ARRIVALS MUST CALL FOR SHUTTLE PICK UP",
"startDate": "2018-01-18"
},
{
"endDate": "2173-10-14",
"message": "FYI: SELF PARKING $29.00, VALET PARKING $35.00",
"startDate": "2018-01-18"
}
],
"clientAccounts": [
{
"clientId": "0560079228",
"clientName": "Corporate Account ABCDEF",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientName": "Travel Agent ABC",
"clientType": "travelAgent"
}
]
}
]
curl -d '{"propCode":"NYCWA","guarantee":{"guarMethodCode":"CC"},"guest":{"name":{"firstName":"testFirstName","lastName":"testLastName"},"addresses":[{"addressType":"home"}]},"roomStays":[{"arrivalDate":"2018-01-01","departureDate":"2018-01-01","numAdults":2},{"arrivalDate":"2018-10-10","departureDate":"2018-10-12","numAdults":2},{"arrivalDate":"2018-10-12","departureDate":"2018-10-14","numAdults":2}]}' -H "Content-Type: application/json" -H "Authorization: Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET" -X POST https://kapip-s.hilton.io/hospitality-partner/v2/dcres
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// make reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres";
// build the payload
String payload="{\"propCode\":\"CHIDT\",\"guest\":{\"name\":{\"firstName\":\"TestFirst\",\"lastName\":\"TestLast\"},\"addresses\":[{\"addressType\":\"home\",\"addressLine1\":\"123MainSt\",\"city\":\"Reno\",\"country\":\"US\",\"postalCode\":\"123456\",\"state\":\"NV\"}],\"phones\":[{\"phoneType\":\"home\",\"phoneNumber\":\"123456789\"}],\"emails\":[{\"emailAddress\":\"test@test.com\",\"emailType\":\"home\"}]},\"roomStays\":[{\"arrivalDate\":\"2020-11-26\",\"departureDate\":\"2020-11-28\",\"numAdults\":2,\"numChildren\":0,\"roomTypeCode\":\"ND2\",\"ratePlanCode\":\"LDT3XF\"}],\"guarantee\":{\"guarMethodCode\":\"CC\",\"paymentCard\":{
\"cardNumber\":\"4411441144114411\",\"cardCode\":\"VI\",\"cardExpireDate\":\"1120\"}},\"comments\":[\"TestcommentsABC,\"],\"externalResId\":\"324725898\",\"clientAccounts\":[{
\"clientId\":\"0560079228\",\"clientType\":\"corporate\"},{\"clientId\":\"0007723203\",\"clientType\":\"travelAgent\"}]}";
// jersey client
ClientConfig client = new DefaultClientConfig();
client.getClasses().add(JacksonJsonProvider.class);
Client clientWithJacksonSerializer = Client.create(client);
WebResource webResource = clientWithJacksonSerializer.resource(endpointUrl);
ClientResponse jsonResponse = webResource.header("Authorization", "Basic " + this.token).type("application/json")
.post(ClientResponse.class, payload);
// retrieve the parsed JSONObject from the response
String value = jsonResponse.getEntity(String.class);
// data you need from the response
String resStatus = null;
String confNumber = null;
int gnrNumber;
// the response is an array of json objects, loop through them
JSONArray jsonArray = new JSONArray(value);
for (int i = 0; i < jsonArray.length(); i++) {
// convert the response to a JSONObject
JSONObject entry = jsonArray.getJSONObject(i);
// get reservation status from response
resStatus = entry.getString("resStatus");
// get confirmation number from response
confNumber = entry.getString("confNumber");
// get gnr number from response
gnrNumber = entry.getInt("gnrNumber");
}
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// make reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres";
// build the payload
String payload="{\"propCode\":\"CHIDT\",\"guest\":{\"name\":{\"firstName\":\"TestFirst\",\"lastName\":\"TestLast\"},\"addresses\":[{\"addressType\":\"home\",\"addressLine1\":\"123MainSt\",\"city\":\"Reno\",\"country\":\"US\",\"postalCode\":\"123456\",\"state\":\"NV\"}],\"phones\":[{\"phoneType\":\"home\",\"phoneNumber\":\"123456789\"}],\"emails\":[{\"emailAddress\":\"test@test.com\",\"emailType\":\"home\"}]},\"roomStays\":[{\"arrivalDate\":\"2020-11-26\",\"departureDate\":\"2020-11-28\",\"numAdults\":2,\"numChildren\":0,\"roomTypeCode\":\"ND2\",\"ratePlanCode\":\"LDT3XF\"}],\"guarantee\":{\"guarMethodCode\":\"CC\",\"paymentCard\":{
\"cardNumber\":\"4411441144114411\",\"cardCode\":\"VI\",\"cardExpireDate\":\"1120\"}},\"comments\":[\"TestcommentsABC,\"],\"externalResId\":\"324725898\",\"clientAccounts\":[{
\"clientId\":\"0560079228\",\"clientType\":\"corporate\"},{\"clientId\":\"0007723203\",\"clientType\":\"travelAgent\"}]}";
// resteasy client
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(endpointUrl);
Response jsonResponse = target.request()
.header("Content-Type","application/json").header("accept","application/json")
.header("Authorization", "Basic " + this.token).post(Entity.json(payload));
// retrieve the parsed JSONObject from the response
String value = jsonResponse.readEntity(String.class);
// data you need from the response
String resStatus = null;
String confNumber = null;
int gnrNumber;
// the response is an array of json objects, loop through them
JSONArray jsonArray = new JSONArray(value);
for (int i = 0; i < jsonArray.length(); i++) {
// convert the response to a JSONObject
JSONObject entry = jsonArray.getJSONObject(i);
// get reservation status from response
resStatus = entry.getString("resStatus");
// get confirmation number from response
confNumber = entry.getString("confNumber");
// get gnr number from response
gnrNumber = entry.getInt("gnrNumber");
}
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// make reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres";
// build the payload
String payload="{\"propCode\":\"CHIDT\",\"guest\":{\"name\":{\"firstName\":\"TestFirst\",\"lastName\":\"TestLast\"},\"addresses\":[{\"addressType\":\"home\",\"addressLine1\":\"123MainSt\",\"city\":\"Reno\",\"country\":\"US\",\"postalCode\":\"123456\",\"state\":\"NV\"}],\"phones\":[{\"phoneType\":\"home\",\"phoneNumber\":\"123456789\"}],\"emails\":[{\"emailAddress\":\"test@test.com\",\"emailType\":\"home\"}]},\"roomStays\":[{\"arrivalDate\":\"2020-11-26\",\"departureDate\":\"2020-11-28\",\"numAdults\":2,\"numChildren\":0,\"roomTypeCode\":\"ND2\",\"ratePlanCode\":\"LDT3XF\"}],\"guarantee\":{\"guarMethodCode\":\"CC\",\"paymentCard\":{
\"cardNumber\":\"4411441144114411\",\"cardCode\":\"VI\",\"cardExpireDate\":\"1120\"}},\"comments\":[\"TestcommentsABC,\"],\"externalResId\":\"324725898\",\"clientAccounts\":[{
\"clientId\":\"0560079228\",\"clientType\":\"corporate\"},{\"clientId\":\"0007723203\",\"clientType\":\"travelAgent\"}]}";
// unirest client
HttpResponse jsonResponse =
Unirest.post(endpointUrl).header("Content-Type", "application/json")
.header("accept", "application/json").header("Authorization", "Basic " + this.token).body(payload).asJson();
// data you need from the response
String resStatus = null;
String confNumber = null;
int gnrNumber;
// the response is an array of json objects, loop through them
JSONArray jsonArray = jsonResponse.getBody().getArray();
for (int i = 0; i < jsonArray.length(); i++) {
// convert the response to a JSONObject
JSONObject entry = jsonArray.getJSONObject(i);
// get reservation status from response
resStatus = entry.getString("resStatus");
// get confirmation number from response
confNumber = entry.getString("confNumber");
// get gnr number from response
gnrNumber = entry.getInt("gnrNumber");
}
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// make reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// xhttp client
var xhttp = new XMLHttpRequest();
xhttp.open("POST", endpointUrl, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "Basic " + token);
xhttp.onreadystatechange = function() {
// data you need from the response
var resStatus;
var confNumber;
var gnrNumber;
// the response is an array of json objects, loop through them
var jsonArray = JSON.parse(xhttp.responseText);
for (var i = 0; i < jsonArray.length; i++) {
var entry = jsonArray[i];
// get reservation status from response
resStatus = entry["resStatus"];
// get confirmation number from response
confNumber = entry["confNumber"];
// get gnr number from response
gnrNumber = entry["gnrNumber"];
}
}
// do the POST call to the endpoint, passing in the payload
xhttp.send(JSON.stringify(payload));
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// make reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// ajax client
$.ajax({
type: "POST",
url: endpointUrl,
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Basic ' + token);
xhr.setRequestHeader('Accept', 'application/json')
},
data: JSON.stringify(payload),
contentType: 'application/json',
success: function(data, statusText, xhr) {
// data you need from the response
var resStatus;
var confNumber;
var gnrNumber;
// the response is an array of json objects, loop through them
for (i = 0; i < data.length; i++) {
var entry = data[i];
// get reservation status from response
resStatus = entry.resStatus;
// get confirmation number from response
confNumber = entry.confNumber;
// get gnr number from response
gnrNumber = entry.gnrNumber;
}
}
});
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// make reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// http client
return $http({
method: 'POST',
url: endpointUrl,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + token
},
data: payload
}).then(function(response) {
// retrieve the response
var data = response.data;
// data you need from the response
var resStatus;
var confNumber;
var gnrNumber;
// the response is an array of json objects, loop through them
for (i = 0; i < data.length; i++) {
var entry = data[i];
// get reservation status from response
resStatus = entry.resStatus;
// get confirmation number from response
confNumber = entry.confNumber;
// get gnr number from response
gnrNumber = entry.gnrNumber;
}
}
})
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// host address
var host = "kapip-s.hilton.io";
var basePath = "/hospitality-partner/v2";
// create http object
var http = require('https');
// token endpoint path
var endpointPath = basePath + "/dcres";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// An object of options to indicate where to post to
var post_options = {
host: host,
path: endpointPath,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept' : 'application/json',
'Authorization': 'Basic ' + token
}
};
// Set up post the request
var post_req = http.request(post_options, function(response) {
response.setEncoding("utf8");
var rawData = '';
// process the response object to json
response.on('data', (chunk) => {
rawData += chunk;
});
// parse the json and print the objects
response.on('end', () => {
// data you need from the response
var resStatus;
var confNumber;
var gnrNumber;
// retrieve the parsed JSONObject from the response
var jsonArray = JSON.parse(rawData);
for (var i = 0; i < jsonArray.length; i++) {
var entry = jsonArray[i];
// get reservation status from response
resStatus = entry.resStatus;
// get confirmation number from response
confNumber = entry.confNumber;
// get gnr number from response
gnrNumber = entry.gnrNumber;
}
});
});
// post the data
post_req.write(JSON.stringify(payload));
post_req.end();
Retrieve Reservation Info
Use this endpoint to retrieve details for a specific reservation (represented by confNumber). This will retrieve all stays within the booking since a specific GNR# was not provided. The response info received to populate your Modify or Cancel request, or to display reservation details.
GET https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916
accept: application/json
Authorization: "Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET"
Response 200:
{
"adultAge": 18,
"ageBasedPricing": true,
"arrivalDate": "2020-11-26",
"confNumber": "84141916",
"departureDate": "2020-11-28",
"externalResId": "324725898",
"gnrNumber": 100110486,
"lastResModifyDate": "2020-09-01T19:32:32Z",
"numAdults": 2,
"numRooms": 1,
"propCode": "CHIDT",
"resCreateDate": "2020-09-01T19:32:31Z",
"cost": {
"amountAfterTax": 274.24,
"amountBeforeTax": 240.56,
"currencyCode": "USD",
"serviceChargesInTaxCalc": false,
"totalServiceCharges": 0.0,
"totalTaxes": 33.68,
"meals": {
"mealPlan": "N",
"mealPlanDesc": "None"
},
"rateDetails": [
{
"cribRate": 0.0,
"discountAmount": 2.0,
"effectiveDate": "2020-11-26",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 121.52,
"rate2Person": 121.52,
"rate3Person": 131.32,
"rate4Person": 141.12,
"rollawayRate": 0.0,
"roomRate": 121.52,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
},
{
"cribRate": 0.0,
"discountAmount": 4.0,
"effectiveDate": "2020-11-27",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 119.04,
"rate2Person": 119.04,
"rate3Person": 128.64,
"rate4Person": 138.24,
"rollawayRate": 0.0,
"roomRate": 119.04,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
}
]
},
"guarantee": {
"cxlPolicyCode": "04D",
"cxlPolicyDeadline": "2023-10-19T05:00:00Z",
"cxlPolicyDesc": "4 DAY CANCELLATION REQUIRED",
"guarMethodCode": "CC",
"guarMethodDesc": "GUARANTEED BY CREDIT CARD",
"guarPolicyCode": "GTD",
"guarPolicyDesc": "Hold for Arrival",
"paymentCard": {
"cardCode": "VS",
"cardExpireDate": "1120",
"cardNumber": "8041804126964411"
}
},
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV",
"addressType": "home"
},
{
"addressLine1": "500 1st St",
"city": "DALLAS",
"company": "Travel Agent ABC",
"country": "US",
"postalCode": "1234567",
"state": "TX",
"addressType": "travel"
},
{
"addressLine1": "UNKNOWN",
"city": "X",
"company": "Corporate Account ABCDEF ",
"country": "US",
"postalCode": "00000",
"state": "XX",
"addressType": "business"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
],
"phones": [
{
"phoneNumber": "123456789",
"phoneType": "home"
},
{
"phoneNumber": "12032998000",
"phoneType": "travel"
},
{
"phoneNumber": "12032998970",
"phoneType": "fax"
}
]
},
"ratePlan": {
"advancePurchase": false,
"ratePlanCode": "LDT3XF",
"ratePlanName": "Expedia ST SEMI FLEX",
"serviceChargesAndTaxesIncluded": false
},
"resStatus": "confirmed",
"roomType": {
"extraBedPermitted": false,
"roomOccupancy": 4,
"roomTypeCode": "ND2",
"smokingRoom": false,
"roomTypeDesc": [
"2 DOUBLE BEDS NONSMOKING"
]
},
"comments": [
"Test comments ABC,"
],
"bookingMessages": [
{
"endDate": "2173-10-14",
"message": "GUEST MUST BE 21 YEARS OF AGE OR OLDER TO CHECK IN",
"startDate": "2013-03-11"
},
{
"endDate": "2173-10-14",
"message": "HOTEL HAS SHIPPING FEES. CONTACT PROPERTY FOR PRICING.",
"startDate": "2016-11-09"
},
{
"endDate": "2173-10-14",
"message": "FYI: INTERNATIONAL ARRIVALS MUST CALL FOR SHUTTLE PICK UP",
"startDate": "2018-01-18"
},
{
"endDate": "2173-10-14",
"message": "FYI: SELF PARKING $29.00, VALET PARKING $35.00",
"startDate": "2018-01-18"
}
],
"clientAccounts": [
{
"clientId": "0560079228",
"clientName": "Corporate Account ABCDEF",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientName": "Travel Agent ABC",
"clientType": "travelAgent"
}
]
}
=
curl -H "Content-Type: application/json" -X GET https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916";
// jersey client
ClientConfig client = new DefaultClientConfig();
client.getClasses().add(JacksonJsonProvider.class);
Client clientWithJacksonSerializer = Client.create(client);
WebResource webResource = clientWithJacksonSerializer.resource(endpointUrl);
ClientResponse jsonResponse = webResource.header("Authorization", "Basic " + this.token).type("application/json")
.get(ClientResponse.class, payload);
// retrieve the parsed JSONObject from the response
String value = jsonResponse.readEntity(String.class);
// data you need from the response
String arrivalDate = null;
String departureDate = null;
String propCode = null;
// the response is an array of json objects, loop through them
JSONArray jsonArray = new JSONArray(value);
for (int i = 0; i < jsonArray.length(); i++) {
// convert the response to a JSONObject
JSONObject entry = jsonArray.getJSONObject(i);
// get arrival date from response
arrivalDate = entry.getString("arrivalDate");
// get departure date from response
departureDate = entry.getString("departureDate");
// get property code from response
propCode = entry.getString("propCode");
}
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916";
// resteasy client
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(endpointUrl);
Response jsonResponse = target.request()
.header("Content-Type","application/json").header("accept","application/json")
.header("Authorization", "Basic " + this.token).get();
// retrieve the parsed JSONObject from the response
String value = jsonResponse.readEntity(String.class);
// data you need from the response
String arrivalDate = null;
String departureDate = null;
String propCode = null;
// the response is an array of json objects, loop through them
JSONArray jsonArray = new JSONArray(value);
for (int i = 0; i < jsonArray.length(); i++) {
// convert the response to a JSONObject
JSONObject entry = jsonArray.getJSONObject(i);
// get arrival date from response
arrivalDate = entry.getString("arrivalDate");
// get departure date from response
departureDate = entry.getString("departureDate");
// get property code from response
propCode = entry.getString("propCode");
}
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916";
// unirest client
HttpResponse jsonResponse =
Unirest.get(endpointUrl).header("Content-Type", "application/json")
.header("accept", "application/json").header("Authorization", "Basic " + this.token).asJson();
// data you need from the response
String arrivalDate = null;
String departureDate = null;
String propCode = null;
// the response is an array of json objects, loop through them
JSONArray jsonArray = jsonResponse.getBody().getArray();
for (int i = 0; i < jsonArray.length(); i++) {
// convert the response to a JSONObject
JSONObject entry = jsonArray.getJSONObject(i);
// get arrival date from response
arrivalDate = entry.getString("arrivalDate");
// get departure date from response
departureDate = entry.getString("departureDate");
// get property code from response
propCode = entry.getString("propCode");
}
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916";
// xhttp client
var xhttp = new XMLHttpRequest();
xhttp.open("GET", endpointUrl, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "Basic " + token);
xhttp.onreadystatechange = function() {
// data you need from the response
var arrivalDate;
var departureDate;
var propCode;
// the response is an array of json objects, loop through them
var jsonArray = JSON.parse(xhttp.responseText);
for (var i = 0; i < jsonArray.length; i++) {
var entry = jsonArray[i];
// get arrival date from response
arrivalDate = entry["arrivalDate"];
// get departure date from response
departureDate = entry["departureDate"];
// get property code from response
propCode = entry["propCode"];
}
}
// do the GET call to the endpoint
xhttp.send();
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916";
// ajax client
$.ajax({
type: "GET",
url: endpointUrl,
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Basic ' + token);
xhr.setRequestHeader('Accept', 'application/json')
},
dataType: "json",
contentType: 'application/json',
success: function(data, statusText, xhr) {
// data you need from the response
var arrivalDate;
var departureDate;
var propCode;
// the response is an array of json objects, loop through them
for (i = 0; i < data.length; i++) {
var entry = data[i];
// get arrival date from response
arrivalDate = entry.arrivalDate;
// get departure date from response
departureDate = entry.departureDate;
// get property code from response
propCode = entry.propCode;
}
}
});
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916";
// http client
return $http({
method: 'GET',
url: endpointUrl,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + token
},
data: payload
}).then(function(response) {
// retrieve the response
var data = response.data;
// data you need from the response
var arrivalDate;
var departureDate;
var propCode;
// the response is an array of json objects, loop through them
for (i = 0; i < data.length; i++) {
var entry = data[i];
// get arrival date from response
arrivalDate = entry.arrivalDate;
// get departure date from response
departureDate = entry.departureDate;
// get property code from response
propCode = entry.propCode;
}
}
})
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// create http object
var http = require('https');
// host address
var host = "kapip-s.hilton.io";
var basePath = "/hospitality-partner/v2";
// retrieve reservation endpoint path
var endpointPath = basePath + "/dcres/84141916";
// An object of options to indicate where to get from
var get_options = {
host: host,
path: endpointPath,
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic ' + token
}
};
// Set up to get the request
var get_req = http.request(get_options, function(response) {
response.setEncoding("utf8");
var rawData = '';
// process the response object to json
response.on('data', (chunk) => {
rawData += chunk;
});
// parse the json and print the objects
response.on('end', () => {
// data you need from the response
var arrivalDate;
var departureDate;
var propCode;
// retrieve the parsed JSONArray from the response
var jsonArray = JSON.parse(rawData);
for (var i = 0; i < jsonArray.length; i++) {
var entry = jsonArray[i];
// get arrival date from response
arrivalDate = entry.arrivalDate;
// get departure date from response
departureDate = entry.departureDate;
// get property code from response
propCode = entry.propCode;
}
});
});
// get the data
get_req.end();
Read Reservation Stay Info
Use this API to retrieve details for a specific stay (represented by a combination of the confNumber and gnrNumber). Then use the info received to populate your Modify or Cancel request, or to display details of the stay.
GET https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486
accept: application/json
Authorization: "Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET"
Response 200:
{
"adultAge": 18,
"ageBasedPricing": true,
"arrivalDate": "2020-11-26",
"confNumber": "84141916",
"departureDate": "2020-11-28",
"externalResId": "324725898",
"gnrNumber": 100110486,
"lastResModifyDate": "2020-09-01T19:32:32Z",
"numAdults": 2,
"numRooms": 1,
"propCode": "CHIDT",
"resCreateDate": "2020-09-01T19:32:31Z",
"cost": {
"amountAfterTax": 274.24,
"amountBeforeTax": 240.56,
"currencyCode": "USD",
"serviceChargesInTaxCalc": false,
"totalServiceCharges": 0.0,
"totalTaxes": 33.68,
"meals": {
"mealPlan": "N",
"mealPlanDesc": "None"
},
"rateDetails": [
{
"cribRate": 0.0,
"discountAmount": 2.0,
"effectiveDate": "2020-11-26",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 121.52,
"rate2Person": 121.52,
"rate3Person": 131.32,
"rate4Person": 141.12,
"rollawayRate": 0.0,
"roomRate": 121.52,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
},
{
"cribRate": 0.0,
"discountAmount": 4.0,
"effectiveDate": "2020-11-27",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 119.04,
"rate2Person": 119.04,
"rate3Person": 128.64,
"rate4Person": 138.24,
"rollawayRate": 0.0,
"roomRate": 119.04,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
}
]
},
"guarantee": {
"cxlPolicyCode": "04D",
"cxlPolicyDeadline": "2023-10-19T05:00:00Z",
"cxlPolicyDesc": "4 DAY CANCELLATION REQUIRED",
"guarMethodCode": "CC",
"guarMethodDesc": "GUARANTEED BY CREDIT CARD",
"guarPolicyCode": "GTD",
"guarPolicyDesc": "Hold for Arrival",
"paymentCard": {
"cardCode": "VS",
"cardExpireDate": "1120",
"cardNumber": "8041804116964411"
}
},
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV",
"addressType": "home"
},
{
"addressLine1": "500 1st St",
"city": "DALLAS",
"company": "Travel Agent ABC",
"country": "US",
"postalCode": "1234567",
"state": "TX",
"addressType": "travel"
},
{
"addressLine1": "UNKNOWN",
"city": "X",
"company": "Corporate Account ABCDEF ",
"country": "US",
"postalCode": "00000",
"state": "XX",
"addressType": "business"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
],
"phones": [
{
"phoneNumber": "123456789",
"phoneType": "home"
},
{
"phoneNumber": "12032998000",
"phoneType": "travel"
},
{
"phoneNumber": "12032998970",
"phoneType": "fax"
}
]
},
"ratePlan": {
"advancePurchase": false,
"ratePlanCode": "LDT3XF",
"ratePlanName": "Expedia ST SEMI FLEX",
"serviceChargesAndTaxesIncluded": false
},
"resStatus": "confirmed",
"roomType": {
"extraBedPermitted": false,
"roomOccupancy": 4,
"roomTypeCode": "ND2",
"smokingRoom": false,
"roomTypeDesc": [
"2 DOUBLE BEDS NONSMOKING"
]
},
"comments": [
"Test comments ABC,"
],
"bookingMessages": [
{
"endDate": "2173-10-14",
"message": "GUEST MUST BE 21 YEARS OF AGE OR OLDER TO CHECK IN",
"startDate": "2013-03-11"
},
{
"endDate": "2173-10-14",
"message": "HOTEL HAS SHIPPING FEES. CONTACT PROPERTY FOR PRICING.",
"startDate": "2016-11-09"
},
{
"endDate": "2173-10-14",
"message": "FYI: INTERNATIONAL ARRIVALS MUST CALL FOR SHUTTLE PICK UP",
"startDate": "2018-01-18"
},
{
"endDate": "2173-10-14",
"message": "FYI: SELF PARKING $29.00, VALET PARKING $35.00",
"startDate": "2018-01-18"
}
],
"clientAccounts": [
{
"clientId": "0560079228",
"clientName": "Corporate Account ABCDEF",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientName": "Travel Agent ABC",
"clientType": "travelAgent"
}
]
}
curl -H "Content-Type: application/json" -X GET https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// jersey client
ClientConfig client = new DefaultClientConfig();
client.getClasses().add(JacksonJsonProvider.class);
Client clientWithJacksonSerializer = Client.create(client);
WebResource webResource = clientWithJacksonSerializer.resource(endpointUrl);
ClientResponse jsonResponse = webResource.header("Authorization", "Basic " + this.token).type("application/json")
.get(ClientResponse.class);
// retrieve the parsed JSONObject from the response
String value = jsonResponse.getEntity(String.class);
// convert the response to a JSONObject
JSONObject jsonObject = new JSONObject(value);
// get arrival date from response
String arrivalDate = jsonObject.getString("arrivalDate");
// get departure date from response
String departureDate = jsonObject.getString("departureDate");
// get property code from response
String propCode = jsonObject.getString("propCode");
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// resteasy client
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(endpointUrl);
Response jsonResponse = target.request()
.header("Content-Type","application/json").header("accept","application/json")
.header("Authorization", "Basic " + this.token).get();
// retrieve the parsed JSONObject from the response
String value = jsonResponse.readEntity(String.class);
// convert the response to a JSONObject
JSONObject jsonObject = new JSONObject(value);
// get arrival date from response
String arrivalDate = jsonObject.getString("arrivalDate");
// get departure date from response
String departureDate = jsonObject.getString("departureDate");
// get property code from response
String propCode = jsonObject.getString("propCode");
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// unirest client
HttpResponse jsonResponse =
Unirest.get(endpointUrl).header("Content-Type", "application/json")
.header("accept", "application/json").header("Authorization", "Basic " + this.token).asJson();
// convert the response to a JSONObject
JSONObject jsonObject = jsonResponse.getBody().getObject();
// get arrival date from response
String arrivalDate = jsonObject.getString("arrivalDate");
// get departure date from response
String departureDate = jsonObject.getString("departureDate");
// get property code from response
String propCode = jsonObject.getString("propCode");
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// xhttp client
var xhttp = new XMLHttpRequest();
xhttp.open("GET", endpointUrl, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "Basic " + token);
xhttp.onreadystatechange = function() {
// retrieve the parsed JSONObject from the response
var jsonObject = JSON.parse(xhttp.responseText);
// get arrival date from response
var arrivalDate = jsonObject["arrivalDate"];
// get departure date from response
var departureDate = jsonObject["departureDate"];
// get property code from response
var propCode = jsonObject["propCode"];
}
// do the GET call to the endpoint
xhttp.send();
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// ajax client
$.ajax({
type: "GET",
url: endpointUrl,
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Basic ' + token);
xhr.setRequestHeader('Accept', 'application/json')
},
dataType: "json",
contentType: 'application/json',
success: function(data, statusText, xhr) {
// get arrival date from response
var arrivalDate = data.arrivalDate;
// get departure date from response
var departureDate = data.departureDate;
// get property code from response
var propCode = data.propCode;
}
});
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// retrieve reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// http client
return $http({
method: 'GET',
url: endpointUrl,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + token
},
data: payload
}).then(function(response) {
// retrieve the response
var data = response.data;
// get arrival date from response
arrivalDate = data.arrivalDate;
// get departure date from response
departureDate = data.departureDate;
// get property code from response
propCode = data.propCode;
}
})
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// create http object
var http = require('https');
// host address
var host = "kapip-s.hilton.io";
var basePath = "/hospitality-partner/v2";
// retrieve reservation endpoint path
var endpointPath = basePath + "/dcres/84141916/gnr/100110486";
// An object of options to indicate where to get from
var get_options = {
host: host,
path: endpointPath,
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic ' + token
}
};
// Set up to get the request
var get_req = http.request(get_options, function(response) {
response.setEncoding("utf8");
var rawData = '';
// process the response object to json
response.on('data', (chunk) => {
rawData += chunk;
});
// parse the json and print the objects
response.on('end', () => {
// retrieve the parsed JSONObject from the response
var jsonObject = JSON.parse(rawData);
// get arrival date from response
var arrivalDate = jsonObject.arrivalDate;
// get departure date from response
var departureDate = jsonObject.departureDate;
// get property code from response
var propCode = jsonObject.propCode;
});
});
// get the data
get_req.end();
Update a Reservation Stay
Use this API to modify some details for a specific stay (represented by a combination of the confNumber and gnrNumber).
A Retrieve (GET) should be made prior to the modify to ensure complete reservation data is passed on the modify request.
Not all details can be modified. In some cases you may have to make a new reservation and cancel the existing one.
PUT https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/77549775
Content-Type: application/json
accept: application/json
Authorization: "Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET"
Request Body:
{
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
},
{
"addressLine1": "PO BOX 915204",
"city": "DALLAS",
"company": "PRICELINE",
"country": "US",
"postalCode": "75391-0001",
"state": "TX",
"addressType": "travel"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
}
Response 200:
{
"adultAge": 18,
"ageBasedPricing": true,
"arrivalDate": "2020-11-26",
"confNumber": "84141916",
"departureDate": "2020-11-28",
"externalResId": "324725898",
"gnrNumber": 77549775,
"numAdults": 2,
"numRooms": 1,
"propCode": "CHIDT",
"resCreateDate": "2020-09-01T19:32:31Z",
"cost": {
"amountAfterTax": 274.24,
"amountBeforeTax": 240.56,
"currencyCode": "USD",
"serviceChargesInTaxCalc": false,
"totalServiceCharges": 0.0,
"totalTaxes": 33.68,
"meals": {
"mealPlan": "N",
"mealPlanDesc": "None"
},
"rateDetails": [
{
"cribRate": 0.0,
"discountAmount": 2.0,
"effectiveDate": "2020-11-26",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 121.52,
"rate2Person": 121.52,
"rate3Person": 131.32,
"rate4Person": 141.12,
"rollawayRate": 0.0,
"roomRate": 121.52,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
},
{
"cribRate": 0.0,
"discountAmount": 4.0,
"effectiveDate": "2020-11-27",
"extraChildRate": 0.0,
"extraPersonRate": 0.0,
"rate1Person": 119.04,
"rate2Person": 119.04,
"rate3Person": 128.64,
"rate4Person": 138.24,
"rollawayRate": 0.0,
"roomRate": 119.04,
"discountType": "percentOff",
"taxes": [
{
"amount": 14.0,
"basis": "perRoom",
"period": "perNight",
"type": "percent"
}
]
}
]
},
"guarantee": {
"cxlPolicyCode": "04D",
"cxlPolicyDesc": "4 DAY CANCELLATION REQUIRED",
"guarMethodCode": "CC",
"guarMethodDesc": "GUARANTEED BY CREDIT CARD",
"guarPolicyCode": "GTD",
"guarPolicyDesc": "Hold for Arrival",
"paymentCard": {
"cardCode": "VS",
"cardExpireDate": "1120",
"cardNumber": "8041804116964411"
}
},
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV",
"addressType": "home"
},
{
"addressLine1": "500 1st Street",
"city": "DALLAS",
"company": "Travel Agent ABC",
"country": "US",
"postalCode": "1234567",
"state": "TX",
"addressType": "travel"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
],
"phones": [
{
"phoneNumber": "123456789",
"phoneType": "home"
}
]
},
"ratePlan": {
"advancePurchase": false,
"ratePlanCode": "LDT3XF",
"ratePlanName": "Expedia ST SEMI FLEX",
"serviceChargesAndTaxesIncluded": false
},
"roomType": {
"extraBedPermitted": false,
"roomOccupancy": 4,
"roomTypeCode": "ND2",
"smokingRoom": false,
"roomTypeDesc": [
"2 DOUBLE BEDS NONSMOKING"
]
},
"comments": [
"Test comments ABC,"
],
"bookingMessages": [
{
"endDate": "2173-10-14",
"message": "GUEST MUST BE 21 YEARS OF AGE OR OLDER TO CHECK IN",
"startDate": "2013-03-11"
},
{
"endDate": "2173-10-14",
"message": "HOTEL HAS SHIPPING FEES. CONTACT PROPERTY FOR PRICING.",
"startDate": "2016-11-09"
},
{
"endDate": "2173-10-14",
"message": "FYI: INTERNATIONAL ARRIVALS MUST CALL FOR SHUTTLE PICK UP",
"startDate": "2018-01-18"
},
{
"endDate": "2173-10-14",
"message": "FYI: SELF PARKING $29.00, VALET PARKING $35.00",
"startDate": "2018-01-18"
}
],
"clientAccounts": [
{
"clientId": "0560079228",
"clientName": "Corporate Account ABCDEF",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientName": "Travel Agent ABC",
"clientType": "travelAgent"
}
]
}
curl -d '{"propCode":"MSYNH","guarantee":{"guarMethodCode":"CC"},"guest":{"name":{"firstName":"testFirstName","lastName":"testLastName"},"addresses":[{"addressType":"home"}]},"roomStays":[{"arrivalDate":"2018-01-03","departureDate":"2018-01-05","numAdults":2},{"arrivalDate":"2018-10-05","departureDate":"2018-10-07","numAdults":2},{"arrivalDate":"2018-10-07","departureDate":"2018-10-09","numAdults":2}]}' -H "Content-Type: application/json" -H "Authorization: Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET" -X PUT https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// update reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// build the payload
String payload="{\"propCode\":\"CHIDT\",\"guest\":{\"name\":{\"firstName\":\"TestFirst\",\"lastName\":\"TestLast\"},
\"addresses\":[{\"addressType\":\"home\",\"addressLine1\":\"123MainSt\",\"city\":\"Reno\",\"country\":\"US\",\"postalCode\":\"123456\",
\"state\":\"NV\"},{\"addressLine1\":\"POBOX915204\",\"city\":\"DALLAS\",\"company\":\"PRICELINE\",\"country\":\"US\",\"postalCode\":\"75391-0001\",\"state\":\"TX\",
\"addressType\":\"travel\"}],\"phones\":[{\"phoneType\":\"home\",\"phoneNumber\":\"123456789\"}],\"emails\":[{\"emailAddress\":\"test@test.com\",\"emailType\":\"home\"
}]},\"roomStays\":[{\"arrivalDate\":\"2020-11-26\",\"departureDate\":\"2020-11-28\",\"numAdults\":2,\"numChildren\":0,\"roomTypeCode\":\"ND2\",\"ratePlanCode\":\"LDT3XF\"
}],\"guarantee\":{\"guarMethodCode\":\"CC\",\"paymentCard\":{\"cardNumber\":\"4411441144114411\",\"cardCode\":\"VI\",\"cardExpireDate\":\"1120\"}},\"comments\":[\"TestcommentsABC,\"],\"externalResId\":\"324725898\",\"clientAccounts\":[{\"clientId\":\"0560079228\",\"clientType\":\"corporate\"},\"clientId\":\"0007723203\",\"clientType\":\"travelAgent\"}]}";
// jersey client
ClientConfig client = new DefaultClientConfig();
client.getClasses().add(JacksonJsonProvider.class);
Client clientWithJacksonSerializer = Client.create(client);
WebResource webResource = clientWithJacksonSerializer.resource(endpointUrl);
ClientResponse jsonResponse = webResource.header("Authorization", "Basic " + this.token).type("application/json")
.put(ClientResponse.class, payload);
// retrieve the parsed JSONObject from the response
String value = jsonResponse.getEntity(String.class);
// convert the response to a JSONObject
JSONObject jsonObject = new JSONObject(value);
// get arrival date from response
String arrivalDate = jsonObject.getString("arrivalDate");
// get departure date from response
String departureDate = jsonObject.getString("departureDate");
// get property code from response
String propCode = jsonObject.getString("propCode");
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// update reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// build the payload
String payload="{\"propCode\":\"CHIDT\",\"guest\":{\"name\":{\"firstName\":\"TestFirst\",\"lastName\":\"TestLast\"},
\"addresses\":[{\"addressType\":\"home\",\"addressLine1\":\"123MainSt\",\"city\":\"Reno\",\"country\":\"US\",\"postalCode\":\"123456\",
\"state\":\"NV\"},{\"addressLine1\":\"POBOX915204\",\"city\":\"DALLAS\",\"company\":\"PRICELINE\",\"country\":\"US\",\"postalCode\":\"75391-0001\",\"state\":\"TX\",
\"addressType\":\"travel\"}],\"phones\":[{\"phoneType\":\"home\",\"phoneNumber\":\"123456789\"}],\"emails\":[{\"emailAddress\":\"test@test.com\",\"emailType\":\"home\"
}]},\"roomStays\":[{\"arrivalDate\":\"2020-11-26\",\"departureDate\":\"2020-11-28\",\"numAdults\":2,\"numChildren\":0,\"roomTypeCode\":\"ND2\",\"ratePlanCode\":\"LDT3XF\"
}],\"guarantee\":{\"guarMethodCode\":\"CC\",\"paymentCard\":{\"cardNumber\":\"4411441144114411\",\"cardCode\":\"VI\",\"cardExpireDate\":\"1120\"}},\"comments\":[\"TestcommentsABC,\"],\"externalResId\":\"324725898\",\"clientAccounts\":[{\"clientId\":\"0560079228\",\"clientType\":\"corporate\"},\"clientId\":\"0007723203\",\"clientType\":\"travelAgent\"}]}";
// resteasy client
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(endpointUrl);
Response jsonResponse = target.request()
.header("Content-Type","application/json").header("accept","application/json")
.header("Authorization", "Basic " + this.token).put(Entity.json(payload));
// retrieve the parsed JSONObject from the response
String value = jsonResponse.readEntity(String.class);
// convert the response to a JSONObject
JSONObject jsonObject = new JSONObject(value);
// get arrival date from response
String arrivalDate = jsonObject.getString("arrivalDate");
// get departure date from response
String departureDate = jsonObject.getString("departureDate");
// get property code from response
String propCode = jsonObject.getString("propCode");
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// update reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// build the payload
String payload="{\"propCode\":\"CHIDT\",\"guest\":{\"name\":{\"firstName\":\"TestFirst\",\"lastName\":\"TestLast\"},
\"addresses\":[{\"addressType\":\"home\",\"addressLine1\":\"123MainSt\",\"city\":\"Reno\",\"country\":\"US\",\"postalCode\":\"123456\",
\"state\":\"NV\"},{\"addressLine1\":\"POBOX915204\",\"city\":\"DALLAS\",\"company\":\"PRICELINE\",\"country\":\"US\",\"postalCode\":\"75391-0001\",\"state\":\"TX\",
\"addressType\":\"travel\"}],\"phones\":[{\"phoneType\":\"home\",\"phoneNumber\":\"123456789\"}],\"emails\":[{\"emailAddress\":\"test@test.com\",\"emailType\":\"home\"
}]},\"roomStays\":[{\"arrivalDate\":\"2020-11-26\",\"departureDate\":\"2020-11-28\",\"numAdults\":2,\"numChildren\":0,\"roomTypeCode\":\"ND2\",\"ratePlanCode\":\"LDT3XF\"
}],\"guarantee\":{\"guarMethodCode\":\"CC\",\"paymentCard\":{\"cardNumber\":\"4411441144114411\",\"cardCode\":\"VI\",\"cardExpireDate\":\"1120\"}},\"comments\":[\"TestcommentsABC,\"],\"externalResId\":\"324725898\",\"clientAccounts\":[{\"clientId\":\"0560079228\",\"clientType\":\"corporate\"},\"clientId\":\"0007723203\",\"clientType\":\"travelAgent\"}]}";
// unirest client
HttpResponse jsonResponse =
Unirest.put(endpointUrl).header("Content-Type", "application/json")
.header("accept", "application/json")
.header("Authorization", "Basic " + this.token).body(payload).asJson();
// convert the response to a JSONObject
JSONObject jsonObject = jsonResponse.getBody().getObject();
// get arrival date from response
String arrivalDate = jsonObject.getString("arrivalDate");
// get departure date from response
String departureDate = jsonObject.getString("departureDate");
// get property code from response
String propCode = jsonObject.getString("propCode");
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// update reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
},
{
"addressLine1": "PO BOX 915204",
"city": "DALLAS",
"company": "PRICELINE",
"country": "US",
"postalCode": "75391-0001",
"state": "TX",
"addressType": "travel"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// xhttp client
var xhttp = new XMLHttpRequest();
xhttp.open("PUT", endpointUrl, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "Basic " + token);
xhttp.onreadystatechange = function() {
// retrieve the parsed JSONObject from the response
var jsonObject = JSON.parse(xhttp.responseText);
// get arrival date from response
var arrivalDate = jsonObject["arrivalDate"];
// get departure date from response
var departureDate = jsonObject["departureDate"];
// get property code from response
var propCode = jsonObject["propCode"];
}
// do the PUT call to the endpoint, passing in the payload
xhttp.send(JSON.stringify(payload));
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// update reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
},
{
"addressLine1": "PO BOX 915204",
"city": "DALLAS",
"company": "PRICELINE",
"country": "US",
"postalCode": "75391-0001",
"state": "TX",
"addressType": "travel"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// ajax client
$.ajax({
type: "PUT",
url: endpointUrl,
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Basic ' + token);
xhr.setRequestHeader('Accept', 'application/json')
},
data: JSON.stringify(payload),
contentType: 'application/json',
success: function(data, statusText, xhr) {
// get arrival date from response
var arrivalDate = data.arrivalDate;
// get departure date from response
var departureDate = data.departureDate;
// get property code from response
var propCode = data.propCode;
}
});
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// update reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
},
{
"addressLine1": "PO BOX 915204",
"city": "DALLAS",
"company": "PRICELINE",
"country": "US",
"postalCode": "75391-0001",
"state": "TX",
"addressType": "travel"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// http client
return $http({
method: 'PUT',
url: endpointUrl,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + token
},
data: payload
}).then(function(response) {
// retrieve the response
var data = response.data;
// get arrival date from response
arrivalDate = data.arrivalDate;
// get departure date from response
departureDate = data.departureDate;
// get property code from response
propCode = data.propCode;
}
})
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// create http object
var http = require('https');
// host address
var host = "kapip-s.hilton.io";
var basePath = "/hospitality-partner/v2";
// build the payload
var payload = {
"propCode": "CHIDT",
"guest": {
"name": {
"firstName": "TestFirst",
"lastName": "TestLast"
},
"addresses": [
{
"addressType": "home",
"addressLine1": "123 Main St",
"city": "Reno",
"country": "US",
"postalCode": "123456",
"state": "NV"
},
{
"addressLine1": "PO BOX 915204",
"city": "DALLAS",
"company": "PRICELINE",
"country": "US",
"postalCode": "75391-0001",
"state": "TX",
"addressType": "travel"
}
],
"phones": [
{
"phoneType": "home",
"phoneNumber": "123456789"
}
],
"emails": [
{
"emailAddress": "test@test.com",
"emailType": "home"
}
]
},
"roomStays": [
{
"arrivalDate": "2020-11-26",
"departureDate": "2020-11-28",
"numAdults": 2,
"numChildren": 0,
"roomTypeCode": "ND2",
"ratePlanCode": "LDT3XF"
}
],
"guarantee": {
"guarMethodCode": "CC",
"paymentCard": {
"cardNumber": "4411441144114411",
"cardCode": "VI",
"cardExpireDate": "1120"
}
},
"comments": [
"Test comments ABC,"
],
"externalResId": "324725898",
"clientAccounts": [
{
"clientId": "0560079228",
"clientType": "corporate"
},
{
"clientId": "0007723203",
"clientType": "travelAgent"
}
]
};
// update reservation endpoint path
var endpointPath = basePath + "/dcres/84141916/gnr/100110486";
// An object of options to indicate where to put to
var put_options = {
host: host,
path: endpointPath,
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic ' + token
}
};
// Set up to put the request
var put_req = http.request(put_options, function(response) {
response.setEncoding("utf8");
var rawData = '';
// process the response object to json
response.on('data', (chunk) => {
rawData += chunk;
});
// parse the json and print the objects
response.on('end', () => {
// retrieve the parsed JSONObject from the response
var jsonObject = JSON.parse(rawData);
// get arrival date from response
var arrivalDate = jsonObject.arrivalDate;
// get departure date from response
var departureDate = jsonObject.departureDate;
// get property code from response
var propCode = jsonObject.propCode;
});
});
// put the data
put_req.write(JSON.stringify(payload));
put_req.end();
Cancel a Reservation Stay
Use this API to cancel an existing stay (represented by a combination of the confNumber and gnrNumber).
A Retrieve (GET) is recommended to be made prior to the cancel to ensure the reservation is still pending and cancel deadline has not passed.
Once cancelled, a reservation cannot be uncancelled. In this scenario, make a new reservation.
POST https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel
Content-Type: application/json
accept: application/json
Authorization: "Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET"
Request Body:
{
"languageCode": "EN",
"sendConfirmation": true
}
Response 200:
{
"cxlNumber": "1543023980"
}
curl -d '{"languageCode":"EN","sendConfirmation":true}' -H "Content-Type: application/json" -H "Authorization: Basic YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET" -X POST https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// cancel reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel";
// build the payload
String payload = "{\"languageCode\":\"EN\",\"sendConfirmation\":true}";
// jersey client
ClientConfig client = new DefaultClientConfig();
client.getClasses().add(JacksonJsonProvider.class);
Client clientWithJacksonSerializer = Client.create(client);
WebResource webResource = clientWithJacksonSerializer.resource(endpointUrl);
ClientResponse jsonResponse = webResource.header("Authorization", "Basic " + this.token).type("application/json")
.post(ClientResponse.class, payload);
// retrieve the parsed JSONObject from the response
String value = jsonResponse.getEntity(String.class);
// convert the response to a JSONObject
JSONObject jsonObject = new JSONObject(value);
// get cancellation number from response
String cxlNumber = jsonObject.getString("cxlNumber");
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// cancel reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel";
// build the payload
String payload = "{\"languageCode\":\"EN\",\"sendConfirmation\":true}";
// resteasy client
ResteasyClient client = new ResteasyClientBuilder().build();
ResteasyWebTarget target = client.target(endpointUrl);
Response jsonResponse = target.request()
.header("Content-Type","application/json").header("accept","application/json")
.header("Authorization", "Basic " + this.token).post(Entity.json(payload));
// retrieve the parsed JSONObject from the response
String value = jsonResponse.readEntity(String.class);
// convert the response to a JSONObject
JSONObject jsonObject = new JSONObject(value);
// get cancellation number from response
String cxlNumber = jsonObject.getString("cxlNumber");
// your token
String token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// cancel reservation endpoint url
String endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel";
// build the payload
String payload = "{\"languageCode\":\"EN\",\"sendConfirmation\":true}";
// unirest client
HttpResponse jsonResponse =
Unirest.post(endpointUrl).header("Content-Type", "application/json")
.header("accept", "application/json")
.header("Authorization", "Basic " + this.token).body(payload).asJson();
// convert the response to a JSONObject
JSONObject jsonObject = jsonResponse.getBody().getObject();
// get cancellation number from response
String cxlNumber = jsonObject.getString("cxlNumber");
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// cancel reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel";
// build the payload
var payload = {
"languageCode": "EN",
"sendConfirmation": true
};
// xhttp client
var xhttp = new XMLHttpRequest();
xhttp.open("POST", endpointUrl, true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.setRequestHeader("Authorization", "Basic " + token);
xhttp.onreadystatechange = function() {
// retrieve the parsed JSONObject from the response
var jsonObject = JSON.parse(xhttp.responseText);
// get cancellation number from response
var cxlNumber = jsonObject["cxlNumber"];
}
// do the PUT call to the endpoint, passing in the payload
xhttp.send(JSON.stringify(payload));
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// cancel reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel";
// build the payload
var payload = {
"languageCode": "EN",
"sendConfirmation": true
};
// ajax client
$.ajax({
type: "POST",
url: endpointUrl,
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Basic ' + token);
xhr.setRequestHeader('Accept', 'application/json')
},
data: JSON.stringify(payload),
contentType: 'application/json',
success: function(data, statusText, xhr) {
// get cancellation number from response
var cxlNumber = data.cxlNumber;
}
});
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// cancel reservation endpoint url
var endpointUrl = "https://kapip-s.hilton.io/hospitality-partner/v2/dcres/84141916/gnr/100110486/cancel";
// build the payload
var payload = {
"languageCode": "EN",
"sendConfirmation": true
};
// http client
return $http({
method: 'POST',
url: endpointUrl,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + token
},
data: payload
}).then(function(response) {
// retrieve the response
var data = response.data;
// get cancellation number from response
var cxlNumber = data.cxlNumber;
}
})
// your token
var token = "YOUR_BASE64_ENCODED_CLIENTID:CLIENTSECRET";
// create http object
var http = require('https');
// host address
var host = "kapip-s.hilton.io";
var basePath = "/hospitality-partner/v2";
// build the payload
var payload = {
"languageCode": "EN",
"sendConfirmation": true
};
// update reservation endpoint path
var endpointPath = basePath + "/dcres/84141916/gnr/100110486/cancel";
// An object of options to indicate where to put to
var post_options = {
host: host,
path: endpointPath,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic ' + token
}
};
// Set up to post the request
var post_req = http.request(post_options, function(response) {
response.setEncoding("utf8");
var rawData = '';
// process the response object to json
response.on('data', (chunk) => {
rawData += chunk;
});
// parse the json and print the objects
response.on('end', () => {
// retrieve the parsed JSONObject from the response
var jsonObject = JSON.parse(rawData);
// get cancellation number from response
var cxlNumber = jsonObject.cxlNumber;
});
});
// post the data
post_req.write(JSON.stringify(payload));
post_req.end();