Skip to content

Get started · Step 2

2. Request services ​

Every service follows the same loop: find locations that offer it near a vehicle, create a reservation for the time you need, and follow the reservation from check-in to check-out. The examples use parking, the service available today.

What you'll do

  • Pick a service from the catalog
  • Search locations and check availability
  • Create a reservation and get the vehicle in
  • Follow it to completion with webhooks

Before you begin

  • A registered fleet with vehicles (step 1)
  • A key with locations:read and reservations:write
  1. Find and reserve List services
  2. Search locations
  3. Check availability
  4. Create a reservation
  5. On site Check in
  6. Check out

For a complete run with real payloads, see the driverless vehicle example.

See what's available ​

GET/fleet/v1/servicesList services

GET /services lists the services your fleet can search for and reserve right now. PMC owns the catalog: it enables services across the network and decides which ones each fleet can use, so the list can change over time.

sh
curl https://fleet.parkingmgt.com/fleet/v1/services \
  -H "Authorization: Bearer $STAGE_API_KEY"
Response: 200 OK
json
{
  "object": "list",
  "data": [
    {
      "object": "service",
      "id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
      "name": "Parking",
      "description": "A space for a vehicle at a location, from a short stay between trips to overnight.",
      "status": "available"
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Each service has an id (a UUID). Pass it as service_id when you search, check availability and reserve; the examples use Parking's 5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60. A service that is not in your list, because PMC has not enabled it for your fleet or has paused it, is refused with 422 service_not_available. Reservations you already hold are not affected: you can still check in, check out and cancel them. Read the list at startup (and from time to time) instead of hard-coding it, and treat a service you don't know as "skip".

The time window decides ​

You never pick a product variant. The time you request, from start_at to end_at, defines what you reserve: for parking, a 45-minute window is a short idle stay between trips, and 22:00 to 06:00 is an overnight stay. The window decides:

  • Whether it fits. The window has to fit the location's hours (in its timezone). Locations that are always_open accept any time; otherwise a reservation that does not fit gets 422 outside_operating_hours.

Find a location ​

GET/fleet/v1/locationsSearch locations

Search returns locations within a radius of a point that offer the service, nearest first.

ParameterRequiredDescription
lat, lngYesThe search point, for example the vehicle's position.
service_idYesThe service to search for: an id from GET /services. Only locations where your fleet can reserve it are returned.
radius_metersNoSearch radius in meters. Default 5000, maximum 50000.
start_at, end_atNoThe time you need (ISO-8601). Pass both or neither. With them, each location's service includes available for that time.
limit, cursorNoPagination.
sh
curl -G https://fleet.parkingmgt.com/fleet/v1/locations \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -d service_id=5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60 \
  -d lat=41.8781 -d lng=-87.6298 \
  -d radius_meters=3000 \
  -d start_at=2026-11-02T14:00:00Z -d end_at=2026-11-02T17:00:00Z
js
const query = new URLSearchParams({
  service_id: '5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60',
  lat: '41.8781',
  lng: '-87.6298',
  radius_meters: '3000',
  start_at: '2026-11-02T14:00:00Z',
  end_at: '2026-11-02T17:00:00Z'
})
const res = await fetch(`${API}/locations?${query}`, { headers })
const { data: locations } = await res.json()
Response: 200 OK
json
{
  "object": "list",
  "data": [
    {
      "object": "location",
      "id": "eec93d2d-5729-441b-99b2-f764872ca895",
      "name": "Monroe Street Garage",
      "address": {
        "line1": "55 E Monroe St",
        "line2": null,
        "city": "Chicago",
        "region": "IL",
        "postal_code": "60603",
        "country": "US"
      },
      "coordinates": { "lat": 41.8807, "lng": -87.6256 },
      "timezone": "America/Chicago",
      "distance_meters": 420,
      "access_method": "open",
      "access_instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\".",
      "hours": { "always_open": true, "weekly": null },
      "height_limit_cm": 210,
      "amenities": ["restrooms", "covered", "security"],
      "services": [
        {
          "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
          "capacity": 40,
          "available": 12
        }
      ],
      "created_at": "2026-11-01T15:04:05Z",
      "livemode": false
    }
  ],
  "has_more": false,
  "next_cursor": null
}

Pick by distance and available; results are sorted by distance only. Stage does not match vehicles to locations by size: if your vehicles are tall (vans, or vehicles with roof sensors), compare them with height_limit_cm yourself. GET /fleet/v1/locations/{id} returns one location (without distance_meters).

Location fieldDescription
name, address, coordinatesWhere the location is.
timezoneIANA time zone. hours are in local time.
access_methodHow the vehicle gets in: open (it drives in, and your system checks it in and out). See Check in.
access_instructionsDirections for the driver or the vehicle's route planner, or null.
hours{ "always_open": true, "weekly": null }, or opening times per weekday (null means closed that day; "close": "24:00" is midnight).
height_limit_cmPosted clearance in centimeters, for information, or null if none is recorded. Stage does not check vehicle height.
services[]Per service: capacity held for fleets, plus available for the requested time (or right now without one).

Check availability ​

GET/fleet/v1/locations/{id}/availabilityCheck availability

To check one location for one time window, ask for its availability. service_id, start_at, and end_at are required.

sh
curl -G https://fleet.parkingmgt.com/fleet/v1/locations/eec93d2d-5729-441b-99b2-f764872ca895/availability \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -d service_id=5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60 \
  -d start_at=2026-11-02T14:00:00Z \
  -d end_at=2026-11-02T17:00:00Z
json
{
  "object": "availability",
  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
  "start_at": "2026-11-02T14:00:00Z",
  "end_at": "2026-11-02T17:00:00Z",
  "available": 12,
  "capacity": 40,
  "bookable": true,
  "reason": null
}

available is the capacity left across the whole requested time; for parking, the number of additional vehicles that fit. Stage does not assign stalls: each location holds capacity for fleets, and a reservation can never overbook it. When bookable is false, reason holds the error code a reservation would get, such as capacity_unavailable or outside_operating_hours.

Availability is a snapshot, not a hold

Create a reservation to hold the capacity.

Create a reservation ​

POST/fleet/v1/reservationsCreate a reservation

Reserve the service at a location, for a vehicle and a time window. Always send an Idempotency-Key: if the connection drops, retry with the same key and you get the original reservation instead of a second one.

sh
curl https://fleet.parkingmgt.com/fleet/v1/reservations \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H "Idempotency-Key: 0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f" \
  -H "Content-Type: application/json" \
  -d '{
    "location": "eec93d2d-5729-441b-99b2-f764872ca895",
    "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
    "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
    "start_at": "2026-11-02T14:00:00Z",
    "end_at": "2026-11-02T17:00:00Z",
    "external_reference": "trip-88213",
    "metadata": { "driver_shift": "night" }
  }'
js
const res = await fetch(`${API}/reservations`, {
  method: 'POST',
  headers: {
    ...headers,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    location: 'eec93d2d-5729-441b-99b2-f764872ca895',
    vehicle: '7da8aca7-40fc-47d8-a1b1-2bb93405532d',
    service_id: '5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60',
    start_at: '2026-11-02T14:00:00Z',
    end_at: '2026-11-02T17:00:00Z',
    external_reference: 'trip-88213',
    metadata: { driver_shift: 'night' }
  })
})
const reservation = await res.json()
FieldRequiredDescription
locationYesLocation ID
vehicleYesVehicle ID. The vehicle must be active.
service_idYesA service the location offers: an id from GET /services.
start_atNoWhen the vehicle needs the service. Defaults to now.
end_atNoWhen the vehicle will be done, after start_at. A reservation can touch at most 97 clock hours (UTC), a little over four days. Omit it for an open-ended reservation: the vehicle stays until it checks out.
external_referenceNoYour trip, shift, or job ID (up to 128 characters). Filterable in lists.
metadataNoUp to 50 string key/value pairs.

Capacity is held synchronously. On success you get 201 Created with status confirmed and an access object that tells the vehicle how to get in.

Response: 201 Created
json
{
  "object": "reservation",
  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
  "status": "confirmed",
  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
  "start_at": "2026-11-02T14:00:00Z",
  "end_at": "2026-11-02T17:00:00Z",
  "hold_until": "2026-11-02T17:00:00Z",
  "access": {
    "method": "open",
    "plate": null,
    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
  },
  "checked_in_at": null,
  "check_in_source": null,
  "checked_out_at": null,
  "check_out_source": null,
  "cancelled_at": null,
  "cancellation_reason": null,
  "external_reference": "trip-88213",
  "metadata": { "driver_shift": "night" },
  "updated_at": "2026-11-01T15:04:05Z",
  "created_at": "2026-11-01T15:04:05Z",
  "livemode": false
}

The usual failures, and what to do about them:

HTTP statusCodeWhyWhat to do
409capacity_unavailableThe location has no capacity left for the service for part of the requested time.Try the next location.
409conflictThe vehicle already has a confirmed or checked_in reservation that overlaps. Rarely, under heavy load: a concurrent request touched the same capacity (the detail says so).Extend or cancel that one; for the concurrent case, retry with a new Idempotency-Key.
422outside_operating_hoursThe time does not fit the location's hours.Pick another location or time.
422service_not_offeredThe location does not offer the service to your fleet.Search with service_id set.
422service_not_availableYour fleet cannot use the service right now (not in your GET /services).Re-read GET /services; contact your PMC representative to enable a service.
422vehicle_not_eligibleThe vehicle is inactive.Set it active, or use another vehicle.
400validation_failedA field is invalid, for example end_at is not after start_at.Fix the fields in errors[].
403forbiddenThe fleet is suspended.Contact your PMC representative.

Every code, with what it means and what to do, is in the API reference.

Open-ended reservations ​

A vehicle that waits for its next job, such as a robotaxi between rides, often doesn't know when it will leave. Omit end_at (and start_at, to start now) for an open-ended reservation: the vehicle stays until your system checks it out.

sh
curl https://fleet.parkingmgt.com/fleet/v1/reservations \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H "Idempotency-Key: 3c2b1a09-8f7e-4d6c-9b5a-4e3d2c1b0a99" \
  -H "Content-Type: application/json" \
  -d '{
    "location": "eec93d2d-5729-441b-99b2-f764872ca895",
    "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
    "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
  }'
  • end_at is null, and hold_until tells how long capacity is held. The first hold runs a few hours from start_at, or shorter when the location closes first. Check-in closes at hold_until. While the vehicle is checked in, Stage extends the hold an hour at a time, about 15 minutes before it ends, as long as the location has room, and sends reservation.updated with the new hold_until. If the location is full, the vehicle may stay, but 15 minutes past hold_until the stay is recorded as an overstay.
  • No-shows work as for any reservation. See Cancel.
  • Set an end later if you learn it. PATCH with end_at (any time in the future, also once checked in) turns it into a reservation with a fixed end.

