# Appointment Requests

Customer-initiated appointment **requests** and available-slot lookup.

**List date filters** (`GET /appointmentRequests`): `YYYY-MM-DD` or ISO 8601 datetime.

**Available slots date filters** (`GET /appointmentRequests/availableSlots`): use **`YYYY-MM-DD`** date-only — ISO 8601 datetimes return **HTTP 400**.

**Create body datetime format:** `YYYY-MM-DD HH:mm` for `startDateTime` / `endDateTime`.


## Create appointment request

 - [POST /appointmentRequests/create](https://developers.myautoleap.com/openapi/appointment-requests/createappointmentrequest.md): Creates an appointment request against the given company and location.

Datetime format: startDateTime and endDateTime use YYYY-MM-DD HH:mm (recommended). Public examples may show ISO 8601 — verify against your environment.

### Customer comment

Send the customer comment as description (recommended) or notes (write-only alias for the same field). Plain text; line breaks (\n) are supported. If both fields are sent, description takes precedence. List responses return the value in description.

### Create body fields not accepted

Do not send vehicle.name, services[].serviceId, or services[].title on create — the API rejects them. Vehicle name is auto-generated on the response.

## List appointment requests

 - [GET /appointmentRequests](https://developers.myautoleap.com/openapi/appointment-requests/listappointmentrequests.md): Fetches appointment requests (customer-initiated booking requests) for a company and location.
Supports filtering by status, date ranges, sorting, and pagination.

This is not the same as scheduled Appointments (GET /appointments).

### Date filter parameters

Preferred (standard — Date in the middle):

| Use this | Filters on |
|---|---|
| appointmentDateStart / appointmentDateEnd | Request start datetime |
| updatedDateStart / updatedDateEnd | Last updated |

Legacy aliases (still accepted on this endpoint):

| Legacy (Date at end) | Maps to |
|---|---|
| appointmentStartDate / appointmentEndDate | Same as appointmentDateStart / appointmentDateEnd |

If both standard and legacy names are sent, standard takes precedence.

### ⚠️ Names that do not work on this list endpoint

- startDate / endDate — silently ignored here. Use them on
  GET /appointmentRequests/availableSlots instead.

### Date format

Date filter params accept YYYY-MM-DD or ISO 8601 datetime (YYYY-MM-DDThh:mm:ssZ).

### Updated-date filter

updatedDateStart / updatedDateEnd only match records with a non-null updatedAt. Newly created requests may have updatedAt: null and will not appear in updated-date filters until the record is updated.

## Get available appointment slots

 - [GET /appointmentRequests/availableSlots](https://developers.myautoleap.com/openapi/appointment-requests/getavailableappointmentslots.md): Returns available booking slots for a location on a given date range.

### Date range parameters

Preferred (standard): appointmentDateStart / appointmentDateEnd

Legacy (still accepted): startDate / endDate

One pair is required for the date window. If both standard and legacy names are sent, standard takes precedence.

Date format: use YYYY-MM-DD date-only on this endpoint. ISO 8601 datetimes return HTTP 400 (Invalid startDate or endDate).

### showAllSlots

Defaults to true. When false, days with no open availability may be omitted from the response.

### ⚠️ Not implemented

slotDateStart / slotDateEnd return HTTP 400 (missing required fields).

