> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Commit Wizard Session

> Validate a wizard session and create a draft booking.

## Method

`POST` `/v1/bookings/wizard/:id/commit`

## Path Parameters

<ParamField path="id" type="uuid" required>Wizard session ID to commit.</ParamField>

## Headers

<ParamField header="Authorization" type="string">Bearer token (requires `bookings:write`).</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.voyantcloud.com/v1/bookings/wizard/wzd_01J0C6ZFWN6JQM4TP7A1ZA6X0M/commit" \
    -H "Authorization: Bearer $VOYANT_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const res = await fetch(
    "https://api.voyantcloud.com/v1/bookings/wizard/wzd_01J0C6ZFWN6JQM4TP7A1ZA6X0M/commit",
    {
      method: "POST",
      headers: { Authorization: `Bearer ${process.env.VOYANT_API_KEY}` },
    },
  )
  const payload = await res.json()
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.post(
    "https://api.voyantcloud.com/v1/bookings/wizard/wzd_01J0C6ZFWN6JQM4TP7A1ZA6X0M/commit",
    headers={"Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}"},
  )
  commit_res = resp.json()
  ```
</RequestExample>

## Response Fields

<ResponseField name="ok" type="boolean">`true` when the booking was created successfully.</ResponseField>
<ResponseField name="bookingId" type="uuid">Identifier of the newly created (or reused) booking.</ResponseField>
<ResponseField name="reused" type="boolean">Only present when an existing booking was already linked to the session.</ResponseField>

## Response Example

<ResponseExample>
  ```json 200 OK theme={null}
  { "ok": true, "bookingId": "bk_01J0C8BES5X40MNW873RG6DTDR" }
  ```

  ```json 200 OK theme={null}
  { "bookingId": "bk_01J0C8BES5X40MNW873RG6DTDR", "reused": true }
  ```

  ```json 404 Not Found theme={null}
  { "error": "Not found", "code": "NOT_FOUND_404" }
  ```

  ```json 400 Bad Request theme={null}
  { "error": "Invalid billing data", "issues": [{ "path": "email", "message": "Required" }] }
  ```
</ResponseExample>

<Tip>
  The commit endpoint validates workspace-configured billing and passenger forms. If validation fails, the response contains a detailed `issues` array describing invalid fields.
</Tip>
