This is step 2 of cancelling. Step 1 is
Quote Cancellation, which returns the
penalty and a quote_id. Show the penalty to the user, and only after they
accept, send that quote_id here together with an Idempotency-Key.
Show the final outcome. Read any charge in cancellation_outcome.charge from Get Booking Details.
CANCELLATION_PENDING
The supplier accepted it and is still processing.
Do not tell the guest it is cancelled yet. Poll status, or wait for the booking.cancelled webhook.
CANCELLATION_PENDING can also be the result when the supplier’s answer was
uncertain. Unifystays then verifies the real outcome. The booking stays
CANCELLATION_PENDING until that is known, and available_actions can include
CONTACT_SUPPORT if it cannot be resolved.
The quote is expired, already used, or not for this booking. This also happens when the penalty window changed and the old quote expired.
Request a new quote, show the new penalty, and ask again.
409IDEMPOTENCY_KEY_REUSED
The key was already used with a different quote.
Use a new key for a new quote.
409CANCELLATION_IN_PROGRESS
The same cancellation is still being processed.
Retry after a few seconds, or poll status.
409CANCELLATION_REJECTED
The supplier refused the cancellation. The booking stays active.
Keep the booking as it is and show the current state.
409VALIDATION_ERROR
The booking is not in a cancellable status.
Read the status.
404BOOKING_NOT_FOUND
Unknown booking, or it belongs to another organization.
Check the ID and API key.
501
The supplier does not support cancellation through the API.
Do not offer cancellation.
Retrying with the sameIdempotency-Key and the same quote returns the
same result. It never cancels twice. Calling cancel on a booking that is already
CANCELLED or CANCELLATION_PENDING returns its current state.
If the penalty changes between the quote and the click, the quote is no
longer valid and the cancel call fails with CANCELLATION_QUOTE_INVALID.
Nothing is cancelled. Always request a fresh quote and show the new
penalty before trying again.
penalty_status: UNKNOWN means no reliable amount exists. Do not display it
as zero. Accepting that quote means the user accepts an unknown charge.
Keep the booking_id and the X-Request-Id response header in your support
record.
ISO 4217 currency for display amounts (display_ledger, display_amount, commercial_display). Optional: defaults to your organization's display currency, USD unless configured. Read pricing.display_currency in the response.
false only when the booking status is FAILED. true for every other status, including AWAITING_REVIEW and PROCESSING, which are not confirmations. Read data.status for the real state.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Unifystays API","colors":{"primary":"#0F766E","light":"#14B8A6","dark":"#134E4A"},"navbar":{"links":[{"href":"https://unifystays.com","label":"Portal"},{"href":"mailto:support@unifystays.com","label":"Support"}]},"contextual":{"options":["copy","download-spec","chatgpt","claude"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"unifystays","hasAudioNarration":false,"actualSubdomain":"unifystays","customDomains":["docs.unifystays.com"],"gitSource":{"type":"github","owner":"ronakonline","repo":"unifystay","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ae836724729f9837cf0d8e4","collectionId":"17105c7f-831f-4751-8445-71739bb329ae","liveDeploymentHistoryId":"6ae836724729f9837cf0d8e4","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6ae836724729f9837cf0d8e4","clientVersion":"0.0.4045","searchFilterCounts":[{"language":"default","tag":"API Reference","count":29},{"language":"default","tag":"Guides","count":10},{"language":"default","tag":"Bookings","count":8},{"language":"default","tag":"Search \u0026 hotels","count":7},{"language":"default","tag":"Webhook endpoints","count":7},{"language":"default","tag":"Build your integration","count":5},{"language":"default","tag":"Webhook logs","count":4},{"language":"default","tag":"Get started","count":3},{"language":"default","tag":"Destination \u0026 master data","count":2},{"language":"default","tag":"Operate","count":2}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/cancel-booking","slug":"/api-reference/cancel-booking","pageMetadata":{"title":"Cancel Booking","description":"Request an idempotent cancellation for a confirmed or on-hold booking.","openapi":"reference/openapi.json POST /hotels/book/{booking_id}/cancel","href":"/api-reference/cancel-booking"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Request an idempotent cancellation for a confirmed or on-hold booking.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Heading,Step,Steps,Table,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This is step 2 of cancelling. Step 1 is\n`,_jsx(_components.a,{href:`/api-reference/cancellation-quote`,children:`Quote Cancellation`}),`, which returns the\npenalty and a `,_jsx(_components.code,{children:`quote_id`}),`. Show the penalty to the user, and only after they\naccept, send that `,_jsx(_components.code,{children:`quote_id`}),` here together with an `,_jsx(_components.code,{children:`Idempotency-Key`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-cancellation-flow`,children:`The cancellation flow`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Check that cancelling is possible`,children:_jsxs(_components.p,{children:[`The booking’s `,_jsx(_components.code,{children:`available_actions`}),` (from\n`,_jsx(_components.a,{href:`/api-reference/get-booking-status`,children:`Get Booking Status`}),`) contains `,_jsx(_components.code,{children:`CANCEL`}),`.\nThis is true for `,_jsx(_components.code,{children:`CONFIRMED`}),` and `,_jsx(_components.code,{children:`ON_HOLD`}),` bookings.`]})}),_jsx(Step,{title:`Get a quote`,children:_jsxs(_components.p,{children:[`Call `,_jsx(_components.a,{href:`/api-reference/cancellation-quote`,children:`Quote Cancellation`}),`. Show\n`,_jsx(_components.code,{children:`penalty_status`}),`, `,_jsx(_components.code,{children:`penalty`}),` and the policy to the user.`]})}),_jsx(Step,{title:`Cancel with the quote`,children:_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`cancellation_quote_id`}),` before `,_jsx(_components.code,{children:`expires_at`}),`. Use a new\n`,_jsx(_components.code,{children:`Idempotency-Key`}),` for this cancellation.`]})}),_jsx(Step,{title:`Follow the outcome`,children:_jsxs(_components.p,{children:[`The response is `,_jsx(_components.code,{children:`CANCELLED`}),` or `,_jsx(_components.code,{children:`CANCELLATION_PENDING`}),`. Poll status until\nit is `,_jsx(_components.code,{children:`CANCELLED`}),`.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-example`,children:`Request example`}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`response-example`,children:`Response example`}),`\n`,_jsxs(_components.p,{children:[`The response is a booking status object, the same as\n`,_jsx(_components.a,{href:`/api-reference/get-booking-status`,children:`Get Booking Status`}),`.`]}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`request-fields`,children:`Request fields`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`What it means`}),_jsx(_components.th,{children:`How to use it`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Idempotency-Key`}),` (header)`]}),_jsx(_components.td,{children:`A unique key for this cancellation, up to 128 characters. Required.`}),_jsx(_components.td,{children:`Generate it once per cancellation. Reuse it with the same body when you retry after a timeout.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cancellation_quote_id`}),` (body)`]}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`quote_id`}),` the user accepted.`]}),_jsx(_components.td,{children:`Send it unchanged. It must belong to this booking, be unexpired and unused.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`booking_id`}),` (path)`]}),_jsx(_components.td,{children:`The Unifystays booking ID.`}),_jsx(_components.td,{children:`The booking you quoted.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`outcomes`,children:`Outcomes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status in the response`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CANCELLED`})}),_jsx(_components.td,{children:`The cancellation is complete.`}),_jsxs(_components.td,{children:[`Show the final outcome. Read any charge in `,_jsx(_components.code,{children:`cancellation_outcome.charge`}),` from `,_jsx(_components.a,{href:`/api-reference/get-booking-details`,children:`Get Booking Details`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CANCELLATION_PENDING`})}),_jsx(_components.td,{children:`The supplier accepted it and is still processing.`}),_jsxs(_components.td,{children:[`Do not tell the guest it is cancelled yet. Poll status, or wait for the `,_jsx(_components.code,{children:`booking.cancelled`}),` webhook.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`CANCELLATION_PENDING`}),` can also be the result when the supplier’s answer was\nuncertain. Unifystays then verifies the real outcome. The booking stays\n`,_jsx(_components.code,{children:`CANCELLATION_PENDING`}),` until that is known, and `,_jsx(_components.code,{children:`available_actions`}),` can include\n`,_jsx(_components.code,{children:`CONTACT_SUPPORT`}),` if it cannot be resolved.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors-and-retries`,children:`Errors and retries`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Result`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`CANCELLATION_QUOTE_REQUIRED`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cancellation_quote_id`}),` is missing.`]}),_jsx(_components.td,{children:`Get a quote first.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`IDEMPOTENCY_KEY_REQUIRED`})]}),_jsx(_components.td,{children:`The header is missing.`}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`Idempotency-Key`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`CANCELLATION_QUOTE_INVALID`})]}),_jsx(_components.td,{children:`The quote is expired, already used, or not for this booking. This also happens when the penalty window changed and the old quote expired.`}),_jsx(_components.td,{children:`Request a new quote, show the new penalty, and ask again.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`IDEMPOTENCY_KEY_REUSED`})]}),_jsx(_components.td,{children:`The key was already used with a different quote.`}),_jsx(_components.td,{children:`Use a new key for a new quote.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`CANCELLATION_IN_PROGRESS`})]}),_jsx(_components.td,{children:`The same cancellation is still being processed.`}),_jsx(_components.td,{children:`Retry after a few seconds, or poll status.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`CANCELLATION_REJECTED`})]}),_jsx(_components.td,{children:`The supplier refused the cancellation. The booking stays active.`}),_jsx(_components.td,{children:`Keep the booking as it is and show the current state.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`VALIDATION_ERROR`})]}),_jsx(_components.td,{children:`The booking is not in a cancellable status.`}),_jsx(_components.td,{children:`Read the status.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`404`}),` `,_jsx(_components.code,{children:`BOOKING_NOT_FOUND`})]}),_jsx(_components.td,{children:`Unknown booking, or it belongs to another organization.`}),_jsx(_components.td,{children:`Check the ID and API key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`501`})}),_jsx(_components.td,{children:`The supplier does not support cancellation through the API.`}),_jsx(_components.td,{children:`Do not offer cancellation.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Retrying with the `,_jsx(_components.strong,{children:`same`}),` `,_jsx(_components.code,{children:`Idempotency-Key`}),` and the `,_jsx(_components.strong,{children:`same`}),` quote returns the\nsame result. It never cancels twice. Calling cancel on a booking that is already\n`,_jsx(_components.code,{children:`CANCELLED`}),` or `,_jsx(_components.code,{children:`CANCELLATION_PENDING`}),` returns its current state.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If the penalty changes between the quote and the click, the quote is no\nlonger valid and the cancel call fails with `,_jsx(_components.code,{children:`CANCELLATION_QUOTE_INVALID`}),`.\nNothing is cancelled. Always request a fresh quote and show the new\npenalty before trying again.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`penalty_status: UNKNOWN`}),` means no reliable amount exists. Do not display it\nas zero. Accepting that quote means the user accepts an unknown charge.`]})}),`\n`,_jsxs(_components.p,{children:[`Keep the `,_jsx(_components.code,{children:`booking_id`}),` and the `,_jsx(_components.code,{children:`X-Request-Id`}),` response header in your support\nrecord.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Cancel Booking","description":"Request an idempotent cancellation for a confirmed or on-hold booking.","openapi":"reference/openapi.json POST /hotels/book/{booking_id}/cancel","href":"/api-reference/cancel-booking"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,RequestExample,ResponseExample,Step,Steps,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`This is step 2 of cancelling. Step 1 is\n`,_jsx(_components.a,{href:`/api-reference/cancellation-quote`,children:`Quote Cancellation`}),`, which returns the\npenalty and a `,_jsx(_components.code,{children:`quote_id`}),`. Show the penalty to the user, and only after they\naccept, send that `,_jsx(_components.code,{children:`quote_id`}),` here together with an `,_jsx(_components.code,{children:`Idempotency-Key`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-cancellation-flow`,children:`The cancellation flow`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Check that cancelling is possible`,children:_jsxs(_components.p,{children:[`The booking’s `,_jsx(_components.code,{children:`available_actions`}),` (from\n`,_jsx(_components.a,{href:`/api-reference/get-booking-status`,children:`Get Booking Status`}),`) contains `,_jsx(_components.code,{children:`CANCEL`}),`.\nThis is true for `,_jsx(_components.code,{children:`CONFIRMED`}),` and `,_jsx(_components.code,{children:`ON_HOLD`}),` bookings.`]})}),_jsx(Step,{title:`Get a quote`,children:_jsxs(_components.p,{children:[`Call `,_jsx(_components.a,{href:`/api-reference/cancellation-quote`,children:`Quote Cancellation`}),`. Show\n`,_jsx(_components.code,{children:`penalty_status`}),`, `,_jsx(_components.code,{children:`penalty`}),` and the policy to the user.`]})}),_jsx(Step,{title:`Cancel with the quote`,children:_jsxs(_components.p,{children:[`Send `,_jsx(_components.code,{children:`cancellation_quote_id`}),` before `,_jsx(_components.code,{children:`expires_at`}),`. Use a new\n`,_jsx(_components.code,{children:`Idempotency-Key`}),` for this cancellation.`]})}),_jsx(Step,{title:`Follow the outcome`,children:_jsxs(_components.p,{children:[`The response is `,_jsx(_components.code,{children:`CANCELLED`}),` or `,_jsx(_components.code,{children:`CANCELLATION_PENDING`}),`. Poll status until\nit is `,_jsx(_components.code,{children:`CANCELLED`}),`.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`request-example`,children:`Request example`}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$UNIFYSTAYS_BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/hotels/book/ubk_eGQ0dW9uV1Vi/cancel\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"content-type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$UNIFYSTAYS_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Idempotency-Key: cancel-order-2987349823\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"cancellation_quote_id\":\"cq_6c4f6abf5bbc4c6eae53e0d7411389a8\"}'`})]}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`response-example`,children:`Response example`}),`\n`,_jsxs(_components.p,{children:[`The response is a booking status object, the same as\n`,_jsx(_components.a,{href:`/api-reference/get-booking-status`,children:`Get Booking Status`}),`.`]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:``,numberOfLines:`29`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`29`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"contract_version\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"success\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Cancellation request is pending with supplier.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"data\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"booking_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ubk_eGQ0dW9uV1Vi\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"accepted_offer_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"off_65db5f20d91b47d3a73d834dfa44c50e\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"CANCELLATION_PENDING\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"is_terminal\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"provider\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"TRIPJACK\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"booking_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"TJ202487947162\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"booking_code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hotel_confirmation_number\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"HCN-482910\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hotel_confirmation_status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Confirmed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hotel_confirmation_note\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hotel_contact_phone\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hotel_contact_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"next_poll_after_ms\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`5000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"processing_reason\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"CANCELLATION_PENDING\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"action_required\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"available_actions\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GET_STATUS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"GET_DETAILS\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"review_expires_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hold_deadline_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-04-15T12:12:11.000Z\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"updated_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"2026-05-18T10:01:30.000Z\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`2`,id:`request-fields`,children:`Request fields`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Field`}),_jsx(_components.th,{children:`What it means`}),_jsx(_components.th,{children:`How to use it`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`Idempotency-Key`}),` (header)`]}),_jsx(_components.td,{children:`A unique key for this cancellation, up to 128 characters. Required.`}),_jsx(_components.td,{children:`Generate it once per cancellation. Reuse it with the same body when you retry after a timeout.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cancellation_quote_id`}),` (body)`]}),_jsxs(_components.td,{children:[`The `,_jsx(_components.code,{children:`quote_id`}),` the user accepted.`]}),_jsx(_components.td,{children:`Send it unchanged. It must belong to this booking, be unexpired and unused.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`booking_id`}),` (path)`]}),_jsx(_components.td,{children:`The Unifystays booking ID.`}),_jsx(_components.td,{children:`The booking you quoted.`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`outcomes`,children:`Outcomes`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status in the response`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CANCELLED`})}),_jsx(_components.td,{children:`The cancellation is complete.`}),_jsxs(_components.td,{children:[`Show the final outcome. Read any charge in `,_jsx(_components.code,{children:`cancellation_outcome.charge`}),` from `,_jsx(_components.a,{href:`/api-reference/get-booking-details`,children:`Get Booking Details`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`CANCELLATION_PENDING`})}),_jsx(_components.td,{children:`The supplier accepted it and is still processing.`}),_jsxs(_components.td,{children:[`Do not tell the guest it is cancelled yet. Poll status, or wait for the `,_jsx(_components.code,{children:`booking.cancelled`}),` webhook.`]})]})]})]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`CANCELLATION_PENDING`}),` can also be the result when the supplier’s answer was\nuncertain. Unifystays then verifies the real outcome. The booking stays\n`,_jsx(_components.code,{children:`CANCELLATION_PENDING`}),` until that is known, and `,_jsx(_components.code,{children:`available_actions`}),` can include\n`,_jsx(_components.code,{children:`CONTACT_SUPPORT`}),` if it cannot be resolved.`]}),`\n`,_jsx(Heading,{level:`2`,id:`errors-and-retries`,children:`Errors and retries`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Result`}),_jsx(_components.th,{children:`Meaning`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`CANCELLATION_QUOTE_REQUIRED`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`cancellation_quote_id`}),` is missing.`]}),_jsx(_components.td,{children:`Get a quote first.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`400`}),` `,_jsx(_components.code,{children:`IDEMPOTENCY_KEY_REQUIRED`})]}),_jsx(_components.td,{children:`The header is missing.`}),_jsxs(_components.td,{children:[`Send `,_jsx(_components.code,{children:`Idempotency-Key`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`CANCELLATION_QUOTE_INVALID`})]}),_jsx(_components.td,{children:`The quote is expired, already used, or not for this booking. This also happens when the penalty window changed and the old quote expired.`}),_jsx(_components.td,{children:`Request a new quote, show the new penalty, and ask again.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`IDEMPOTENCY_KEY_REUSED`})]}),_jsx(_components.td,{children:`The key was already used with a different quote.`}),_jsx(_components.td,{children:`Use a new key for a new quote.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`CANCELLATION_IN_PROGRESS`})]}),_jsx(_components.td,{children:`The same cancellation is still being processed.`}),_jsx(_components.td,{children:`Retry after a few seconds, or poll status.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`CANCELLATION_REJECTED`})]}),_jsx(_components.td,{children:`The supplier refused the cancellation. The booking stays active.`}),_jsx(_components.td,{children:`Keep the booking as it is and show the current state.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`409`}),` `,_jsx(_components.code,{children:`VALIDATION_ERROR`})]}),_jsx(_components.td,{children:`The booking is not in a cancellable status.`}),_jsx(_components.td,{children:`Read the status.`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`404`}),` `,_jsx(_components.code,{children:`BOOKING_NOT_FOUND`})]}),_jsx(_components.td,{children:`Unknown booking, or it belongs to another organization.`}),_jsx(_components.td,{children:`Check the ID and API key.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`501`})}),_jsx(_components.td,{children:`The supplier does not support cancellation through the API.`}),_jsx(_components.td,{children:`Do not offer cancellation.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Retrying with the `,_jsx(_components.strong,{children:`same`}),` `,_jsx(_components.code,{children:`Idempotency-Key`}),` and the `,_jsx(_components.strong,{children:`same`}),` quote returns the\nsame result. It never cancels twice. Calling cancel on a booking that is already\n`,_jsx(_components.code,{children:`CANCELLED`}),` or `,_jsx(_components.code,{children:`CANCELLATION_PENDING`}),` returns its current state.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`If the penalty changes between the quote and the click, the quote is no\nlonger valid and the cancel call fails with `,_jsx(_components.code,{children:`CANCELLATION_QUOTE_INVALID`}),`.\nNothing is cancelled. Always request a fresh quote and show the new\npenalty before trying again.`]})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`penalty_status: UNKNOWN`}),` means no reliable amount exists. Do not display it\nas zero. Accepting that quote means the user accepts an unknown charge.`]})}),`\n`,_jsxs(_components.p,{children:[`Keep the `,_jsx(_components.code,{children:`booking_id`}),` and the `,_jsx(_components.code,{children:`X-Request-Id`}),` response header in your support\nrecord.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Cancel Booking","description":"Request an idempotent cancellation for a confirmed or on-hold booking.","openapi":"reference/openapi.json POST /hotels/book/{booking_id}/cancel","href":"/api-reference/cancel-booking"}}}},"mdxExtracts":{"tableOfContents":[{"title":"The cancellation flow","slug":"the-cancellation-flow","depth":2,"children":[]},{"title":"Request example","slug":"request-example","depth":2,"children":[]},{"title":"Response example","slug":"response-example","depth":2,"children":[]},{"title":"Request fields","slug":"request-fields","depth":2,"children":[]},{"title":"Outcomes","slug":"outcomes","depth":2,"children":[]},{"title":"Errors and retries","slug":"errors-and-retries","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">$UNIFYSTAYS_BASE_URL\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">/hotels/book/ubk_eGQ0dW9uV1Vi/cancel\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"content-type: application/json\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-api-key: \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">$UNIFYSTAYS_API_KEY\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Idempotency-Key: cancel-order-2987349823\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -d\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\"cancellation_quote_id\":\"cq_6c4f6abf5bbc4c6eae53e0d7411389a8\"}'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"29\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"contract_version\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"success\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">true\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Cancellation request is pending with supplier.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"data\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"booking_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"ubk_eGQ0dW9uV1Vi\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"accepted_offer_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"off_65db5f20d91b47d3a73d834dfa44c50e\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"CANCELLATION_PENDING\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"is_terminal\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"provider\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"TRIPJACK\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"booking_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"TJ202487947162\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"booking_code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hotel_confirmation_number\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"HCN-482910\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hotel_confirmation_status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Confirmed\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hotel_confirmation_note\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hotel_contact_phone\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hotel_contact_name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"next_poll_after_ms\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">5000\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"processing_reason\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"CANCELLATION_PENDING\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"action_required\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"available_actions\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"GET_STATUS\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"GET_DETAILS\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"review_expires_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"hold_deadline_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"created_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-04-15T12:12:11.000Z\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"updated_at\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"2026-05-18T10:01:30.000Z\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}}},"jsLinks":[],"openApiReferenceData":{"operation":{"description":"Request an idempotent cancellation for a confirmed or on-hold booking.","operationId":"HotelBookingController_cancelBooking","parameters":["e4cbe110-cd5c-4c34-ba35-95aedb47ad0f","e9f3eb40-12a6-40ed-974f-0896571c8cf8","295db566-70bf-4076-a67a-2d653778c7b5","0ccd2a4e-5650-4be5-951a-7fadfe35f397","17804b47-9072-41b1-853c-6cdaee3777c4"],"requestBody":"0611f3db-0913-4182-8876-03af596a2a78","responses":{"200":"4d21b1a4-e015-43d3-adef-c1c76075fb81","404":"1c8dab3f-be57-4ae3-86e4-82d5237a47b3","406":"e292f1ce-da73-47ca-9154-298b289d91dc","409":"4d95e261-c335-4949-8238-9a0c08bbaff2"},"summary":"Cancel a booking","tags":["Hotels"],"method":"post","type":"path","servers":["58b3027e-a79b-4d2c-898a-ec7cc8ae6eae","32e511f6-5caf-4d51-acd6-ad4d164fb151"],"security":["71ce26d4-cf7b-4d3b-ab99-f95701a1c420"],"path":"/hotels/book/{booking_id}/cancel","baseUrlOptions":["https://api-sandbox.unifystays.com","https://api.unifystays.com"],"title":"Cancel a booking","codeSamples":[],"requiredOnlyExamples":false,"requestExamples":[{"dropdown":false,"language":"shellscript","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"shellscript","children":{"type":"code","key":null,"ref":null,"props":{"language":"shellscript","numberOfLines":"5","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#953800","--shiki-dark":"#DCDCAA"},"children":"curl"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" -X"}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" POST"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"$UNIFYSTAYS_BASE_URL"}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"/hotels/book/ubk_eGQ0dW9uV1Vi/cancel\""}},{"type":"span","key":"6","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" -H"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"content-type: application/json\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" -H"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"x-api-key: "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#9CDCFE"},"children":"$UNIFYSTAYS_API_KEY"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\""}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" -H"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" \"Idempotency-Key: cancel-order-2987349823\""}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#CF222E","--shiki-dark":"#D7BA7D"},"children":" \\"}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":" -d"}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":" '{\"cancellation_quote_id\":\"cq_6c4f6abf5bbc4c6eae53e0d7411389a8\"}'"}}]}},"\n"]}}}},"filename":""}],"requestExampleType":"mdx","responseExamples":[{"dropdown":false,"language":"json","code":{"type":"pre","key":null,"ref":null,"props":{"className":"shiki shiki-themes github-light-default dark-plus","style":{"backgroundColor":"#ffffff","--shiki-dark-bg":"#0B0C0E","color":"#1f2328","--shiki-dark":"#D4D4D4"},"language":"json","children":{"type":"code","key":null,"ref":null,"props":{"language":"json","numberOfLines":"29","children":[{"type":"span","key":"0","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"{"}}}},"\n",{"type":"span","key":"2","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"contract_version\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"2\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"4","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"success\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"true"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"6","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"message\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Cancellation request is pending with supplier.\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"8","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"data\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": {"}}]}},"\n",{"type":"span","key":"10","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"booking_id\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"ubk_eGQ0dW9uV1Vi\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"12","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"accepted_offer_id\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"off_65db5f20d91b47d3a73d834dfa44c50e\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"14","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"status\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"CANCELLATION_PENDING\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"16","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"is_terminal\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"false"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"18","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"provider\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": {"}}]}},"\n",{"type":"span","key":"20","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"code\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"TRIPJACK\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"22","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"booking_id\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"TJ202487947162\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"24","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"booking_code\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"null"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"26","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hotel_confirmation_number\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"HCN-482910\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"28","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hotel_confirmation_status\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"Confirmed\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"30","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hotel_confirmation_note\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"null"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"32","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hotel_contact_phone\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"null"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"34","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hotel_contact_name\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"null"}}]}},"\n",{"type":"span","key":"36","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" },"}}}},"\n",{"type":"span","key":"38","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"next_poll_after_ms\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#B5CEA8"},"children":"5000"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"40","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"processing_reason\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"CANCELLATION_PENDING\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"42","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"action_required\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"false"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"44","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"available_actions\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": ["}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"GET_STATUS\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":", "}},{"type":"span","key":"4","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"GET_DETAILS\""}},{"type":"span","key":"5","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"],"}}]}},"\n",{"type":"span","key":"46","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"review_expires_at\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"null"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"48","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"hold_deadline_at\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0550AE","--shiki-dark":"#569CD6"},"children":"null"}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"50","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"created_at\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"2026-04-15T12:12:11.000Z\""}},{"type":"span","key":"3","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":","}}]}},"\n",{"type":"span","key":"52","ref":null,"props":{"className":"line","children":[{"type":"span","key":"0","ref":null,"props":{"style":{"color":"#116329","--shiki-dark":"#9CDCFE"},"children":" \"updated_at\""}},{"type":"span","key":"1","ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":": "}},{"type":"span","key":"2","ref":null,"props":{"style":{"color":"#0A3069","--shiki-dark":"#CE9178"},"children":"\"2026-05-18T10:01:30.000Z\""}}]}},"\n",{"type":"span","key":"54","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":" }"}}}},"\n",{"type":"span","key":"56","ref":null,"props":{"className":"line","children":{"type":"span","key":null,"ref":null,"props":{"style":{"color":"#1F2328","--shiki-dark":"#D4D4D4"},"children":"}"}}}},"\n"]}}}},"filename":""}],"responseExampleType":"mdx"},"dependencies":{"parameters":{"e4cbe110-cd5c-4c34-ba35-95aedb47ad0f":{"name":"booking_id","required":true,"in":"path","description":"Unifystays booking ID returned by Create Booking (ubk_...).","schema":{"example":"ubk_eGQ0dW9uV1Vi","type":"string","isRequired":true,"description":"Unifystays booking ID returned by Create Booking (ubk_...).","uniqueKey":"","typeLabel":"string"}},"e9f3eb40-12a6-40ed-974f-0896571c8cf8":{"name":"Idempotency-Key","in":"header","description":"Unique key (up to 128 characters) for this cancellation attempt. Reuse the same key and the same quote_id when retrying after a timeout.","required":true,"schema":{"type":"string","isRequired":true,"description":"Unique key (up to 128 characters) for this cancellation attempt. Reuse the same key and the same quote_id when retrying after a timeout.","uniqueKey":"","typeLabel":"string"}},"295db566-70bf-4076-a67a-2d653778c7b5":{"name":"language","description":"Enter language code(ex. en)","in":"header","schema":{}},"0ccd2a4e-5650-4be5-951a-7fadfe35f397":{"name":"X-Unifystays-Contract-Version","in":"header","required":false,"description":"Hotel API contract version. Optional: 2 is the current version and the default.","schema":{"type":"string","enum":["2"],"default":"2","isRequired":false,"description":"Hotel API contract version. Optional: 2 is the current version and the default.","uniqueKey":"","typeLabel":"enum\u003cstring>"}},"17804b47-9072-41b1-853c-6cdaee3777c4":{"name":"X-Unifystays-Currency","in":"header","required":false,"description":"ISO 4217 currency for display amounts (display_ledger, display_amount, commercial_display). Optional: defaults to your organization's display currency, USD unless configured. Read pricing.display_currency in the response.","schema":{"type":"string","minLength":3,"maxLength":3,"example":"EUR","isRequired":false,"description":"ISO 4217 currency for display amounts (display_ledger, display_amount, commercial_display). Optional: defaults to your organization's display currency, USD unless configured. Read pricing.display_currency in the response.","uniqueKey":"","typeLabel":"string"}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"cancellation_quote_id":{"type":"string","description":"The quote_id from Cancellation Quote that the user accepted. Must belong to this booking, be unexpired and unused.","example":"cq_6c4f6abf5bbc4c6eae53e0d7411389a8","isRequired":true,"uniqueKey":"cancellation_quote_id","typeLabel":"string"}},"required":["cancellation_quote_id"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"cancellation_quote_id":"cq_6c4f6abf5bbc4c6eae53e0d7411389a8"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"4d21b1a4-e015-43d3-adef-c1c76075fb81":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"contract_version":{"type":"string","example":"2","description":"Response contract version. Always \"2\".","isRequired":true,"uniqueKey":"contract_version","typeLabel":"string"},"success":{"type":"boolean","example":true,"description":"false only when the booking status is FAILED. true for every other status, including AWAITING_REVIEW and PROCESSING, which are not confirmations. Read data.status for the real state.","isRequired":true,"uniqueKey":"success","typeLabel":"boolean"},"message":{"type":"string","example":"Booking request accepted and is being processed.","description":"Human-readable summary for logs and support; for FAILED it carries the reason. Do not parse it; use data.status.","isRequired":true,"uniqueKey":"message","typeLabel":"string"},"data":{"type":"object","description":"The booking's current state.","required":["booking_id","accepted_offer_id","status","is_terminal","provider","next_poll_after_ms","processing_reason","action_required","available_actions","review_expires_at","hold_deadline_at","created_at","updated_at"],"properties":{"booking_id":{"type":"string","example":"ubk_eGQ0dW9uV1Vi","description":"Unifystays booking ID (ubk_...). Use it as the key for status, details, quote and cancel calls. Store it as soon as you receive it.","isRequired":true,"uniqueKey":"data.booking_id","typeLabel":"string"},"accepted_offer_id":{"type":"string","example":"off_65db5f20d91b47d3a73d834dfa44c50e","description":"ID of the offer this booking was made from. Send it back unchanged to Confirm Hold when you confirm a held booking.","isRequired":true,"uniqueKey":"data.accepted_offer_id","typeLabel":"string"},"status":{"type":"string","enum":["AWAITING_REVIEW","PROCESSING","CONFIRMED","ON_HOLD","FAILED","CANCELLATION_PENDING","CANCELLED"],"example":"PROCESSING","description":"AWAITING_REVIEW: waiting for approval in the portal; nothing is booked. PROCESSING: being booked with the supplier. CONFIRMED: booked. ON_HOLD: held; confirm before hold_deadline_at. FAILED: not booked. CANCELLATION_PENDING: cancellation requested, the supplier is still processing it. CANCELLED: cancelled.","isRequired":true,"uniqueKey":"data.status","typeLabel":"enum\u003cstring>"},"is_terminal":{"type":"boolean","example":false,"description":"True for CONFIRMED, ON_HOLD, FAILED and CANCELLED; false for AWAITING_REVIEW, PROCESSING and CANCELLATION_PENDING. Stop polling when true. A terminal booking can still change through your own action (CONFIRMED can be cancelled, ON_HOLD can be confirmed).","isRequired":true,"uniqueKey":"data.is_terminal","typeLabel":"boolean"},"provider":{"type":"object","description":"Supplier and hotel references for this booking.","required":["code","booking_id","booking_code","hotel_confirmation_number","hotel_confirmation_status","hotel_confirmation_note","hotel_contact_phone","hotel_contact_name"],"properties":{"code":{"type":"string","example":"TRIPJACK","description":"Code of the supplier that holds this booking. Informational; do not branch your logic on it.","isRequired":true,"uniqueKey":"data.provider.code","typeLabel":"string"},"booking_id":{"oneOf":[{"type":"object","example":"100055869","description":"Supplier's primary booking/order ID, used to locate the reservation at the supplier. Null until the supplier assigns it. Store it and quote it to support.","isRequired":true,"uniqueKey":"data.provider.booking_id.oneOf.0","typeLabel":"object"},{"type":"null","example":"100055869","description":"Supplier's primary booking/order ID, used to locate the reservation at the supplier. Null until the supplier assigns it. Store it and quote it to support.","isRequired":true,"uniqueKey":"data.provider.booking_id.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.booking_id","typeLabel":"object | null"},"booking_code":{"oneOf":[{"type":"object","example":"REZ6A5A81E9","description":"Supplier's distinct secondary booking code. Null when the supplier returns only one reference. Not interchangeable with booking_id.","isRequired":true,"uniqueKey":"data.provider.booking_code.oneOf.0","typeLabel":"object"},{"type":"null","example":"REZ6A5A81E9","description":"Supplier's distinct secondary booking code. Null when the supplier returns only one reference. Not interchangeable with booking_id.","isRequired":true,"uniqueKey":"data.provider.booking_code.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.booking_code","typeLabel":"object | null"},"hotel_confirmation_number":{"oneOf":[{"type":"object","example":"HCN-482910","description":"The hotel's own confirmation number. Null until the property confirms; it may arrive after the booking is CONFIRMED, so keep reading the status. Show it to the guest when present.","isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_number.oneOf.0","typeLabel":"object"},{"type":"null","example":"HCN-482910","description":"The hotel's own confirmation number. Null until the property confirms; it may arrive after the booking is CONFIRMED, so keep reading the status. Show it to the guest when present.","isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_number.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_number","typeLabel":"object | null"},"hotel_confirmation_status":{"oneOf":[{"type":"object","example":"Confirmed","description":"Supplier-defined text for the state of the hotel confirmation. Display only; do not parse it. Null when not reported.","isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_status.oneOf.0","typeLabel":"object"},{"type":"null","example":"Confirmed","description":"Supplier-defined text for the state of the hotel confirmation. Display only; do not parse it. Null when not reported.","isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_status.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_status","typeLabel":"object | null"},"hotel_confirmation_note":{"oneOf":[{"type":"object","description":"Free-text note from the hotel or supplier about the confirmation. Show it to support or the guest when present. Null otherwise.","isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_note.oneOf.0","typeLabel":"object"},{"type":"null","description":"Free-text note from the hotel or supplier about the confirmation. Show it to support or the guest when present. Null otherwise.","isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_note.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.hotel_confirmation_note","typeLabel":"object | null"},"hotel_contact_phone":{"oneOf":[{"type":"object","description":"Phone number of the hotel contact for this booking, when the supplier provides one. Null otherwise.","isRequired":true,"uniqueKey":"data.provider.hotel_contact_phone.oneOf.0","typeLabel":"object"},{"type":"null","description":"Phone number of the hotel contact for this booking, when the supplier provides one. Null otherwise.","isRequired":true,"uniqueKey":"data.provider.hotel_contact_phone.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.hotel_contact_phone","typeLabel":"object | null"},"hotel_contact_name":{"oneOf":[{"type":"object","description":"Name of the hotel contact for this booking, when the supplier provides one. Null otherwise.","isRequired":true,"uniqueKey":"data.provider.hotel_contact_name.oneOf.0","typeLabel":"object"},{"type":"null","description":"Name of the hotel contact for this booking, when the supplier provides one. Null otherwise.","isRequired":true,"uniqueKey":"data.provider.hotel_contact_name.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.provider.hotel_contact_name","typeLabel":"object | null"}},"isRequired":true,"uniqueKey":"data.provider","typeLabel":"object"},"next_poll_after_ms":{"oneOf":[{"type":"object","description":"Milliseconds to wait before polling status again. Null when no poll is scheduled: terminal bookings, bookings waiting for a person (AWAITING_REVIEW), and the first moments of a PROCESSING booking. If a PROCESSING booking shows null, wait about 5 seconds. Null does not mean confirmed.","example":5000,"isRequired":true,"uniqueKey":"data.next_poll_after_ms.oneOf.0","typeLabel":"object"},{"type":"null","description":"Milliseconds to wait before polling status again. Null when no poll is scheduled: terminal bookings, bookings waiting for a person (AWAITING_REVIEW), and the first moments of a PROCESSING booking. If a PROCESSING booking shows null, wait about 5 seconds. Null does not mean confirmed.","example":5000,"isRequired":true,"uniqueKey":"data.next_poll_after_ms.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.next_poll_after_ms","typeLabel":"object | null"},"processing_reason":{"oneOf":[{"type":"string","enum":["SUPPLIER_CONFIRMATION_PENDING","HOTEL_CONFIRMATION_PENDING","CANCELLATION_PENDING","RECONCILIATION_REQUIRED","HOLD_CONFIRMATION_REQUIRED","MANUAL_REVIEW_REQUIRED","MANAGED_FULFILLMENT_PENDING"],"description":"Why the booking is not simply done, or null when nothing is pending. SUPPLIER_CONFIRMATION_PENDING: waiting for the supplier. HOTEL_CONFIRMATION_PENDING: supplier confirmed, hotel number not yet received. CANCELLATION_PENDING: supplier is processing a cancellation. RECONCILIATION_REQUIRED: the outcome is uncertain and Unifystays is verifying it; contact support if it does not clear. HOLD_CONFIRMATION_REQUIRED: on hold, needs confirming. MANUAL_REVIEW_REQUIRED: waiting for approval in the portal. MANAGED_FULFILLMENT_PENDING: recorded but not yet submitted to a supplier.","example":"SUPPLIER_CONFIRMATION_PENDING","isRequired":true,"uniqueKey":"data.processing_reason.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["SUPPLIER_CONFIRMATION_PENDING","HOTEL_CONFIRMATION_PENDING","CANCELLATION_PENDING","RECONCILIATION_REQUIRED","HOLD_CONFIRMATION_REQUIRED","MANUAL_REVIEW_REQUIRED","MANAGED_FULFILLMENT_PENDING"],"description":"Why the booking is not simply done, or null when nothing is pending. SUPPLIER_CONFIRMATION_PENDING: waiting for the supplier. HOTEL_CONFIRMATION_PENDING: supplier confirmed, hotel number not yet received. CANCELLATION_PENDING: supplier is processing a cancellation. RECONCILIATION_REQUIRED: the outcome is uncertain and Unifystays is verifying it; contact support if it does not clear. HOLD_CONFIRMATION_REQUIRED: on hold, needs confirming. MANUAL_REVIEW_REQUIRED: waiting for approval in the portal. MANAGED_FULFILLMENT_PENDING: recorded but not yet submitted to a supplier.","example":"SUPPLIER_CONFIRMATION_PENDING","isRequired":true,"uniqueKey":"data.processing_reason.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.processing_reason","typeLabel":"enum\u003cstring> | null"},"action_required":{"type":"boolean","example":false,"description":"True when a person must act: available_actions contains CONFIRM_HOLD, CONTACT_SUPPORT or REVIEW_BOOKING. False means waiting or polling is enough.","isRequired":true,"uniqueKey":"data.action_required","typeLabel":"boolean"},"available_actions":{"type":"array","example":["GET_STATUS","GET_DETAILS"],"description":"What you can do now. GET_STATUS: keep polling (listed while the booking is not terminal, and during CANCELLATION_PENDING). GET_DETAILS: details are readable. CANCEL: request a cancellation quote, then cancel. CONFIRM_HOLD: call Confirm Hold. CONTACT_SUPPORT: the outcome needs Unifystays support. REVIEW_BOOKING: approve or reject in the portal.","items":{"type":"string","enum":["GET_STATUS","GET_DETAILS","CANCEL","CONFIRM_HOLD","CONTACT_SUPPORT","REVIEW_BOOKING"],"uniqueKey":"data.available_actions.items.[INDEX]","typeLabel":"enum\u003cstring>"},"isRequired":true,"uniqueKey":"data.available_actions","typeLabel":"enum\u003cstring>[]"},"review_expires_at":{"oneOf":[{"type":"string","example":null,"description":"Deadline of the prebooked offer's supplier quote (ISO 8601, UTC); the prebooking_id stops being valid then. It matters most for AWAITING_REVIEW: after it passes the request stays pending until a reviewer approves a fresh quote, so do not cancel or refund the guest because of it. Null when no deadline is recorded.","isRequired":true,"uniqueKey":"data.review_expires_at.oneOf.0","typeLabel":"string"},{"type":"null","example":null,"description":"Deadline of the prebooked offer's supplier quote (ISO 8601, UTC); the prebooking_id stops being valid then. It matters most for AWAITING_REVIEW: after it passes the request stays pending until a reviewer approves a fresh quote, so do not cancel or refund the guest because of it. Null when no deadline is recorded.","isRequired":true,"uniqueKey":"data.review_expires_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.review_expires_at","typeLabel":"string | null"},"hold_deadline_at":{"oneOf":[{"type":"string","example":null,"description":"Time by which a held booking must be confirmed (ISO 8601, UTC). Meaningful for bookings created with booking_mode HOLD; null when there is no hold deadline. After it passes Confirm Hold is refused, and the hold is closed as FAILED (HOLD_DEADLINE_EXPIRED) unless the supplier reports it confirmed.","isRequired":true,"uniqueKey":"data.hold_deadline_at.oneOf.0","typeLabel":"string"},{"type":"null","example":null,"description":"Time by which a held booking must be confirmed (ISO 8601, UTC). Meaningful for bookings created with booking_mode HOLD; null when there is no hold deadline. After it passes Confirm Hold is refused, and the hold is closed as FAILED (HOLD_DEADLINE_EXPIRED) unless the supplier reports it confirmed.","isRequired":true,"uniqueKey":"data.hold_deadline_at.oneOf.1","typeLabel":"null"}],"isRequired":true,"uniqueKey":"data.hold_deadline_at","typeLabel":"string | null"},"created_at":{"type":"string","example":"2026-04-15T12:12:11.000Z","description":"When the booking was created (ISO 8601, UTC).","isRequired":true,"uniqueKey":"data.created_at","typeLabel":"string"},"updated_at":{"type":"string","example":"2026-04-15T12:15:11.000Z","description":"When the booking last changed (ISO 8601, UTC).","isRequired":true,"uniqueKey":"data.updated_at","typeLabel":"string"}},"isRequired":true,"uniqueKey":"data","typeLabel":"object"}},"required":["contract_version","success","message","data"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"contract_version":"2","success":true,"message":"Booking request accepted and is being processed.","data":{"booking_id":"ubk_eGQ0dW9uV1Vi","accepted_offer_id":"off_65db5f20d91b47d3a73d834dfa44c50e","status":"PROCESSING","is_terminal":false,"provider":{"code":"TRIPJACK","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":false,"available_actions":["GET_STATUS","GET_DETAILS"],"review_expires_at":null,"hold_deadline_at":null,"created_at":"2026-04-15T12:12:11.000Z","updated_at":"2026-04-15T12:15:11.000Z"}}}},"exampleType":"generated"}},"headers":{"X-Unifystays-Contract-Version":{"description":"Hotel contract version of this response.","schema":{"type":"string","enum":["2"]}}},"exampleType":"generated"},"1c8dab3f-be57-4ae3-86e4-82d5237a47b3":{"description":"Booking not found.","headers":{"X-Unifystays-Contract-Version":{"description":"Hotel contract version of this response.","schema":{"type":"string","enum":["2"]}}},"content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"e292f1ce-da73-47ca-9154-298b289d91dc":{"description":"CONTRACT_VERSION_UNSUPPORTED","headers":{"X-Unifystays-Contract-Version":{"description":"Hotel contract version of this response.","schema":{"type":"string","enum":["2"]}}},"content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"4d95e261-c335-4949-8238-9a0c08bbaff2":{"description":"CANCELLATION_QUOTE_INVALID (quote expired, used or not for this booking: request a new quote), IDEMPOTENCY_KEY_REUSED, CANCELLATION_IN_PROGRESS (retry after a few seconds), CANCELLATION_REJECTED (the supplier refused; the booking stays active), or the booking is not in a cancellable status.","headers":{"X-Unifystays-Contract-Version":{"description":"Hotel contract version of this response.","schema":{"type":"string","enum":["2"]}}},"content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"71ce26d4-cf7b-4d3b-ab99-f95701a1c420":{"x-api-key":{"type":"apiKey","in":"header","name":"x-api-key","description":"Environment-specific API key created in the Unifystays portal","scopes":[],"schemeName":"x-api-key"}}},"servers":{"58b3027e-a79b-4d2c-898a-ec7cc8ae6eae":{"url":"https://api-sandbox.unifystays.com","description":"Sandbox"},"32e511f6-5caf-4d51-acd6-ad4d164fb151":{"url":"https://api.unifystays.com","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"Environment-specific API key created in the Unifystays portal","scopes":[],"schemeName":"x-api-key"},"schema":{"title":"x-api-key","type":"string","description":"Environment-specific API key created in the Unifystays portal","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"x-api-key","name":"x-api-key"}],"title":"x-api-key"}]},"originalFileLocation":"reference/openapi.json"},"subdomain":"unifystays","siteName":"Unifystays API","title":"Cancel Booking - Unifystays API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-08T16:56:41.402Z","originalFileLocation":"api-reference/cancel-booking.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Request an idempotent cancellation for a confirmed or on-hold booking.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Unifystays API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/apple-touch-icon.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/favicon-32x32.png?v=3\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/favicon-16x16.png?v=3\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/favicon.ico?v=3\">\u003cmeta data-mint-head property=\"og:title\" content=\"Cancel Booking - Unifystays API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Request an idempotent cancellation for a confirmed or on-hold booking.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Unifystays API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.unifystays.com/api-reference/cancel-booking\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://unifystays.mintlify.app/_mintlify/api/og/v2?division=Bookings\u0026amp;title=Cancel+Booking\u0026amp;description=Request+an+idempotent+cancellation+for+a+confirmed+or+on-hold+booking.\u0026amp;theme=8157bd32ddef625e2bd30aba\u0026amp;signature=d4b2844c92470d9b5e5af91b96bf7e7aed90aef94c338278039a4950ba2de707\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Cancel Booking - Unifystays API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Request an idempotent cancellation for a confirmed or on-hold booking.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://unifystays.mintlify.app/_mintlify/api/og/v2?division=Bookings\u0026amp;title=Cancel+Booking\u0026amp;description=Request+an+idempotent+cancellation+for+a+confirmed+or+on-hold+booking.\u0026amp;theme=8157bd32ddef625e2bd30aba\u0026amp;signature=d4b2844c92470d9b5e5af91b96bf7e7aed90aef94c338278039a4950ba2de707\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"https://mintlify.s3.us-west-1.amazonaws.com/unifystays/_generated/favicon/browserconfig.xml?v=3\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Unifystays API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0F766E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.unifystays.com/api-reference/cancel-booking\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/cancel-booking.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.unifystays.com/#organization\",\"name\":\"Unifystays API\",\"url\":\"https://docs.unifystays.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.unifystays.com#website\",\"name\":\"Unifystays API\",\"url\":\"https://docs.unifystays.com\",\"publisher\":{\"@id\":\"https://docs.unifystays.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.unifystays.com/api-reference/cancel-booking#webpage\",\"url\":\"https://docs.unifystays.com/api-reference/cancel-booking\",\"name\":\"Cancel Booking\",\"description\":\"Request an idempotent cancellation for a confirmed or on-hold booking.\",\"dateModified\":\"2026-10-08T16:56:41.402Z\",\"isPartOf\":{\"@id\":\"https://docs.unifystays.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.unifystays.com/api-reference/cancel-booking#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.unifystays.com/api-reference/cancel-booking#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Bookings\",\"item\":\"https://docs.unifystays.com/api-reference/create-booking\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cancel Booking\",\"item\":\"https://docs.unifystays.com/api-reference/cancel-booking\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.unifystays.com/api-reference/cancel-booking#apireference\",\"headline\":\"Cancel Booking\",\"name\":\"Cancel Booking\",\"description\":\"Request an idempotent cancellation for a confirmed or on-hold booking.\",\"url\":\"https://docs.unifystays.com/api-reference/cancel-booking\",\"mainEntityOfPage\":{\"@id\":\"https://docs.unifystays.com/api-reference/cancel-booking#webpage\"},\"dateModified\":\"2026-10-08T16:56:41.402Z\",\"publisher\":{\"@id\":\"https://docs.unifystays.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.unifystays.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Unifystays API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Unifystays API","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"Overview","href":"/api-reference/overview"}]},{"group":"Destination \u0026 master data","pages":[{"title":"Destination Autocomplete","openapi":"reference/openapi.json GET /destinations/autocomplete","href":"/api-reference/destination-autocomplete"},{"title":"List Nationalities","openapi":"reference/openapi.json GET /master-data/nationalities","href":"/api-reference/nationalities"}]},{"group":"Search \u0026 hotels","pages":[{"title":"Get Hotel Filters","openapi":"reference/openapi.json GET /hotels/filters","href":"/api-reference/hotel-filters"},{"title":"Search Hotels","openapi":"reference/openapi.json POST /hotels/search","href":"/api-reference/search-hotels"},{"title":"Get Search Price Updates","openapi":"reference/openapi.json GET /hotels/search/{searchId}/prices","href":"/api-reference/search-price-updates"},{"title":"Get Hotel Content","openapi":"reference/openapi.json GET /hotels/{hotelId}/content","href":"/api-reference/hotel-content"},{"title":"Get Room Options","openapi":"reference/openapi.json POST /hotels/{hotel_id}/rooms","href":"/api-reference/hotel-rooms"},{"title":"Stream Room Updates","openapi":"reference/openapi.json GET /hotels/{hotel_id}/rooms/stream/{stream_id}","href":"/api-reference/hotel-room-stream"},{"title":"Prebook a Room","openapi":"reference/openapi.json POST /hotels/prebook","href":"/api-reference/prebook"}]},{"group":"Bookings","pages":[{"title":"Create Booking","openapi":"reference/openapi.json POST /hotels/book","href":"/api-reference/create-booking"},{"title":"Confirm Hold","openapi":"reference/openapi.json POST /hotels/book/{booking_id}/confirm-hold","href":"/api-reference/confirm-hold"},{"title":"List Bookings","openapi":"reference/openapi.json GET /hotels/book","href":"/api-reference/list-bookings"},{"title":"Get Booking Status","openapi":"reference/openapi.json GET /hotels/book/{booking_id}","href":"/api-reference/get-booking-status"},{"title":"Find Booking by Idempotency-Key","openapi":"reference/openapi.json GET /hotels/book/by-idempotency-key","href":"/api-reference/get-booking-by-idempotency-key"},{"title":"Get Booking Details","openapi":"reference/openapi.json GET /hotels/book/{booking_id}/details","href":"/api-reference/get-booking-details"},{"title":"Quote Cancellation","description":"Retrieve and lock the current cancellation consequence before cancelling.","openapi":"reference/openapi.json POST /hotels/book/{booking_id}/cancellation-quote","href":"/api-reference/cancellation-quote"},{"title":"Cancel Booking","openapi":"reference/openapi.json POST /hotels/book/{booking_id}/cancel","href":"/api-reference/cancel-booking"}]},{"group":"Webhook endpoints","pages":[{"title":"Create Webhook Endpoint","description":"Register a webhook URL, choose its events, and receive its one-time signing secret.","openapi":"reference/openapi.json POST /webhooks/endpoints","href":"/api-reference/webhooks/create-endpoint"},{"title":"List Webhook Endpoints","openapi":"reference/openapi.json GET /webhooks/endpoints","href":"/api-reference/webhooks/list-endpoints"},{"title":"Get Webhook Endpoint","openapi":"reference/openapi.json GET /webhooks/endpoints/{endpoint_id}","href":"/api-reference/webhooks/get-endpoint"},{"title":"Update Webhook Endpoint","openapi":"reference/openapi.json PATCH /webhooks/endpoints/{endpoint_id}","href":"/api-reference/webhooks/update-endpoint"},{"title":"Delete Webhook Endpoint","openapi":"reference/openapi.json DELETE /webhooks/endpoints/{endpoint_id}","href":"/api-reference/webhooks/delete-endpoint"},{"title":"Rotate Webhook Secret","openapi":"reference/openapi.json POST /webhooks/endpoints/{endpoint_id}/rotate-secret","href":"/api-reference/webhooks/rotate-secret"},{"title":"Send Test Webhook","openapi":"reference/openapi.json POST /webhooks/endpoints/{endpoint_id}/test","href":"/api-reference/webhooks/test-endpoint"}]},{"group":"Webhook logs","pages":[{"title":"List Webhook Events","openapi":"reference/openapi.json GET /webhooks/events","href":"/api-reference/webhooks/list-events"},{"title":"List Webhook Deliveries","openapi":"reference/openapi.json GET /webhooks/deliveries","href":"/api-reference/webhooks/list-deliveries"},{"title":"Get Webhook Delivery","openapi":"reference/openapi.json GET /webhooks/deliveries/{delivery_id}","href":"/api-reference/webhooks/get-delivery"},{"title":"Replay Webhook Delivery","openapi":"reference/openapi.json POST /webhooks/deliveries/{delivery_id}/replay","href":"/api-reference/webhooks/replay-delivery"}]}]}]},"basePath":"","title":"Cancel Booking - Unifystays API","buildId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","deploymentId":"dpl_36EDyZCDfRuoUD9af5CH4M1bqY2h","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DCDCdBVX.js","utils-ME8dDnLe.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-0e84ACsd.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-wgRBj-ia.js","snippetPresets-C11Sgb-o.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-C0lapOpP.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-ZeRQV8fF.js","shallow-BupWh095.js","getApiPlaygroundDisplay-BnYQO2Ss.js","CodeSnippet-RKKOc8c_.js","CodeSnippets-Drf_m8wS.js","Page-Bevw23-4.js","getPastedJson-u6QiPzNZ.js","icon-Bb-CBSxO.js","MethodPill-F7l5AI7V.js","DuplicateIcon-IiAXkdSg.js","createIcon-FliI8EBc.js","DynamicMarkdown-B62XqCSI.js","SectionHeading-Dj31pT03.js","axios-vUo_bRtp.js","Markdown-BOgQCTwD.js","clsx-BIWXJmsZ.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-DKZWslLH.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-UDqbR6xh.js"]}