Quote the current cancellation consequence
curl --request POST \
--url https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote \
--header 'x-api-key: <api-key>'import requests
url = "https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"contract_version": "1",
"success": true,
"message": "<string>",
"data": {
"quote_id": "<string>",
"booking_id": "<string>",
"accepted_offer_id": "<string>",
"expires_at": "<string>",
"cancellable": true,
"penalty_status": "NO_CHARGE",
"penalty": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"cancellation": {
"refundability": "REFUNDABLE",
"policy_stage": "INDICATIVE",
"free_cancellation_until": {
"local_datetime": "2026-05-18T23:59:59",
"timezone": "UTC",
"utc_datetime": "2026-05-18T23:59:59.000Z"
},
"policy_text": "<string>",
"penalties": [
{
"from": {
"local_datetime": "2026-05-18T23:59:59",
"timezone": "UTC",
"utc_datetime": "2026-05-18T23:59:59.000Z"
},
"to": {
"local_datetime": "2026-05-18T23:59:59",
"timezone": "UTC",
"utc_datetime": "2026-05-18T23:59:59.000Z"
},
"charge_basis": "FIXED_AMOUNT",
"percentage": 123,
"number_of_nights": 123,
"native_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"usd_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"conversion_status": "AVAILABLE",
"description": "<string>",
"calculation_basis": "TOTAL",
"scope": {
"basis": "PER_STAY",
"room_allocation_id": "<string>",
"guest_type": "ADULT",
"quantity": 123
}
}
],
"no_show": {
"trigger": "NO_SHOW",
"applies_from_local_time": "18:00:00",
"penalty": {
"charge_basis": "FIXED_AMOUNT",
"native_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"usd_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"conversion_status": "AVAILABLE",
"calculation_basis": "SUPPLIER_DEFINED",
"scope": {
"basis": "PER_STAY",
"room_allocation_id": "<string>",
"guest_type": "ADULT",
"quantity": 123
}
}
}
}
}
}Bookings
Quote Cancellation
Retrieve and lock the current cancellation consequence before cancelling.
POST
/
hotels
/
book
/
{booking_id}
/
cancellation-quote
Quote the current cancellation consequence
curl --request POST \
--url https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote \
--header 'x-api-key: <api-key>'import requests
url = "https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.unifystays.com/hotels/book/{booking_id}/cancellation-quote")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"contract_version": "1",
"success": true,
"message": "<string>",
"data": {
"quote_id": "<string>",
"booking_id": "<string>",
"accepted_offer_id": "<string>",
"expires_at": "<string>",
"cancellable": true,
"penalty_status": "NO_CHARGE",
"penalty": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"cancellation": {
"refundability": "REFUNDABLE",
"policy_stage": "INDICATIVE",
"free_cancellation_until": {
"local_datetime": "2026-05-18T23:59:59",
"timezone": "UTC",
"utc_datetime": "2026-05-18T23:59:59.000Z"
},
"policy_text": "<string>",
"penalties": [
{
"from": {
"local_datetime": "2026-05-18T23:59:59",
"timezone": "UTC",
"utc_datetime": "2026-05-18T23:59:59.000Z"
},
"to": {
"local_datetime": "2026-05-18T23:59:59",
"timezone": "UTC",
"utc_datetime": "2026-05-18T23:59:59.000Z"
},
"charge_basis": "FIXED_AMOUNT",
"percentage": 123,
"number_of_nights": 123,
"native_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"usd_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"conversion_status": "AVAILABLE",
"description": "<string>",
"calculation_basis": "TOTAL",
"scope": {
"basis": "PER_STAY",
"room_allocation_id": "<string>",
"guest_type": "ADULT",
"quantity": 123
}
}
],
"no_show": {
"trigger": "NO_SHOW",
"applies_from_local_time": "18:00:00",
"penalty": {
"charge_basis": "FIXED_AMOUNT",
"native_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"usd_amount": {
"amount_minor": 17700,
"currency": "USD",
"currency_exponent": 2
},
"conversion_status": "AVAILABLE",
"calculation_basis": "SUPPLIER_DEFINED",
"scope": {
"basis": "PER_STAY",
"room_allocation_id": "<string>",
"guest_type": "ADULT",
"quantity": 123
}
}
}
}
}
}Call this immediately before cancellation. The response contains a short-lived
The quote expires after five minutes or at the next known cancellation-policy
boundary, whichever happens first. Submit its
quote_id, the accepted offer ID, the current normalized cancellation policy,
and one of these penalty states:
| State | Meaning |
|---|---|
NO_CHARGE | The current known penalty is zero. |
KNOWN | penalty contains the supplier-currency Money amount. |
UNKNOWN | No reliable current amount can be computed; penalty is null, never zero. |
quote_id unchanged to
Cancel Booking.Authorizations
Environment-specific API key created in the Unifystays portal
Headers
Hotel API contract version. Missing defaults to v1.
Available options:
1