One authenticated endpoint for creating and resolving delivery addresses. Server-to-server only — this isn't for use from a browser.
Every request needs an Authorization header with a key issued to your business. Requests without a valid, active key get a 401.
Authorization: Bearer <your_api_key>
POST/api/locations.php
Submits an address. If it's genuinely new, it's created and you get a fresh PinPoint code back. If it closely matches an address PinPoint already knows about — from any caller, not just yours — you get that existing code back instead, so repeat or nearby addresses don't pile up as duplicates.
| Field | Type | Required | Notes |
|---|---|---|---|
label | string | No | Defaults to address_text if omitted |
address_text | string | Yes | Street, landmark, whatever helps a rider find it |
latitude | number | No | Must be sent together with longitude, or not at all |
longitude | number | No | Must be sent together with latitude, or not at all |
curl -X POST https://pinpointaddress.com.ng/api/locations.php \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "Customer delivery address",
"address_text": "15 Trans Amadi Road, near GRA junction",
"latitude": 4.8020,
"longitude": 7.0170
}'
{
"duplicate": false,
"pinpoint_code": "LR3-HWMP-59ZS",
"id": 482,
"label": "Customer delivery address",
"address_text": "15 Trans Amadi Road, near GRA junction",
"latitude": 4.802,
"longitude": 7.017
}
Same shape, duplicate is true, and the code/id belong to the location that already existed — not a new one.
{
"duplicate": true,
"pinpoint_code": "LR3-HWMP-59ZS",
"id": 482,
"label": "Home",
"address_text": "15 Trans Amadi Road, near GRA junction",
"latitude": 4.802,
"longitude": 7.017
}
label is the one you sent — read it back from the response rather than reusing what you submitted.GET/api/locations.php?code=LR3-HWMP-59ZS
Returns the full stored record for a PinPoint code.
curl "https://pinpointaddress.com.ng/api/locations.php?code=LR3-HWMP-59ZS" \ -H "Authorization: Bearer YOUR_API_KEY"
| Status | Meaning |
|---|---|
400 | Malformed JSON body, or a GET with no code parameter |
401 | Missing, unknown, or deactivated API key |
404 | GET request — no location exists for that code |
405 | Method other than GET or POST |
422 | address_text missing, or only one of latitude/longitude was sent |
Every error responds as JSON: { "error": "..." }.
A few things worth building in from day one rather than adding later: