Get Locations

The Locations API provides the capability of retrieving FedEx Office locations.

Swagger

			
swagger: '2.0'
info:
  x-ibm-name: location
  title: Location
  version: 1.0.0
schemes:
  - https
host: $(catalog.host)
basePath: /v1
consumes:
  - application/json
produces:
  - application/json
securityDefinitions:
  oauth2:
    type: oauth2
    description: ''
    flow: accessCode
    authorizationUrl: 'https://<............................>/fsc/oauth2/authorize'
    scopes:
      Fulfillment_Returns: ''
    tokenUrl: 'https://<............................>/fsc/oauth2/token'
  Client_Secret:
    type: apiKey
    description: ''
    in: header
    name: X-IBM-Client-Secret
  Client_Id:
    type: apiKey
    in: header
    name: X-IBM-Client-Id
security:
  - Client_Id: []
    Client_Secret: []
    oauth2:
      - Fulfillment_Returns
x-ibm-configuration:
  testable: true
  enforced: true
  phase: realized
paths:
  /locations:
    get:
      responses:
        '200':
          description: 200 OK      
      parameters:
        - name: addressLine1
          type: string
          required: false
          in: query
          description: 123 Main Street
        - name: addressLine2
          type: string
          required: false
          in: query
          description: 123 Main Street
        - name: city
          type: string
          required: false
          in: query
          description: PLUM
        - name: stateCode
          type: string
          required: false
          in: query
          description: PA
        - name: zipCode
          type: string
          required: false
          in: query
          description: '15238'
        - name: countryCode
          type: string
          required: false
          in: query
          description: US
        - name: distance
          type: string
          required: false
          in: query
          description: '10'
        - name: limit
          type: string
          required: false
          in: query
          description: '3'
        - name: accessToken
          type: string
          required: false
          in: header
          description: 'Enter AccessToken, it is mandatory.'
	  summary: Location Service
      description: The Locations API provides the capability of retrieving FedEx Office locations.
			
		

Sample Request

			
	•	Retrieve location details using below details
	https://<........>/api/v1/locations?addressLine1=123 MainStreet&addressLine2=123 Main Street&stateCode=PA&zipCode=15238&countryCode=US&city=PLUM

			
		

Sample Response

Success Response

			
{
	"requestIdentifier" : "COM1482178",
	"transactionDate" : "2014-01-09T13:31:00-05:00",
	"status" : true,
	"locations" : {
		"totalResultsAvailable" : "63",
		"resultsReturned" : "3",
		"matchedAddressGeoCoordinates" : "+40.5230452-79.8632834/",
		"matchedAddress" : {
			"city" : "Pittsburgh",
			"stateCode" : "PA",
			"zipCode" : "15238",
			"countryCode" : "US",
			"residential" : "false"
		},
		"locationsFound" : [{
			"distance" : {
			"value" : "1.494",
			"units" : "MI"
			},
			"locationId" : "S5XVN",
			"contact" : {
				"companyName" : "Walgreens"
			},
			"address" : {
			"streetLines" : "324 Hulton Rd",
			"city" : "Oakmont",
			"stateCode" : "PA",
			"zipCode" : "15139",
			"countryCode" : "US",
			"residential" : "false"
			},
			"geoCoordinates" : "+40.52528-79.841736/",
			"locationType" : "FEDEX_OFFICE",
			"mapUrl" : "https://maps.googleapis.com/maps/api/staticmap?size=350x350&zoom=15&
			markers=color:blue%7Clabel:A%7C40.52528,-79.841736&maptype=roadmap&sensor=false",
			"normalHours" : [{
				"dayofWeek" : "MON",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
					"begins" : "08:00:00",
					"ends" : "22:00:00"
				}
			}, {
			"dayofWeek" : "TUE",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
				"begins" : "08:00:00",
				"ends" : "22:00:00"
				}
			}, {
			"dayofWeek" : "WED",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
					"begins" : "08:00:00",
					"ends" : "22:00:00"
					}
			}, {
				"dayofWeek" : "THU",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
					"begins" : "08:00:00",
					"ends" : "22:00:00"
					}
				}, {
				"dayofWeek" : "FRI",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
					"begins" : "08:00:00",
					"ends" : "22:00:00"
				}
				}, {
				"dayofWeek" : "SAT",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
					"begins" : "08:00:00",
					"ends" : "22:00:00"
				}
				}, {
				"dayofWeek" : "SUN",
				"operationalHours" : "OPEN_BY_HOURS",
				"hours" : {
					"begins" : "08:00:00",
					"ends" : "22:00:00"
					}
				}
			]
		}
	]
}
}

			
		

OAuth 2.0

HTTP Headers Description
Authorization You must always provide the access token for authorization to access the API.

HTTP-Header       Value
Authorization       Bearer accessToken
Origin Origin URL.

HTTP-Header       Value
Origin                domain.com

Custom authentication

HTTP Headers Description
X-IBM-Client-Id You must always provide in the HTTP header your API portal application's client ID (X-IBM-Client-Id) to access the API.

HTTP-Header       Value
X-IBM-Client-Id     ************
X-IBM-Client-Secret You must always provide in the HTTP header your API portal application's client secret (X-IBM-Client-Secret) to access the API.

HTTP-Header       Value
X-IBM-Client-Secret     ************
AccessToken Application Access Token
Origin Origin URL.

HTTP-Header       Value
Origin                domain.com

Query Parameters

Parameter Data type Description Required
addressLine1 String Address line 1 for the from address field to search by. Y
addressLine2 String Address line 2 for the from address field to search by. Y
City String City for the from address field to search by. Y
stateCode String State for the from address field to search by. Y
zipCode String Zip code for the from address field to search by. Y
countryCode String Country for the from address field to search by.
Valid Values: See Country Codes
Y
Distance Number Indicates the search radius to look for locations.
Valid Values: 5, 15, 25, 50
Default is 50
N
limit Number Indicates number of results requested.
Valid Values: 1-25
Default is 3
N

Response Attribute

Parameter Data type Description
requestIdentifier String Request identifier.
transactionDate Date Transaction date/time.
UTC Format: 2014-01-09T13:31:00-05:00
success boolean Status of the transaction
Valid Values: True or False
Locations    
totalResultsAvailable String Total number of results found.
resultsReturned String Number of results returned, not greater than limit.
matchedAddressGeoCoordinates String Geo-coordinates for given address.
locations.matchedAddress    
City String Given address matched city.
stateCode String Given address matched state.
zipCode String Given address matched postal code.
countryCode String Given address matched country code.
Residential String Given address residential flag.
locations.locationsFound    
locationId String FedEx location ID.
geoCoordinates String Geo-coordinates for result address.
locationType String Location type for result address.
Valid Values: See Location Types
mapUrl String Google maps URLs for result address.
locations.locationsFound.distance    
Value String Distance from given address value.
Units String Unit of measure for given value.
locations.locationsFound.contact    
companyName String Name of result address.
locations.locationsFound.address    
streetLines String Result address street lines.
City String Result address city.
stateCode String Result address state.
zipCode String Result address postal code.
countryCode String Result address country code.
Residential String Result address residential flag.
locations.locationsFound.normalHours[]    
dayofWeek String Day of week for normal hours.
operationalHours String ID for type of hours.
Valid Values: See Location Operational Hours
locations.locationsFound.normalHours[].hours    
Begins String Open time for day of week.
Ends String Close time for day of week.
errors[]    
Code String Code associated with the error.
Description String Description of the error.

HTTP Status Code

Code Description
200 OK - HTTP Response for successfully processed requests
400 Bad Request.
403 Forbidden
404 Not Found - Server couldn’t find anything matching request URI
500 Internal Server Error – Unable to process the request

Error Code

Code Description
ERR-SYS-0001 Your request cannot be processed due to a system error.
ERR-CMR-0001 Input data validation failed.
ERR-CMR-0002 Authentication Failed. Invalid Access Token.
ERR-CMR-0003 Missing mandatory fields.
ERR-TRK-0001 An error occurred while calling FedEx Tracking service

Country Codes

