GreenFlow docs

Offices

Brand-specific pickup/dropoff locations. Currently no standalone endpoint — offices surface through /places/search (with their parent place) and through /fleet/list internal resolution.

No standalone endpoint (yet)
There is no public GET /api/v1/offices listing route today. The data is reachable two ways: (1) /places/search returns the offices pivot per place row; (2) /fleet/list itself runs `Office::near()` per brand internally to translate `lat/lng` → office code before dispatching to the GDS adapter.

Office::near semantics

Internal helper: `Office::near($lat, $lng, $radiusKm)->where(brand_id, ...)` returns brand-owned offices within the radius, sorted by distance. The fleet controller uses this to pick exactly one office per brand for a given lat/lng — the same office your /places/search call would have returned.

bash
# Get the offices around Congonhas (Sao Paulo) for any brand:
curl -s "https://greenflow.live/api/v1/places/search?lat=-23.6273&lng=-46.6566&radius_km=5" \
  -H "Authorization: Bearer gfc_7s2wprmy_DWTZRBGBEV6La4dTOoFdMkEhWmWCsXdwc3zVMnqP"
json
{
  "data": [
    {
      "uuid": "c31ec1ee-3fdf-4cb2-8445-6d07e82dacd0",
      "name": "Congonhas Airport",
      "offices": [
        {"code": "AACGH", "name": "AGENCIA AEROPORTO CONGONHAS", "brand_id": 11, "distance_km": 0.142}
      ]
    }
  ]
}

Per-brand resolution

Different brands maintain different airport codes for the SAME physical airport. A `pickup_lat`/`pickup_lng` of `(-23.62, -46.65)` resolves to `AACGH` for LOCALIZA, `SAO01` for MOVIDA, etc. Resolution happens inside /fleet/list; integrators rarely need to call it themselves.

bash
# Pass coords directly to /fleet/list — internal Office::near picks the
# right office per brand. No need to call any /offices route.
curl -X POST https://greenflow.live/api/v1/fleet/list \
  -H "Authorization: Bearer gfc_7s2wprmy_DWTZRBGBEV6La4dTOoFdMkEhWmWCsXdwc3zVMnqP" \
  -H "Content-Type: application/json" \
  -d '{
    "pickup_lat": -23.6273, "pickup_lng": -46.6566,
    "dropoff_lat": -23.6273, "dropoff_lng": -46.6566,
    "pickup_date": "2026-05-15", "pickup_time": "10:00",
    "dropoff_date": "2026-05-18", "dropoff_time": "10:00",
    "passenger_country_code": "BR", "passenger_age": 30,
    "brands": [11]
  }'

Errors

HTTP Body Cause
404{"message": "Not Found"}Hitting /api/v1/offices directly returns 404 — not yet wired.
200{"meta": {"LOCALIZA": {"reason": "no_offices_for_pickup"}}}/fleet/list meta — no brand-owned office near the lat/lng.