Skip to main content
POST
Cancelling is a two-step flow. This is step 1. It tells you what cancelling costs right now and gives you a quote_id. Show the penalty to the user. If they accept, send the quote_id to Cancel Booking. You cannot cancel without a quote. Call it when the user asks to cancel, not earlier. A quote is short-lived, and the penalty can change as the cancellation deadline passes.

Request example

No request body is needed.

Response example

Penalty status

penalty.amount_minor is an integer in minor units. With currency_exponent 2, 17700 means 177.00. The currency is the booking’s currency.

Field guide

What can go wrong

A quote is valid only until expires_at and for one cancellation. If the penalty changes before the user decides (for example a free-cancellation deadline passes), the old quote is rejected by Cancel Booking with CANCELLATION_QUOTE_INVALID. Request a new quote and show the new penalty.
Requesting a quote does not cancel anything. You can request as many quotes as you like.

Next step

Show the penalty. When the user confirms, call Cancel Booking with the quote_id.

Authorizations

x-api-key
string
header
required

Environment-specific API key created in the Unifystays portal

Headers

X-Unifystays-Contract-Version
enum<string>
default:2

Hotel API contract version. Optional: 2 is the current version and the default.

Available options:
2

Path Parameters

booking_id
string
required

Unifystays booking ID returned by Create Booking (ubk_...).

Example:

"ubk_eGQ0dW9uV1Vi"

Response

contract_version
string
required

Response contract version.

Example:

"2"

success
boolean
required

True when the quote was issued.

Example:

true

message
string
required

Human-readable summary. Do not parse it.

Example:

"Cancellation consequence quoted successfully."

data
object
required

The cancellation quote.