> For the complete documentation index, see [llms.txt](https://partner-docs.covergenius.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://partner-docs.covergenius.com/offers/api/reference/confirm-booking.md).

# Confirm Booking

## Confirm Booking

> Completes the second step of the two-step booking flow. Use this endpoint after confirming an Offer with \`require\_payment\_confirmation\` set to \`true\`, which leaves the booking in \`PENDING\_PAYMENT\`. Once payment has been collected, call this endpoint to move the booking to \`CONFIRMED\` and issue the policies.\
> The booking must be in \`PENDING\_PAYMENT\` status; any other status returns \`422\`.\
> \### Idempotency\
> This endpoint supports idempotency keys via the \`x-idempotency-key\` header to prevent duplicate transactions. Provide a unique operation identifier (e.g., UUID) to ensure safe retries. Duplicate requests return:\
> \- \*\*409 Conflict\*\*: The request was already processed; response contains\
> &#x20; the cached original result (handle as success)\
> \- \*\*423 Locked\*\*: The original request is still processing; retry after\
> &#x20; a short delay

```json
{"openapi":"3.0.0","info":{"title":"Offers API","version":"1.0.0"},"servers":[{"url":"https://api.xcover.com/x"}],"security":[{"CustomAPISignature":[]}],"components":{"securitySchemes":{"CustomAPISignature":{"type":"apiKey","name":"Authorization","in":"header","description":"**Composite Authentication Scheme (Client Key, Date, and Signature)**\n\nThis scheme requires the client to provide **three** mandatory headers in every request:\n\n### 1. X-Api-Key (Client Key)\n* **Purpose:** Public identifier for the API consumer.\n* **Example:** `X-Api-Key: YOUR_API_KEY_HERE`\n\n### 2. Date (Timestamp)\n* **Purpose:** Timestamp used for generating the signature and preventing replay attacks.\n* **Format:** RFC 7231 format (e.g., in GMT).\n* **Example:** `Date: Sun, 09 Nov 2025 04:04:00 GMT`\n\n### 3. Authorization (Computed Signature)\n* **Purpose:** The cryptographic signature that verifies the request's authenticity and integrity.\n* **Format:** `SIGNATURE [authHeader]`\n\n**Signature Generation Logic:**\nThe `authHeader` value is derived from a cryptographic hash (e.g., HMAC-SHA256) of canonical request components (HTTP Method, Path, and the contents of the `Date` header), signed with the private **Client Secret**.\n"}}},"paths":{"/partners/{partner_code}/bookings/{booking_id}/confirm":{"put":{"summary":"Confirm Booking","description":"Completes the second step of the two-step booking flow. Use this endpoint after confirming an Offer with `require_payment_confirmation` set to `true`, which leaves the booking in `PENDING_PAYMENT`. Once payment has been collected, call this endpoint to move the booking to `CONFIRMED` and issue the policies.\nThe booking must be in `PENDING_PAYMENT` status; any other status returns `422`.\n### Idempotency\nThis endpoint supports idempotency keys via the `x-idempotency-key` header to prevent duplicate transactions. Provide a unique operation identifier (e.g., UUID) to ensure safe retries. Duplicate requests return:\n- **409 Conflict**: The request was already processed; response contains\n  the cached original result (handle as success)\n- **423 Locked**: The original request is still processing; retry after\n  a short delay","tags":["Confirm Booking"],"parameters":[{"name":"x-idempotency-key","in":"header","required":false,"description":"A unique identifier to ensure idempotent request processing. If a request with the same idempotency key and body has already been processed, the cached response is returned with a `409` Conflict status code (which can be treated as successful). Keys are stored for 48 hours.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"payment_details":{"type":"object","description":"Payment information for the collected payment","properties":{"provider":{"type":"string","description":"Payment provider name (e.g., stripe, paypal, xpay)"},"transaction_id":{"type":"string","description":"Payment transaction ID"},"xpay_charge_id":{"type":"string","description":"XPay charge ID if using XPay"},"xpay_customer_id":{"type":"string","description":"XPay customer ID if using XPay"},"customer_token_id":{"type":"string","description":"Customer token for payment authorization"}}},"xpay_charge_id":{"type":"string","deprecated":true,"description":"Deprecated. Use `payment_details.xpay_charge_id` instead."}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","description":"The confirmed booking. Payload is identical to the Confirm Offer response.","properties":{"id":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"total_price":{"type":"number"},"total_price_formatted":{"type":"string"},"partner_transaction_id":{"nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"pds_url":{"type":"string","format":"uri"},"security_token":{"type":"string"},"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"policy_start_date":{"type":"string","format":"date-time"},"policy_end_date":{"type":"string","format":"date-time"},"status":{"type":"string"},"price":{"type":"number"},"price_formatted":{"type":"string"},"insured":{"type":"array","items":{"type":"object"}},"can_be_cancelled":{"type":"boolean"}}}},"coi":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"pdf":{"type":"string","format":"uri"}}},"account_url":{"type":"string","format":"uri"},"sign_up_url":{"type":"string","format":"uri"},"policyholder":{"type":"object"},"total_tax":{"type":"number"},"total_tax_formatted":{"type":"string"},"total_premium":{"type":"number"},"total_premium_formatted":{"type":"string"},"fnol_link":{"type":"string","format":"uri"},"booking_agent":{"nullable":true}}}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}},"409":{"description":"Conflict - Duplicate Request (Idempotent)","content":{"application/json":{"schema":{"type":"object","description":"The cached response from the original request. Handle as a success."}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}}}}}},"423":{"description":"Locked - Request In Progress","content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://partner-docs.covergenius.com/offers/api/reference/confirm-booking.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
