Skip to main content

Nearest SasaPay Agents

As a SasaPay merchant, we provide you an endpoint to enable your beneficiaries locate SasaPay agents near them. To locate the nearest agents, you need to provide two crucial query parameters and that is the user's current location's longitude and latitude coordinates.

Alt test Endpoint: https://sandbox.sasapay.app/api/v2/waas/nearest-agent/?Longitude=00.00000&Latitude=00.00000

Query Parameters

FieldTypeDescriptionExamples
LongitudeFloatThis the current user location's distance east or west from an imaginary line connecting the North and South Poles.40.98888
LatitudeFloatThis the current user location's distance north or south of the equator.50.00000
Sample Request
Headers
Key: Authorization
Value: Bearer Q1k2RW5SOGlsYUZnRzNGMk1DNIyZWlDS3VrTFhVV0xScFVHYQ==

Response Parameters

FieldTypeDescriptionExamples
statusCodeNumericThis is a numeric status code that indicates the status of the response. 0 means success and any other code means an error occurred or the request failed.Please refer to the response codes table above.0
messageStringStatus of the request generated by SasaPay API.Record Retrieved successfully
nearest_agentsListThis is the list of all agents that are close to the user's location.[]
Sample response
{
"statusCode": "0",
"message": "Record Retrieved successfully",
"nearest_agents": [
{
"distance": 1518.5186179716159,
"id": 2030,
"description": "Eins Fintech",
"longitude": "-1.2827683",
"latitude": "36.8157532",
"area_name": "51748 Uhuru Hwy, Nairobi Central, Nairobi, , Kenya"
},
]