Code Name
US United States of America
CA Canada
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua and Barbuda
AI Anguilla
AM Armenia
AO Angola
AQ Antarctica
AR Argentina
AS American Samoa
AT Austria
AU Australia
AW Aruba
AX Åland Islands
AZ Azerbaijan
BA Bosnia and Herzegovina
BB Barbados
BD Bangladesh
BE Belgium
BF Burkina Faso
BG Bulgaria
BH Bahrain
BI Burundi
BJ Benin
BL Saint Barthélemy
BM Bermuda
BN Brunei Darussalam
BO Bolivia (Plurinational State of)
BQ Bonaire, Sint Eustatius and Saba
BR Brazil
BS Bahamas
BT Bhutan
BV Bouvet Island
BW Botswana
BY Belarus
BZ Belize
CC Cocos (Keeling) Islands
CD Congo (the Democratic Republic of the)
CF Central African Republic
CG Congo
CH Switzerland
CI Côte d'Ivoire
CK Cook Islands
CL Chile
CM Cameroon
CN China
CO Colombia
CR Costa Rica
CU Cuba
CV Cabo Verde
CW Curaçao
CX Christmas Island
CY Cyprus
CZ Czechia
DE Germany
DJ Djibouti
DK Denmark
DM Dominica
DO Dominican Republic
DZ Algeria
EC Ecuador
EE Estonia
EG Egypt
EH Western Sahara
ER Eritrea
ES Spain
ET Ethiopia
FI Finland
FJ Fiji
FK Falkland Islands [Malvinas]
FM Micronesia (Federated States of)
FO Faroe Islands
FR France
GA Gabon
GB United Kingdom of Great Britain and Northern Ireland
GD Grenada
GE Georgia
GF French Guiana
GG Guernsey
GH Ghana
GI Gibraltar
GL Greenland
GM Gambia
GN Guinea
GP Guadeloupe
GQ Equatorial Guinea
GR Greece
GS South Georgia and the South Sandwich Islands
GT Guatemala
GU Guam
GW Guinea-Bissau
GY Guyana
HK Hong Kong
HM Heard Island and McDonald Islands
HN Honduras
HR Croatia
HT Haiti
HU Hungary
ID Indonesia
IE Ireland
IL Israel
IM Isle of Man
IN India
IO British Indian Ocean Territory
IQ Iraq
IR Iran (Islamic Republic of)
IS Iceland
IT Italy
JE Jersey
JM Jamaica
JO Jordan
JP Japan
KE Kenya
KG Kyrgyzstan
KH Cambodia
KI Kiribati
KM Comoros
KN Saint Kitts and Nevis
KP Korea (the Democratic People's Republic of)
KR Korea (the Republic of)
KW Kuwait
KY Cayman Islands
KZ Kazakhstan
LA Lao People's Democratic Republic
LB Lebanon
LC Saint Lucia
LI Liechtenstein
LK Sri Lanka
LR Liberia
LS Lesotho
LT Lithuania
LU Luxembourg
LV Latvia
LY Libya
MA Morocco
MC Monaco
MD Moldova (the Republic of)
ME Montenegro
MF Saint Martin (French part)
MG Madagascar
MH Marshall Islands
MK Macedonia (the former Yugoslav Republic of)
ML Mali
MM Myanmar
MN Mongolia
MO Macao
MP Northern Mariana Islands
MQ Martinique
MR Mauritania
MS Montserrat
MT Malta
MU Mauritius
MV Maldives
MW Malawi
MX Mexico
MY Malaysia
MZ Mozambique
NA Namibia
NC New Caledonia
NE Niger
NF Norfolk Island
NG Nigeria
NI Nicaragua
NL Netherlands
NO Norway
NP Nepal
NR Nauru
NU Niue
NZ New Zealand
OM Oman
PA Panama
PE Peru
PF French Polynesia
PG Papua New Guinea
PH Philippines
PK Pakistan
PL Poland
PM Saint Pierre and Miquelon
PN Pitcairn
PR Puerto Rico
PS Palestine, State of
PT Portugal
PW Palau
PY Paraguay
QA Qatar
RE Réunion
RO Romania
RS Serbia
RU Russian Federation
RW Rwanda
SA Saudi Arabia
SB Solomon Islands
SC Seychelles
SD Sudan
SE Sweden
SG Singapore
SH Saint Helena, Ascension and Tristan da Cunha
SI Slovenia
SJ Svalbard and Jan Mayen
SK Slovakia
SL Sierra Leone
SM San Marino
SN Senegal
SO Somalia
SR Suriname
SS South Sudan
ST Sao Tome and Principe
SV El Salvador
SX Sint Maarten (Dutch part)
SY Syrian Arab Republic
SZ Swaziland
TC Turks and Caicos Islands
TD Chad
TF French Southern Territories
TG Turks and Caicos Islands
TH Thailand
TJ Tajikistan
TK Tokelau
TL Timor-Leste
TM Turkmenistan
TN Tunisia
TO Tonga
TR Turkey
TT Trinidad and Tobago
TV Tuvalu
TW Taiwan (Province of China)
TZ Tanzania, United Republic of
UA Ukraine
UG Uganda
UM United States Minor Outlying Islands
UY Uruguay
UZ Uzbekistan
VA Holy See
VC Saint Vincent and the Grenadines
VE Venezuela (Bolivarian Republic of)
VG Virgin Islands (British)
VI Virgin Islands (U.S.)
VN Viet Nam
VU Vanuatu
WF Wallis and Futuna
WS Samoa
YE Yemen
YT Mayotte
ZA South Africa
ZM Zambia
ZW Zimbabwe

Location Service Location Types

Code Name
FEDEX_OFFICE FedEx Office Locations

Location Service Operational Hours

Code
CLOSED_ALL_DAY
OPEN_ALL_DAY
OPEN_BY_HOURS