curl "$UNIFYSTAYS_BASE_URL/hotels/book/ubk_eGQ0dW9uV1Vi/cancel" \
-X POST \
-H "content-type: application/json" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "Idempotency-Key: cancel-order-2987349823" \
-d '{"cancellation_quote_id":"cq_6c4f6abf5bbc4c6eae53e0d7411389a8"}'
{
"contract_version": "1",
"success": true,
"message": "Booking request accepted and is being processed.",
"data": {
"booking_id": "ubk_eGQ0dW9uV1Vi",
"accepted_offer_id": "off_01J...",
"status": "PROCESSING",
"is_terminal": false,
"provider": {
"code": "TBO",
"booking_id": "100055869",
"booking_code": "REZ6A5A81E9",
"hotel_confirmation_number": "HCN-482910",
"hotel_confirmation_status": "Confirmed",
"hotel_confirmation_note": {},
"hotel_contact_phone": {},
"hotel_contact_name": {}
},
"next_poll_after_ms": 5000,
"processing_reason": "SUPPLIER_CONFIRMATION_PENDING",
"action_required": true,
"available_actions": [
"GET_STATUS"
],
"hold_deadline_at": "<string>",
"created_at": "2026-04-15T12:12:11.000Z",
"updated_at": "2026-04-15T12:12:11.000Z",
"review_expires_at": "<string>"
}
}Bookings
Cancel Booking
Request an idempotent cancellation for a confirmed or on-hold booking.
POST
/
hotels
/
book
/
{booking_id}
/
cancel
curl "$UNIFYSTAYS_BASE_URL/hotels/book/ubk_eGQ0dW9uV1Vi/cancel" \
-X POST \
-H "content-type: application/json" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "Idempotency-Key: cancel-order-2987349823" \
-d '{"cancellation_quote_id":"cq_6c4f6abf5bbc4c6eae53e0d7411389a8"}'
{
"contract_version": "1",
"success": true,
"message": "Booking request accepted and is being processed.",
"data": {
"booking_id": "ubk_eGQ0dW9uV1Vi",
"accepted_offer_id": "off_01J...",
"status": "PROCESSING",
"is_terminal": false,
"provider": {
"code": "TBO",
"booking_id": "100055869",
"booking_code": "REZ6A5A81E9",
"hotel_confirmation_number": "HCN-482910",
"hotel_confirmation_status": "Confirmed",
"hotel_confirmation_note": {},
"hotel_contact_phone": {},
"hotel_contact_name": {}
},
"next_poll_after_ms": 5000,
"processing_reason": "SUPPLIER_CONFIRMATION_PENDING",
"action_required": true,
"available_actions": [
"GET_STATUS"
],
"hold_deadline_at": "<string>",
"created_at": "2026-04-15T12:12:11.000Z",
"updated_at": "2026-04-15T12:12:11.000Z",
"review_expires_at": "<string>"
}
}First obtain a short-lived cancellation quote from
Keep the returned
The OpenAPI section below documents the required booking ID, success response,
and error response.
POST /hotels/book/{booking_id}/cancellation-quote. Show its current penalty
and policy to the user, then pass the returned quote_id to this endpoint.
The cancel request also requires an Idempotency-Key; reuse the same key and
body after an uncertain network result.
Request Example
curl "$UNIFYSTAYS_BASE_URL/hotels/book/ubk_eGQ0dW9uV1Vi/cancel" \
-X POST \
-H "content-type: application/json" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "Idempotency-Key: cancel-order-2987349823" \
-d '{"cancellation_quote_id":"cq_6c4f6abf5bbc4c6eae53e0d7411389a8"}'
Handle Cancellation State
| Status | Meaning | Next action |
|---|---|---|
CANCELLED | The supplier cancellation is complete. | Show the final cancellation outcome. |
CANCELLATION_PENDING | The supplier is processing cancellation asynchronously. | Poll Get Booking Status. |
booking_id and request ID in your support record. If the
request returns CANCELLATION_PENDING, do not assume the booking is cancelled
until status polling reports CANCELLED or another final state.
penalty_status: UNKNOWN means the supplier does not expose a reliably
computable amount. Do not display it as zero. Accepting that quote explicitly
acknowledges the uncertainty.Authorizations
Environment-specific API key created in the Unifystays portal
Headers
Unique key for this cancellation attempt.
Hotel API contract version. Missing defaults to v1.
Available options:
1 Path Parameters
Example:
"ubk_eGQ0dW9uV1Vi"
Body
application/json
Cancellation quote being explicitly accepted. Obtain it immediately beforehand from the cancellation-quote endpoint.