Skip to main content
Documentation

Booking

booking.hold

Reserve a slot for a few minutes before taking the booking
WritesWrite budget

REST

Shipping
POST /api/v1/booking/hold

MCP tool

Live
booking.hold

Exposed on: REST API · Booking MCP server. Part of the Booking domain.

Operating contract

Takes the slot off sale for a few minutes so it is still there when the customer says yes. A voice call takes twenty seconds to read a time back, and for those twenty seconds the same slot is being offered to everybody else — this is what stops two callers being sold one bay.

CALL THIS THE MOMENT YOU OFFER A SPECIFIC TIME, then pass hold_token and the SAME session_key to booking.book. Booking without a hold still works; it is just a race you might lose after the customer has committed.

session_key is one opaque id you mint for THIS conversation and reuse for every call in it — a call id, a chat id, anything stable and unguessable. Re-holding with the same key replaces this conversation's own hold instead of fighting it, so changing the customer's mind about a time costs nothing.

held: false with reason: "taken" means somebody got there first: re-run booking.availability and offer a different time. reason: "unavailable" is OUR problem — go on and book anyway; the booking itself re-checks the slot.

A hold expires by itself. Nothing has to release it, and letting one lapse is not an error.

Who may call it

Permission
NoneA reservation on a public slot, made by a member of the public in the middle of booking. It writes no shop record — a hold is a row that expires by itself — and the storefront takes the identical one with no login at all.
Plan
Every planNo plan gate. Available on every Service VIN plan.
Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.
Rate class
writeCounted against the write budget, which is tighter than a read.

Input

FieldTypeDescription
service_idsrequiredstring[]

The services to book, as `id` values from booking.services. One id books one service; several book one visit covering all of them, and the slot is sized for the whole visit.

vehicle_typerequiredstring

The customer's vehicle size, one of `vehicle_types` from booking.services.

One of: car, truck, suv, van, coupe, motorcycle, commercial, exotic
startrequiredstring

The exact `start` of the slot, copied from booking.availability. An ISO 8601 instant.

session_keyrequiredstringmax 128 chars, min 8 chars

One opaque, unguessable id for this conversation. Reuse it all call.

staff_idstringuuid

Hold this installer, when the customer picked one — an id from `staff_ids` or `installers`, as returned by booking.availability.

ttl_minutesinteger1–30

How long to hold it, 1-30 minutes. Defaults to the shop's setting.

Output

FieldTypeDescription
heldboolean

hold_tokenstring | null

expires_atstring | null

reasonstring | null

Examples

Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.

curl
export SERVICEVIN_API_KEY=svk_live_…

curl -X POST https://www.servicevin.com/api/v1/booking/hold \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"service_ids":["…"],"vehicle_type":"car","start":"…","session_key":"…"}'

TypeScript (fetch)
const res = await fetch("https://www.servicevin.com/api/v1/booking/hold", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "service_ids": [
      "…"
    ],
    "vehicle_type": "car",
    "start": "…",
    "session_key": "…"
  }),
});

// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;

Python (requests)
import os, requests

res = requests.post(
    "https://www.servicevin.com/api/v1/booking/hold",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "service_ids": [
        "…"
    ],
    "vehicle_type": "car",
    "start": "…",
    "session_key": "…"
},
    timeout=30,
)
payload = res.json()
if not res.ok:
    raise RuntimeError(payload["error"]["code"])
data = payload["data"]

MCP tools/call — https://www.servicevin.com/api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "booking.hold",
    "arguments": {
      "service_ids": [
        "…"
      ],
      "vehicle_type": "car",
      "start": "…",
      "session_key": "…"
    }
  }
}

Refusals

The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.

StatusCodeWhen
404not_foundThe id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both.
403insufficient_scopeThe credential is read-only and this capability writes.
422validation_errorAn argument was wrong. The message names the field.
429rate_limitedToo many write calls. Back off and retry.
500internal_errorSomething failed on our side. Nothing was changed.