{ "openapi": "3.0.1", "info": { "title": "API Locations", "description": "\n## Ferguson's Location API for exchanging location data with internal Ecommerce platforms and 3rd party companies.\n\n  \n> ### Fetch summary list of locations via pagination:\n```js\n[GET]/v2/locations \n[GET]/v2/locations?page=1\n[GET]/v2/locations?page=2&size=100 (max size of 100)\n```\n
\n Click to see example response\n```JSON\n{\n\"totalCount\": \"2693\",\n\"page\": 10,\n\"size\": 2,\n\"results\": [\n {\n \"id\": 44,\n \"name\": \"Drop Ship\",\n \"type\": \"DistributionCenters\",\n \"regionCode\": \"CAL\",\n \"status\": \"Operational\",\n \"address\": {\n \"address1\": \"1234 Location Ave\",\n \"city\": \"North Hollywood\",\n \"state\": \"CA\",\n \"postalCode\": \"91605\",\n \"country\": \"US\",\n \"phone\": \"5432532463\",\n \"email\": \"JohnSmith@ferguson.com\"\n }\n },\n {\n \"id\": 46,\n \"name\": \"Beltsville, MD\",\n \"type\": \"Stores\",\n \"regionCode\": \"LENZ\",\n \"status\": \"Operational\",\n \"address\": {\n \"address1\": \"11730 Baltimore Ave\",\n \"city\": \"Beltsville\",\n \"state\": \"MD\",\n \"postalCode\": \"20705\",\n \"country\": \"US\",\n \"phone\": \"2402643600\",\n \"email\": \"johnDoe@Ferguson.com\"\n }\n }\n]\n}\n```\n
\n---\n---\n> ### Fetches details for a specific location based on id and application scope:\n```js\n[GET]/v2/locations/{locationId} \n```\n#### For external users, this endpoint features a refined response.\n
\n Click to see example response\n```JSON\n{\n\"results\": [\n {\n \"id\": 999,\n \"name\": \"Warehouse Name\",\n \"latitude\": 35.576028,\n \"longitude\": -77.3991659,\n \"address\": {\n \"address1\": \"3000 Road Dr\",\n \"city\": \"City\",\n \"state\": \"CA\",\n \"postalCode\": 99999,\n \"country\": \"US\"\n },\n \"businessInfo\": [\n {\n \"type\": \"Showroom\",\n \"hours\": \"Mon: 9am - 5pm | Tue: 9am - 5pm | Wed: 9am - 5pm | Thu: 9am - 5pm | Fri: 9am - 5pm | Sat: Closed | Sun: Closed\",\n \"branchManager\": \"Mr. John Doe\",\n \"phone\": \"(999) 999-9999\",\n \"email\": \"john.doe@ferguson.com\"\n },\n {\n \"type\": \"Plumbing/PVF\",\n \"hours\": \"Mon: 7am - 5pm | Tue: 7am - 5pm | Wed: 7am - 5pm | Thu: 7am - 5pm | Fri: 7am - 5pm | Sat: 8am - 12pm | Sun: Closed\",\n \"branchManager\": \"Mr. John Smith\",\n \"phone\": \"(999) 999-9999\",\n \"email\": \"john.smith@ferguson.com\"\n }\n ]\n }\n]\n}\n```\n
\n#### For internal users, this endpoint features the full detailed response.\n
\n Click to see example response\n```JSON\n{\n\"locationDetailResponse\": {\n \"locationInfo\": {\n \"zip\": 27215,\n \"country\": \"US\",\n \"locInternalId\": 32,\n \"city\": \"Burlington\",\n \"videoBase\": \"https://vimeo.com/\",\n \"latitude\": 36.0621519,\n \"warehouseName\": \"Burlington\",\n \"imageBase\": \"https://image.ferguson.com\",\n \"nearByLocations\": {\n \"location\": [\n {\n \"name\": \"Greensboro, NC\",\n \"url\": \"battleground-ct-greensboro-nc-plumbing\"\n }\n ]\n },\n \"warehouseId\": 33,\n \"locationBusinessList\": {\n \"business\": {\n \"aboutUs\": {\n \"description\": \"Ferguson is the largest distributor of residential and commercial plumbing products, offering: water heaters, pumps, pipe, valves, fittings, equipment, faucets, fixtures and accessories. With over 1300 locations, we have what you need - when you need it and our service is the best in the business. Ferguson plumbing locations are sure to provide the right products and services for your plumbing project, from plumbing fixtures for a home or commercial pipe valves and fittings. You can trust in the fact that we provide the right residential and commercial plumbing supplies for plumbing contractors, remodelers and more. Ferguson continually strives to stay a plumbing industry leader.\",\n \"title\": \"Plumbing/PVF\"\n },\n \"merchandisingVideos\": {\n \"video\": {\n \"sequence\": 10,\n \"name\": 114367965,\n \"desc\": \"Terry Bradshaw on PRO Plus\"\n }\n },\n \"branchManager\": \"Mr. John Doe\",\n \"businessName\": \"Plumbing/PVF\",\n \"locationType\": \"plumbing\",\n \"businessGroupLogo\": \"/group.png\",\n \"products\": {\n \"product\": [\n \"Pumps & Well Supplies\",\n \"Pipe, Valves, Fittings\"\n ]\n },\n \"id\": 2095,\n \"fax\": \"(999) 999-9999\",\n \"businessGroupImages\": {\n \"image\": [\n \"/plumbing.jpg\"\n ]\n },\n \"mdmId\": \"0033\",\n \"email\": \"johnDoe@ferguson.com\",\n \"events\": \"\",\n \"branchPageURL\": \"burlington-nc-plumbing\",\n \"businessPhrase\": \"Supplying residential and commercial plumbing products.\",\n \"hours\": \"Mon: 7am - 5pm | Tue: 7am - 5pm | Wed: 7am - 5pm | Thu: 7am - 5pm | Fri: 7am - 5pm | Sat: Closed | Sun: Closed\",\n \"merchandisingBanners\": {\n \"merchandisingBanner\": [\n {\n \"sequence\": 1,\n \"image_name\": \"/image.jpg\",\n \"supportingDocument\": \"https://fergusonimage.com\",\n \"name\": \"Plumbing Counter Banner\",\n \"typeName\": \"National Promotion\",\n \"groupSequence\": 2,\n \"time\": \"\"\n }\n ]\n },\n \"brands\": {\n \"brand\": [\n \"Brizo\",\n \"American Standard\",\n \"Elkay\"\n ]\n },\n \"professionalAssociations\": {\n \"professionalAssociation\": [\n {\n \"sequence\": 2,\n \"name\": \"NARI\",\n \"logo\": \"/NARI.jpg\",\n \"url\": \"http://www.nari.org/\"\n }\n ]\n },\n \"branchName\": \"Burlington\",\n \"services\": \"\",\n \"team\": {\n \"member\": {\n \"phone\": \"\",\n \"imageUrl\": \"\",\n \"name\": \"Mr. John Doe\",\n \"title\": \"Branch Manager\",\n \"email\": \"\"\n }\n },\n \"emergencyMessageBanner\": \"\",\n \"branchImage\": \"/STOREFRONT.jpg\",\n \"phone\": \"(999) 999-9999\",\n \"mainBranchNbr\": \"0034\",\n \"localImages\": \"\",\n \"usersOwnLogo\": false\n }\n },\n \"addressLine1\": \"2265 Hanford Rd\",\n \"state\": \"NC\",\n \"longitude\": -79.4384224\n },\n \"isError\": false\n}\n}\n```\n
\n---\n---\n> ### Fetches latitude and longitude based on address:\n ```js\n[GET]/v2/locations/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA \n```\n
\n Click to see example response\n```JSON\n{\n\"results\" : [\n {\n \"address_components\" : [\n {\n \"long_name\" : \"1600\",\n \"short_name\" : \"1600\",\n \"types\" : [ \"street_number\" ]\n },\n {\n \"long_name\" : \"Amphitheatre Pkwy\",\n \"short_name\" : \"Amphitheatre Pkwy\",\n \"types\" : [ \"route\" ]\n },\n {\n \"long_name\" : \"Mountain View\",\n \"short_name\" : \"Mountain View\",\n \"types\" : [ \"locality\", \"political\" ]\n },\n {\n \"long_name\" : \"Santa Clara County\",\n \"short_name\" : \"Santa Clara County\",\n \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n },\n {\n \"long_name\" : \"California\",\n \"short_name\" : \"CA\",\n \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n },\n {\n \"long_name\" : \"United States\",\n \"short_name\" : \"US\",\n \"types\" : [ \"country\", \"political\" ]\n },\n {\n \"long_name\" : \"94043\",\n \"short_name\" : \"94043\",\n \"types\" : [ \"postal_code\" ]\n }\n ],\n \"formatted_address\" : \"1600 Amphitheatre Parkway, Mountain View, CA 94043, USA\",\n \"geometry\" : {\n \"location\" : {\n \"lat\" : 37.4224764,\n \"lng\" : -122.0842499\n },\n \"location_type\" : \"ROOFTOP\",\n \"viewport\" : {\n \"northeast\" : {\n \"lat\" : 37.4238253802915,\n \"lng\" : -122.0829009197085\n },\n \"southwest\" : {\n \"lat\" : 37.4211274197085,\n \"lng\" : -122.0855988802915\n }\n }\n },\n \"place_id\" : \"ChIJ2eUgeAK6j4ARbn5u_wAGqWA\",\n \"plus_code\": {\n \"compound_code\": \"CWC8+W5 Mountain View, California, United States\",\n \"global_code\": \"849VCWC8+W5\"\n },\n \"types\" : [ \"street_address\" ]\n }\n],\n \"status\" : \"OK\"\n}\n```\n
\n\nYou can also perform reverse geocoding with this endpoint by passing in latitude and longitude.\n```js\n[GET]/v2/locations/geocode/json?latlng=40.714224,-73.961452 \n```\n
\n Click to see example response\n```JSON\n{\n\"results\" : [\n {\n \"address_components\" : [\n {\n \"long_name\" : \"277\",\n \"short_name\" : \"277\",\n \"types\" : [ \"street_number\" ]\n },\n {\n \"long_name\" : \"Bedford Avenue\",\n \"short_name\" : \"Bedford Ave\",\n \"types\" : [ \"route\" ]\n },\n {\n \"long_name\" : \"Williamsburg\",\n \"short_name\" : \"Williamsburg\",\n \"types\" : [ \"neighborhood\", \"political\" ]\n },\n {\n \"long_name\" : \"Brooklyn\",\n \"short_name\" : \"Brooklyn\",\n \"types\" : [ \"sublocality\", \"political\" ]\n },\n {\n \"long_name\" : \"Kings\",\n \"short_name\" : \"Kings\",\n \"types\" : [ \"administrative_area_level_2\", \"political\" ]\n },\n {\n \"long_name\" : \"New York\",\n \"short_name\" : \"NY\",\n \"types\" : [ \"administrative_area_level_1\", \"political\" ]\n },\n {\n \"long_name\" : \"United States\",\n \"short_name\" : \"US\",\n \"types\" : [ \"country\", \"political\" ]\n },\n {\n \"long_name\" : \"11211\",\n \"short_name\" : \"11211\",\n \"types\" : [ \"postal_code\" ]\n }\n ],\n \"formatted_address\" : \"277 Bedford Avenue, Brooklyn, NY 11211, USA\",\n \"geometry\" : {\n \"location\" : {\n \"lat\" : 40.714232,\n \"lng\" : -73.9612889\n },\n \"location_type\" : \"ROOFTOP\",\n \"viewport\" : {\n \"northeast\" : {\n \"lat\" : 40.7155809802915,\n \"lng\" : -73.9599399197085\n },\n \"southwest\" : {\n \"lat\" : 40.7128830197085,\n \"lng\" : -73.96263788029151\n }\n }\n },\n \"place_id\" : \"ChIJd8BlQ2BZwokRAFUEcm_qrcA\",\n \"types\" : [ \"street_address\" ]\n }\n],\n \"status\" : \"OK\"\n}\n```\n
\n\nNote: Reverse geocoding is an estimate. The geocoder will attempt to find the closest addressable location within a certain tolerance. There may be multiple locations in the response results array. If no match is found, the geocoder will return zero results.\n\n \n", "contact": { "name": "Ferguson API Support", "email": "api.team@ferguson.com" }, "version": "2.1.1", "x-jentic-source-url": "https://api.swaggerhub.com/apis/Ferguson-API/API-Location/2.1.1/swagger.json" }, "servers": [ { "url": "https://uatapi2.ferguson.com", "description": "Non-Production" }, { "url": "https://api2.ferguson.com", "description": "Production" } ], "paths": { "/v2/locations": { "get": { "tags": [ "Location Summary" ], "description": "Returns a list of location summary data by pagination.", "operationId": "getLocations", "parameters": [ { "name": "page", "in": "query", "description": "Page number", "schema": { "type": "integer", "default": 0 } }, { "name": "size", "in": "query", "description": "Number of entities in a page to return", "schema": { "type": "integer", "default": 20 } } ], "responses": { "200": { "description": "List of locations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Locations-Summary" } } } }, "default": { "description": "Catch-all for all potential errors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v2/locations/{locationId}": { "get": { "tags": [ "Location Detail" ], "description": "Returns a specific location based on the location id.", "operationId": "getLocationById", "parameters": [ { "name": "locationId", "in": "path", "description": "Id number of Location", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "Detailed information for one location.", "headers": { "Last-Modified": { "schema": { "type": "string" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Locations-Detail" } } } }, "default": { "description": "Catch-all for all potential errors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/v2/locations/geocode/{outputFormat}": { "get": { "tags": [ "Geocode" ], "description": "Returns a human readable address or latitude and longitude cordinates.", "operationId": "getLatLong", "parameters": [ { "name": "outputFormat", "in": "path", "description": "Format of response expected. (json or xml)", "required": true, "schema": { "type": "string" } }, { "name": "address", "in": "query", "description": "Address to look up that is URL Encoded.", "schema": { "type": "string" } }, { "name": "latlng", "in": "query", "description": "The lat and long to lookup an address - that is URL encoded.", "schema": { "type": "string" } } ], "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Geocode-Response" } } } }, "default": { "description": "Catch-all for all potential errors", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "Location-Detail": { "type": "object", "properties": { "id": { "type": "integer", "example": 33 }, "name": { "type": "string", "example": "Washington DC Distro" }, "latitude": { "type": "number", "format": "double" }, "longitude": { "type": "number", "format": "double" }, "address": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/Location-Address2" } ] }, "businessInfo": { "type": "array", "items": { "$ref": "#/components/schemas/Location-BusinessInfo" } } } }, "Location-Address": { "type": "object", "properties": { "address1": { "type": "string", "example": "1234 Location Ave" }, "address2": { "type": "string", "example": "1234 Location Ave" }, "address3": { "type": "string", "example": "1234 Location Ave" }, "city": { "type": "string", "example": "Hollywood" }, "state": { "type": "string", "example": "CA" }, "postalCode": { "type": "string", "example": "12545" }, "country": { "type": "string", "example": "US" }, "phone": { "type": "string", "example": "5555555555" }, "email": { "type": "string", "example": "john.doe@Ferguson.com" } } }, "Location-Address2": { "type": "object", "properties": { "address1": { "type": "string", "example": "1234 Location Ave" }, "address2": { "type": "string", "example": "1234 Location Ave" }, "address3": { "type": "string", "example": "1234 Location Ave" }, "city": { "type": "string", "example": "Hollywood" }, "state": { "type": "string", "example": "CA" }, "postalCode": { "type": "string", "example": "12545" }, "country": { "type": "string", "example": "US" } } }, "Location-BusinessInfo": { "type": "object", "properties": { "branchManager": { "type": "string", "example": "John Doe" }, "type": { "type": "string", "example": "HVAC" }, "hours": { "type": "string", "example": "Mon: 9am - 5pm | Tue: 9am - 5pm | Wed: 9am - 5pm | Thu: 9am - 5pm | Fri: 9am - 5pm | Sat: Closed | Sun: Closed" }, "phone": { "type": "string", "example": "(999) 999 - 9999" }, "email": { "type": "string", "example": "john.doe@Ferguson.com" } } }, "Locations-Detail": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/Location-Detail" } } } }, "Location-Summary": { "type": "object", "properties": { "id": { "type": "integer", "example": 14 }, "name": { "type": "string", "example": "Beltsville, MD" }, "type": { "type": "string", "example": "Stores" }, "regionCode": { "type": "string", "example": "RICH" }, "status": { "type": "string", "example": "Operational" }, "address": { "type": "object", "allOf": [ { "$ref": "#/components/schemas/Location-Address" } ] } } }, "Locations-Summary": { "type": "object", "properties": { "totalCount": { "type": "string", "example": "2520" }, "page": { "type": "integer", "example": 10 }, "size": { "type": "integer", "example": 100 }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/Location-Summary" } } } }, "Geocode-Response": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/Geocode-Detail" } }, "status": { "type": "string", "example": "OK" } } }, "Geocode-Detail": { "type": "object", "properties": { "address_components": { "type": "array", "items": { "$ref": "#/components/schemas/GeocodeDetail_address_components" } }, "formatted_address": { "type": "string", "example": "1600 Amphitheatre Parkway, Mountain View, CA 94043, USA" }, "geometry": { "$ref": "#/components/schemas/GeocodeDetail_geometry" }, "place_id": { "type": "string", "example": "ChIJ2eUgeAK6j4ARbn5u_wAGqWA" }, "plus_code": { "$ref": "#/components/schemas/GeocodeDetail_plus_code" }, "types": { "type": "array", "items": { "type": "object", "example": "street_address" } } } }, "GeocodeDetail_address_components": { "type": "object", "properties": { "long_name": { "type": "string", "example": "1600" }, "short_name": { "type": "string", "example": "1600" }, "types": { "type": "array", "items": { "type": "object", "example": "street_number" } } } }, "GeocodeDetail_geometry_location": { "type": "object", "properties": { "lat": { "type": "integer" }, "lng": { "type": "integer" } } }, "GeocodeDetail_geometry_viewport": { "type": "object", "properties": { "northeast": { "$ref": "#/components/schemas/GeocodeDetail_geometry_location" }, "southwest": { "$ref": "#/components/schemas/GeocodeDetail_geometry_location" } } }, "GeocodeDetail_geometry": { "type": "object", "properties": { "location": { "$ref": "#/components/schemas/GeocodeDetail_geometry_location" }, "location_type": { "type": "string", "example": "ROOFTOP" }, "viewport": { "$ref": "#/components/schemas/GeocodeDetail_geometry_viewport" } } }, "GeocodeDetail_plus_code": { "type": "object", "properties": { "compound_code": { "type": "string", "example": "CWC8+W5 Mountain View, California, United States" }, "global_code": { "type": "string", "example": "849VCWC8+W5" } } }, "Error": { "required": [ "contact", "error code", "message", "reason" ], "type": "object", "properties": { "message": { "type": "array", "description": "Can contain a single string, array, integer or another JSON object. Intentionally vague as it will sometimes contain the error response from the backend server.", "items": { "type": "object" } }, "error code": { "type": "string", "description": "HTTP status code." }, "reason": { "type": "string", "description": "A short meaningful reason." }, "contact": { "type": "string", "description": "Contact info for the error." } } } }, "parameters": { "locationId": { "name": "locationId", "in": "path", "description": "Id number of Location", "required": true, "schema": { "type": "string" } }, "page": { "name": "page", "in": "query", "description": "Page number", "schema": { "type": "integer", "default": 0 } }, "size": { "name": "size", "in": "query", "description": "Number of entities in a page to return", "schema": { "type": "integer", "default": 20 } } }, "securitySchemes": { "application": { "type": "oauth2", "description": "This API uses OAuth 2.0 client credentials grant type. You must use a Content-Type header of 'application/x-www-form-urlencoded' with form parameters of grant_type=client_credentials.\n\nYou can also specify an additional form parameter of 'expires_in' so long as it is less than 3600 seconds.\n \n", "flows": { "clientCredentials": { "tokenUrl": "https://uatapi2.ferguson.com/oauth2/token", "scopes": {} } } } } }, "security": [ { "application": [] } ], "tags": [ { "name": "Location Summary", "description": "Fetches a summary of location data via pagination using query parameters." }, { "name": "Location Detail", "description": "Returns specific location information for just one location id." }, { "name": "Geocode", "description": "Converts an address into geographic coordinates. (Can also do reverse geocoding)" } ], "x-original-swagger-version": "2.0" }