For fixed reservations hold_until equals end_at. The driverless example walks through a complete open-ended stay.

Check in ​

Locations admit vehicles by the location's access_method, today always open: the vehicle drives in, and your system checks the reservation in when it parks and out when it leaves, with /check-in and /check-out. Nothing on site knows the vehicle is there: if you never check it out, the reservation stays checked_in past end_at. Pass the reservation's access.instructions to the driver app or the vehicle's mission plan as-is. Check-in is accepted from 30 minutes before start_at until hold_until (the end of the reservation).

New access methods may be added later; treat a value you don't know like open.

POST/fleet/v1/reservations/{id}/check-inCheck in
sh
curl https://fleet.parkingmgt.com/fleet/v1/reservations/ee8aced1-100f-45fa-a267-8fa27978f9e3/check-in \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H "Idempotency-Key: 5f0c1d2e-3a4b-4c5d-8e9f-0a1b2c3d4e5f" \
  -H "Content-Type: application/json" \
  -d '{
    "occurred_at": "2026-11-02T14:03:00Z",
    "coordinates": { "lat": 41.8807, "lng": -87.6256 }
  }'
js
const res = await fetch(`${API}/reservations/ee8aced1-100f-45fa-a267-8fa27978f9e3/check-in`, {
  method: 'POST',
  headers: {
    ...headers,
    'Idempotency-Key': crypto.randomUUID(),
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    occurred_at: '2026-11-02T14:03:00Z',
    coordinates: { lat: 41.8807, lng: -87.6256 }
  })
})

