POST /mechanic/booking
/api/store/[slug]/mechanic/bookingSends a drop-off request. The time is optional: a slot from the slots endpoint, a preferred time in the customer's words, or neither. Nothing is held or promised. The request opens a job on the shop's board at Off Site - Need To Schedule, and the shop confirms it (setting the appointment), suggests another time, or declines it (cancelling that job). The customer is emailed that it is a request, not a booking, and the shop is emailed about it.
Path parameters
slugstringrequiredBusiness (store) slug
Body parameters
slot_startstringoptionalISO 8601 start of a slot from the slots endpoint (any UTC offset). Omit or send null for a request with no time.
preferred_timestringoptionalUp to 200 characters: when the customer would like to come, in their words. Shown to the shop, never promised.
customer_namestringrequired1-120 characters.
customer_emailstringrequiredValid email address; the confirmation goes here.
customer_phonestringoptionalUp to 32 characters with at least 3 digits.
vehicle_yearnumberoptionalFour-digit year, 1900-2100 (a numeric string is accepted).
vehicle_makestringoptionalUp to 60 characters.
vehicle_modelstringoptionalUp to 60 characters.
vehicle_platestringoptionalUp to 16 characters.
concernstringrequiredWhat the car needs, 1-2000 characters.
Responses
The resource was created.
A field failed validation. The response names the fields that failed, not just the first.
No such store, or no such record inside it.
The request conflicts with something that already exists.
Too many requests. Back off and retry after the window in the response.
Something failed on our side. The response carries no detail; retry is safe on a GET.
What comes back
201 with { success: true, data: { booking_id, status: 'requested', slot_start, slot_end, slot_label, preferred_time } }; the slot fields are null when no time was picked. The same request (same email and concern) sent again within 30 minutes answers with the first request's booking_id. Errors: { error } with 400 (invalid JSON or body; also carries field), 404 (store not found, or code: 'booking_off' when the shop is not taking bookings online), 409 (code: 'slot_unavailable' when the time is not one the shop offers now, or 'slot_full' when it filled in the meantime: fetch the slots again), 429 ({ error, retryAfter } plus a Retry-After header when rate limited, or code: 'too_many_requests' when the email already has 3 requests waiting), 500. CORS open, OPTIONS supported.