Get Locker Info API
USPS Web Tools™
Application Programming Interface
User Guide
Version 1.4 (02/26/2025)
Table of Contents
This document contains a Reference Guide to
the Get Locker Info API. See the
Developers Guide to learn the administrative process for
gaining access to the Web Tools APIs as well as the basic mechanism for calling
the APIs and processing the results. The Developer’s Guide also contains
information on testing and troubleshooting.
Note: The Request Parameter sections present the XML input tags for
generating live requests along with the restrictions on the values allowed. An
error message will be returned if an incorrect value is entered. Also, be aware
of the maximum character amounts allowed for some tags. If the user enters more
than those amounts, an error will not be generated. Web Tools will simply pass
in the characters up to the maximum amount allowed and disregard the rest. This
is important since the resulting value could prevent a correct response.
When building the XML request, pay
particular attention to the order and case for tags. An error
message will be returned if an incorrect value is entered. Remember that all
data and attribute values in this document are for illustration purposes and
are to be replaced by your actual values. For instance, a line of sample code
may be:
In this instance, you will replace “2” with
the weight in pounds for the package.
The Web Tools Get Locker Info API requires additional API permissions. Integrators
should contact the Smart Locker Customer Onboarding Support team via
email at USPSSmartLockerAPI@usps.gov
to request access and reference http://www.uspssmartpackagelockers.com/faq
for details.
For additional USPS Web Tools information, please refer to the Step-By-Step guide found on the Technical Documentation section of the Web Tools page on veosonica.com/webtools.
The Web Tools Get Locker Info API (API=GetLockerInfo) allows
integrators to search for operational USPS Smart Locker or PO Box Locker locations
(identified by unique Facility ID <FacilityID>).
The Facility ID output returned in the GetLockerInfo
API is a required input for label creation to a Smart or PO Box Locker via the eVS Domestic Label API.
This API enables integrators to search by City/State
and/or ZIP or search all operational Locker locations within the USPS network. If
a Locker location is available, the Facility ID and supporting information
(such as maximum locker dimensions) is returned to enable integrators to select
a locker that fits their package. When no City, State, or ZIP parameters are
provided (i.e., “All” locker locations requested), the API will return the
first 100 Lockers and a location context value for integrators to use to call
for additional locations.
Scheme |
Host |
Path |
API |
XML |
http:// |
secure.shippingapis.com |
/ShippingAPI.dll |
API=GetLockerInfo |
&XML= (see Tag Descriptions below) |
Note: GET HTTP requests have length restrictions, whereas POST HTTP requests do not. Please take this under consideration when determining the request-response method that you choose.
Tag Name |
Occurs |
Description |
Type |
Validation |
GetLockerInfoRequest |
Required |
API=GetLockerInfo |
Alias |
|
GetLockerInfoRequest / USERID |
Required |
This attribute specifies your Web Tools user ID. See the Developer's Guide for information on obtaining your USERID. For example: USERID="XXXXXXX" |
NMTOKEN |
|
GetLockerInfoRequest / PASSWORD |
Optional |
This attribute
specifies your Web Tools password. See the Developer's Guide for information on your Password. For Example: PASSWORD="XXXXXXX" |
NMTOKEN |
|
GetLockerInfoRequest / Revision |
Optional |
Set this value to “1” to return the response tag “LockerType” For example: |
String |
|
GetLockerInfoRequest / City |
Required |
City of the Post Office where the Locker is located. To search by
City, State must also be included. To return all lockers, do not populate. For example: Note: |
String |
|
GetLockerInfoRequest / State |
Required |
State of the Post Office where the Locker is located. Value should be
passed as two-letter state abbreviation. To search by State, City must also
be included. To return all lockers, do not populate. For example: Note: |
String |
minLength=2 maxLength=2 |
GetLockerInfoRequest /Zip5 |
Required |
5-digit ZIP code of the Post Office where the Locker is located. To
return all lockers, do not populate. For example: Note: |
String |
pattern=\d{5} |
GetLockerInfoRequest / AdditionalLocationsContextValue |
Optional |
Pagination feature used to return remaining
lockers when more than 100 lockers satisfy search criteria. Note: When results exceed 100 lockers, the <AdditionalLocationsContextValue>
tag is returned. A subsequent request with this value will return
the next 100 lockers until all data is returned indicated when this tag no
longer returns in the XML response. |
String |
|
GetLockerInfoRequest |
Required |
|
Alias |
|
Simple Request <GetLockerInfoRequest USERID="XXXXXXXXX"
PASSWORD="">
GetLockerInfoRequest> All Call
– Returns All Operational Lockers (limited to 100 lockers per XML response) <GetLockerInfoRequest USERID="XXXXXXXXX"
PASSWORD="">
GetLockerInfoRequest> Subsequent All Call – Returns remaining locations
using context value returned in original XML response GetLockerInfoRequest USERID="XXXXXXXXX"
PASSWORD="">
GetLockerInfoRequest> |
Tag Name |
Occurs |
Description |
Type |
Validation |
GetLockerInfoResponse |
Required |
|
Alias |
|
GetLockerInfoResponse /Location |
Required |
|
String |
minOccurs="1" maxOccurs="100" |
GetLockerInfoResponse /Location/FacilityID |
Required |
Unique identifier of the Post Office
where the Locker is located. Note: This value is required when generating a Locker label in the Web
Tools eVS Domestic Label API. |
String |
|
GetLockerInfoResponse /Location/LocationAddress |
Required |
Post Office (where the Locker is located) Address group. |
Address Type |
|
GetLockerInfoResponse /Location/LocationAddress/Address1 |
Required |
Primary Street Address of the Post Office where
the Locker is located. |
String |
|
GetLockerInfoResponse /Location/LocationAddress/Address2 |
Optional |
Secondary Address (if available) of the Post Office where the Locker
is located. |
String |
|
GetLockerInfoResponse /Location/LocationAddress/City |
Required |
City of the Post Office where the Locker is located. |
City Type |
maxLength ="28" minLength ="0" |
GetLockerInfoResponse /Location/LocationAddress/State |
Required |
State of the Post Office where the Locker is located. Returned as two-letter
state abbreviation. |
State Type |
[a-z or A-Z]{2} |
GetLockerInfoResponse /Location/LocationAddress/Zip5 |
Required |
5-digit ZIP code of the Post Office where the Locker is located. |
Zip5 Type |
[0-9]{5} |
GetLockerInfoResponse /Location/LocationAddress/Zip4 |
Required |
4-digit ZIP code of the Post Office where the Locker is located. |
Zip4 Type |
[0-9]{4} |
GetLockerInfoResponse /Location/LocationLatitude |
Required |
Latitude of the Post Office where the Locker is located. |
String |
|
GetLockerInfoResponse /Location/LocationLongitude |
Required |
Longitude of the Post Office where the Locker is located. |
String |
|
GetLockerInfoResponse /Location/DeliveryAddress |
Required |
Locker Delivery Address group. |
Group |
|
GetLockerInfoResponse /Location/DeliveryAddress/Address1 |
Required |
Primary Street Delivery Address of the Locker. Smart Lockers and PO Box
Lockers function the exact same but have different delivery addresses (i.e., “USPS
SMART LOCKER” or “PO BOX LOCKER”). |
String |
|
GetLockerInfoResponse /Location/DeliveryAddress/Address2 |
Required |
Secondary Delivery Address of the Locker (if available). |
String |
|
GetLockerInfoResponse /Location/DeliveryAddress/City |
Required |
Delivery City of the Locker. |
String |
maxLength ="28" minLength ="0" |
GetLockerInfoResponse /Location/DeliveryAddress/State |
Required |
Delivery State of the Locker. Returned as two-letter state abbreviation. |
String |
[a-z or A-Z]{2} |
GetLockerInfoResponse /Location/DeliveryAddress/Zip5 |
Required |
5-digit Delivery ZIP code of the Locker. |
String |
[0-9]{5} |
GetLockerInfoResponse /Location/DeliveryAddress/Zip4 |
Required |
4-digit Delivery ZIP code of the Locker. |
String |
[0-9]{4} |
GetLockerInfoResponse /Location/DeliveryAddress/DeliveryPoint |
Required |
2-digit Delivery Point Code (DPC) of the Locker. |
String |
[0-9]{2} |
GetLockerInfoResponse /Location/LockerType |
Required Revision 1 |
Locker Type. Indicates if Locker is a USPS Smart Locker or a PO Box. |
String |
Enumeration= ·
POBoxLocker ·
SmartLocker |
GetLockerInfoResponse /Location/LockerStatus |
Required |
Defaults to Operational. Note: This API will only return lockers in “Operational” status. |
String |
|
GetLockerInfoResponse /Location/LockerOnline |
Required |
Status of an operational locker. |
Boolean |
True or False |
GetLockerInfoResponse /Location/LockerSizeMaximumLength |
Required |
Length of the biggest locker compartment for the locker unit. |
Decimal |
|
GetLockerInfoResponse /Location/LockerSizeMaximumWidth |
Required |
Width of the biggest locker compartment for the locker. |
Decimal |
|
GetLockerInfoResponse /Location/LockerSizeMaximumHeight |
Required |
Height of the biggest locker compartment for the locker unit. |
Decimal |
|
GetLockerInfoResponse /Location/ServiceDirectShip |
Required |
Indicates whether the locker can accept direct-to-locker shipments. |
Boolean |
True or False |
GetLockerInfoResponse /Location/ServiceRedelivery |
Required |
Indicates whether the locker can support redelivery. |
Boolean |
True or False |
GetLockerInfoResponse /Location/ServicePOBoxOverflow |
Required |
Indicates whether the locker can accept packages
that cannot fit into a PO Box. |
Boolean |
True or False |
GetLockerInfoResponse /Location/PrepaidReturns |
Required |
Indicates whether the locker can accept prepaid returns. |
Boolean |
True or False |
GetLockerInfoResponse /Location/ServiceLabelPrinting |
Required |
Indicates whether the locker has printing capability. |
Boolean |
True or False |
GetLockerInfoResponse /AdditionalContextValue |
Optional |
Returns the 7-digit context value so integrators can obtain additional
locations. |
Context Type |
[0-9]{7} |
GetLockerInfoResponse |
Required |
|
Alias |
|
GetLockerInfo Response (Single Response) <GetLockerInfoResponse> <FacilityID>1368559FacilityID> <LocationName>JOSE
MARTILocationName> <LocationAddress> LocationAddress> <LocationLatitude>25.7768520000LocationLatitude> <LocationLongitude>-80.2391510000LocationLongitude> <DeliveryAddress> <DeliveryPoint>99DeliveryPoint> DeliveryAddress> <LockerType>SmartLockerLockerType> <LockerStatus>OperationalLockerStatus> <LockerOnline>TrueLockerOnline> <LockerSizeMaximumLength>18.50LockerSizeMaximumLength> <LockerSizeMaximumWidth>14.50LockerSizeMaximumWidth> <LockerSizeMaximumHeight>13.00LockerSizeMaximumHeight> <ServiceDirectShip>TrueServiceDirectShip> <ServiceRedelivery>TrueServiceRedelivery> <ServicePOBoxOverflow>TrueServicePOBoxOverflow> <ServicePrepaidReturns>FalseServicePrepaidReturns> <ServiceLabelPrinting>FalseServiceLabelPrinting> GetLockerInfoResponse> GetLockerInfo Sample
Response (Multiple Locations returned; exceeds 100) <GetLockerInfoResponse> <FacilityID>1434185FacilityID> <LocationName>LENFANT
PLAZALocationName> <LocationAddress>
LocationAddress> <LocationLatitude>38.8839010000LocationLatitude> <LocationLongitude>-77.0264070000LocationLongitude> <DeliveryAddress>
<DeliveryPoint>99DeliveryPoint> DeliveryAddress> <LockerType>SmartLockerLockerType> <LockerStatus>OperationalLockerStatus> <LockerOnline>TrueLockerOnline> <LockerSizeMaximumLength>17.25LockerSizeMaximumLength> <LockerSizeMaximumWidth>17.25LockerSizeMaximumWidth> <LockerSizeMaximumHeight>15.00LockerSizeMaximumHeight> <ServiceDirectShip>TrueServiceDirectShip> <ServiceRedelivery>TrueServiceRedelivery> <ServicePOBoxOverflow>TrueServicePOBoxOverflow> <ServicePrepaidReturns>FalseServicePrepaidReturns> <ServiceLabelPrinting>FalseServiceLabelPrinting> <FacilityID>1437347FacilityID> <LocationName>MERRIFIELDLocationName> <LocationAddress>
LocationAddress> <LocationLatitude>38.8721130000LocationLatitude> <LocationLongitude>-77.2353660000LocationLongitude> <DeliveryAddress>
<DeliveryPoint>11DeliveryPoint> DeliveryAddress> <LockerType>POBoxLockerLockerType> <LockerStatus>OperationalLockerStatus> <LockerOnline>TrueLockerOnline> <LockerSizeMaximumLength>22.50LockerSizeMaximumLength> <LockerSizeMaximumWidth>22.50LockerSizeMaximumWidth> <LockerSizeMaximumHeight>12.00LockerSizeMaximumHeight> <ServiceDirectShip>FalseServiceDirectShip> <ServiceRedelivery>FalseServiceRedelivery> <ServicePOBoxOverflow>TrueServicePOBoxOverflow> <ServicePrepaidReturns>FalseServicePrepaidReturns> <ServiceLabelPrinting>FalseServiceLabelPrinting> … [truncated
for space] GetLockerInfoResponse> |
Error conditions
are handled at the main XML document level. When parsing, it is best to check
for an error document first before checking for good data. Error documents have
the following format:
<HelpFile>HelpFile>
<HelpContext>HelpContext>
Where:
·
Number = the error number generated by the Web
Tools server.
·
Source = the component and interface that generated
the error on the Web Tools server.
·
Description = the error description.
·
HelpFile =
[reserved for future use].
·
HelpContext =
[reserved for future use].
Errors that are further down in the hierarchy also follow the above format.
An
<GetLockerInfoResponse>
<ErrorCode>-2147219102ErrorCode>
<ErrorMessage>No
Parcel Locker was found for the given search parameters.</ErrorMessage>
GetLockerInfoResponse>