The reservation moves to checked_in. Both fields are optional: occurred_at defaults to now (send it when you check in from a queue after the fact), and coordinates is your GPS fix.

Sandbox workspace

Nothing is sent to sandbox locations: check reservations in and out yourself, exactly as in production.

Check out, extend, or cancel ​

Check out ​

POST/fleet/v1/reservations/{id}/check-outCheck out

Check-out works the same way and moves a checked_in reservation to completed:

sh
curl -X POST https://fleet.parkingmgt.com/fleet/v1/reservations/ee8aced1-100f-45fa-a267-8fa27978f9e3/check-out \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H "Idempotency-Key: 9f8e7d6c-5b4a-4f3e-8d2c-1b0a9f8e7d6c"

Leaving before end_at releases the capacity for others. Staying past end_at is recorded as an overstay in the vehicle's history: extend before end_at instead.

Extend or change ​

PATCH/fleet/v1/reservations/{id}Extend or change a reservation

PATCH changes the requested time or the metadata; every field is optional. On an open-ended reservation, end_at sets a fixed end (any time in the future, also once checked in); without end_at it stays open-ended.

Reservation statusWhat can change
confirmedstart_at and end_at
checked_inend_at, and only later (extend); open-ended: any future end_at
Any final statusNothing: 409 invalid_state_transition

