StopPoint search not working with latitude/longitude

I get an odd response with the /StopPoint endpoint:

URL: https://api.tfl.gov.uk/StopPoint?stopTypes=NaptanMetroStation&location.lat=51.508&location.lon=-0.075

{"$type":"Tfl.Api.Presentation.Entities.ApiError, Tfl.Api.Presentation.Entities","timestampUtc":"2019-10-15T11:18:40.1694997Z","exceptionType":"EntityNotFoundException","httpStatusCode":404,"httpStatus":"NotFound","relativeUri":"/StopPoint?stopTypes=NaptanMetroStation&location.lat=51.508&location.lon=-0.075","message":"Resource not found: http://api:8001/StopPoint?stopTypes=NaptanMetroStation&location.lat=51.508&location.lon=-0.075"}

I don’t think this is related to the type of stop point as this url appears to work: https://api.tfl.gov.uk/StopPoint/Type/NaptanMetroStation

Is there something I’m doing wrong here, or a better endpoint to use for nearby stop-points?

Looking at my code isn’t it “lat” and “lon” for the params?

    $strTFLurl = "https://api.tfl.gov.uk/StopPoint?lat=" . $fpNorthing . "&lon=" . $fpEasting . "&stopTypes=NaptanRailStation,NaptanMetroStation&radius=250&useStopPointHierarchy=True&returnLines=True&" . disruptionViews::TFLAPISUFFIX;

Thanks Brian, yes that works correctly.

It looks like the real issue is the OpenAPI/Swagger doc for that endpoint has changed and no longer reflects the API correctly in https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/StopPoint/StopPoint_GetByGeoPoint

@ rmasters

I think you’re right. I wrote the code example I posted using the old docs.