# confirm_booking

Confirms a hold with the customer's contact details. Depending on the business's policies this sends a 6-digit verification code to the customer by WhatsApp, SMS or email, returns a payment link for a deposit, asks the business for approval, or confirms immediately.

Canonical: https://bookwise.live/docs/tools/confirm_booking

Version: 1.1.0
Scope: Directory + business
Authentication: As specified in parameters
Category: Booking management

## Parameters

- **holdId** (string; required): holdId: the holdId returned by create_hold, e.g. "bkg_01j…"
- **customer** (object; required): customer: contact details; a phone (E.164) or email is required to send the verification code
- **idempotencyKey** (string; required): idempotencyKey: a unique string you generate per intended action (e.g. a UUID); retries with the same key return the same result

## Example MCP call

Replace placeholders with returned IDs and saved credentials. Example dates must be replaced with the customer's future dates.

```json
{
  "name": "confirm_booking",
  "arguments": {
    "holdId": "<holdId>",
    "customer": {
      "name": "Asha Perera",
      "email": "asha@example.com"
    },
    "idempotencyKey": "<new-UUID-for-this-action>"
  }
}
```

## Input JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "holdId": {
      "type": "string",
      "minLength": 1,
      "description": "holdId: the holdId returned by create_hold, e.g. \"bkg_01j…\""
    },
    "customer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 120,
          "description": "name: customer full name, e.g. \"Asha Perera\""
        },
        "phone": {
          "type": "string",
          "pattern": "^\\+[1-9]\\d{6,14}$",
          "description": "phone: customer mobile number in E.164 format, e.g. \"+94771234567\""
        },
        "email": {
          "type": "string",
          "format": "email",
          "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$",
          "description": "email: customer email address, e.g. \"asha@example.com\""
        },
        "marketingConsent": {
          "description": "marketingConsent: true only if the customer explicitly agreed to receive offers from this business",
          "type": "boolean"
        }
      },
      "required": [
        "name"
      ],
      "description": "customer: contact details; a phone (E.164) or email is required to send the verification code"
    },
    "idempotencyKey": {
      "type": "string",
      "minLength": 8,
      "maxLength": 200,
      "description": "idempotencyKey: a unique string you generate per intended action (e.g. a UUID); retries with the same key return the same result"
    }
  },
  "required": [
    "holdId",
    "customer",
    "idempotencyKey"
  ]
}
```

## Output JSON Schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "bookingId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "held",
        "pending_verification",
        "pending_payment",
        "pending_approval",
        "confirmed",
        "cancelled",
        "expired",
        "no_show",
        "completed"
      ]
    },
    "nextStep": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "accessToken": {
      "description": "Returned once after verification or when verification is not required. Store securely for booking management.",
      "type": "string"
    },
    "total": {
      "type": "object",
      "properties": {
        "amountMinor": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "formatted": {
          "type": "string"
        }
      },
      "required": [
        "amountMinor",
        "currency",
        "formatted"
      ],
      "additionalProperties": false
    },
    "depositDue": {
      "type": "object",
      "properties": {
        "amountMinor": {
          "type": "number"
        },
        "currency": {
          "type": "string"
        },
        "formatted": {
          "type": "string"
        }
      },
      "required": [
        "amountMinor",
        "currency",
        "formatted"
      ],
      "additionalProperties": false
    },
    "paymentUrl": {
      "description": "Customer must open this URL to pay; do not collect payment credentials in chat.",
      "type": "string"
    },
    "expiresAt": {
      "type": "string"
    },
    "verification": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string"
        },
        "destination": {
          "type": "string"
        },
        "expiresAt": {
          "type": "string"
        }
      },
      "required": [
        "channel",
        "destination",
        "expiresAt"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "bookingId",
    "status",
    "nextStep",
    "message",
    "total",
    "depositDue"
  ],
  "additionalProperties": {}
}
```

## Annotations

```json
{
  "readOnlyHint": false,
  "destructiveHint": false,
  "idempotentHint": true,
  "openWorldHint": true
}
```

On failure, inspect isError and content; domain errors may include structuredContent.code, retryable, details.fields or alternatives. Annotations are behavior hints, not authorization.