Stage re-checks availability for the new time (409 capacity_unavailable if it doesn't fit). Send the reservation's ETag as If-Match so you never overwrite a change you haven't seen; a stale value gets 412 precondition_failed.

sh
curl -i https://fleet.parkingmgt.com/fleet/v1/reservations/ee8aced1-100f-45fa-a267-8fa27978f9e3 \
  -H "Authorization: Bearer $STAGE_API_KEY"
# HTTP/2 200
# etag: "q3cWd0mN2b1yG8xQf5LkTzR7pVh"

curl -X PATCH https://fleet.parkingmgt.com/fleet/v1/reservations/ee8aced1-100f-45fa-a267-8fa27978f9e3 \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H 'If-Match: "q3cWd0mN2b1yG8xQf5LkTzR7pVh"' \
  -H "Content-Type: application/json" \
  -d '{ "end_at": "2026-11-02T18:00:00Z" }'

Cancel ​

POST/fleet/v1/reservations/{id}/cancelCancel a reservation

Cancelling a confirmed reservation releases the capacity immediately. An optional reason is stored as cancellation_reason. A checked_in reservation cannot be cancelled: check it out instead.

sh
curl https://fleet.parkingmgt.com/fleet/v1/reservations/ee8aced1-100f-45fa-a267-8fa27978f9e3/cancel \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -H "Idempotency-Key: 7d6c5b4a-3f2e-4d1c-9b8a-7f6e5d4c3b2a" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Trip cancelled by rider" }'

A reservation that is never checked in is marked no_show (or expired, if the time ends first), and the capacity is released.

Who recorded it ​

check_in_source and check_out_source on the reservation, and source on vehicle history events, tell you who recorded each event:

SourceRecorded by
apiYour call to /check-in or /check-out (or your team in the Fleet Console)
adminPMC staff, for example checking a vehicle out for you on request
systemStage itself, for example marking a no-show or extending an open-ended hold

Track status ​

A reservation moves from confirmed to checked_in to completed, or ends as cancelled, no_show, or expired. Each change sends a signed webhook.

StatusMeaningWebhook
confirmedThe capacity is held and access is issued.reservation.confirmed
checked_inThe vehicle is checked in and on site.reservation.checked_in
completedThe vehicle checked out. Final.reservation.completed
cancelledYou cancelled before check-in. The capacity is released. Final.reservation.cancelled
no_showThe vehicle never checked in. The capacity is released. Final.reservation.no_show
expiredThe requested time ended while still confirmed. Final.reservation.expired
GET/fleet/v1/reservations/{id}Retrieve a reservation GET/fleet/v1/reservationsList reservations

Retrieve one reservation by ID, or list them newest first, filtered by status, location, vehicle, service_id, external_reference, starts_after, and starts_before:

sh
curl -G https://fleet.parkingmgt.com/fleet/v1/reservations \
  -H "Authorization: Bearer $STAGE_API_KEY" \
  -d status=checked_in \
  -d external_reference=trip-88213

Prefer webhooks to polling

Subscribe to webhooks: Stage sends a signed reservation.* event to your backend on every status change, and reservation.updated when the times change, an open-ended hold is extended, or a vehicle overstays.

Next ​

Driverless example

One complete stay, every payload.

Webhooks

Events, signatures, and retries.

Conventions

IDs, pagination, idempotency, errors.