get https://staging.hq.netevia.com/api/v1/merchant/cityByZip
API Endpoint: GET /api/v1/merchant/cityByZip
GET /api/v1/merchant/cityByZip
Overview:
The GET /api/v1/merchant/cityByZip
API method returns the city corresponding to a given ZIP code. This endpoint is useful during the merchant onboarding process to validate and display the correct city name based on the provided ZIP code, ensuring accurate geographical information for merchants.
Purpose:
This endpoint is used to retrieve the city associated with a specific ZIP code. It ensures that the city information entered during merchant registration is accurate and matches the geographical data, streamlining the onboarding process for the payment processing service.
HTTP Request Method:
GET
URL:
/api/v1/merchant/cityByZip
Authentication:
- Required: Yes
- Authentication Method: Basic Token or API Key provided in the request header.
Request Headers:
Authorization: Basic <token>
(required) - Used to authenticate the API call.Content-Type: application/json
(optional).
Query Parameters:
zipCode
(string, required): The ZIP code for which the city information is being requested.
Success Response:
- Status Code:
200 OK
- Response Body with id 33160 (JSON format):
{ "data": { "city": "NORTH MIAMI BEACH", "state": "FL", "stateCode": 10 }, "requestId": 18491, "success": true }
Response Fields:
zipCode
(string): The ZIP code provided in the request.city
(string): The city associated with the provided ZIP code.
Error Responses:
- 400 Bad Request:
- Occurs if the ZIP code is invalid or missing.
- Response body:
{ "error": "Bad Request", "message": "Invalid or missing zip code" }
- 401 Unauthorized:
- Occurs if the request lacks valid authentication credentials.
- Response body:
{ "error": "Unauthorized", "message": "Invalid or missing token" }
- 404 Not Found:
- Occurs if no city is found for the given ZIP code.
- Response body:
{ "error": "Not Found", "message": "No city found for the provided zip code" }
Notes:
- The API ensures that the city associated with the provided ZIP code is correctly identified during the merchant registration process.
- If no city is found for the given ZIP code, the API will return a
404 Not Found
error.