Find Service Points
ShipEngine offers two methods to find service points and their associated details:
- List service points:
POST /v1/service_points/list
- Lists all available service points for the carrier with their service point ID and related details. This method relies on either the address or latitude and longitude as the reference point and allows you to refine your results by indicating a distance radius in kilometers.
- Get service point by ID:
GET /v1/service_points/{carrier_code}/{country_code}/{service_point_id}
- Returns the service point details of a specific service point. This method relies on adding the carrier code, country code, and service point ID as path parameters to the endpoint.
If you are new to using service points, review our Introduction to Service Points and Create PUDO Labels pages to learn more about using service points with ShpEngine.
Requirements
The service points endpoint is available only to accounts on an Advanced plan or higher.
Service Points Properties
Property | Required? | Type | Description |
---|---|---|---|
address_query | ✔ * | String | Unstructured address text to search for service points. (EX: 123 Any St, Austin, TX) |
address | ✔ * | Object | When used, you must provide the country_code and at least one other address property (Ex: city and country_code ). The more fields you enter, the more accurate your results will be. |
country_code | ✔ | String | A required property in the address object. Use the 2-character ISO 3166-1 country code. |
providers | ✔ | Array of Objects | The array of carriers and service codes to be included in the search for service points. This object includes the carrier_id and service_code properties. |
carrier_id | ✔ | String | Property to include in the providers array. Requires at least one, but can include multiple carriers. |
service_code | Optional | String | Can include a single service code or multiple. For multiple, separate each with a comma. |
lat | ✔ * | number <double> | The latitude of the service point, represented as signed degrees. Required if long is provided. See Latitude & Longitude Formats for lat/long format details. |
long | ✔ * | number <double> | The longitude of the service point, represented as signed degrees. Required if lat is provided. See Latitude & Longitude Formats for lat/long format details. |
radius | Optional | Number | Search radius in kilometers. |
max_results | Optional | Number | The maximum number of service points to list in the response. Default is 100. |
shipment | Optional | object | Shipment information to use for service point selection. Includes the total_weight object and packages array. |
total_weight | object | The total weight of the shipment. Requires the value property (number) and unit property (ennumerated string: pound ounce gram kilogram ). | |
packages | array | An array of package dimensions. Includes the dimensions object, which requires the following properties: unit (ennumerated string: inch centimeter ), length (number), width (number), height (number) |
* Whether certain properties will be required in your request body will depend on which option you use to find service points. Review the List Service Points options and examples in the next section.
List Service Points
You have three options for finding service points using the POST /v1/service_points/list
method.
- Find by latitude and longitude
- Find by address
- Find by address string
You can filter the results provided in the response by including the following optional properties in your request:
service_code
radius
max_results
Additionally, if you include service codes in your request, the response will indicate which service_code
relates to which service point.
Requirements
Every request must include the providers
object with at least the carrier_id
(list your carriers to find your carrier IDs).
In addition, the following properties are required based on the option you are using the find service points:
- Find by latitude and longitude: requires both
lat
andlong
properties. - Find by address: requires
country_code
and at least one of the following -addressline_1
,city_locality
,state_province
,postal_code
(the more properties you include, the more accurate your results). - Find by address string: requires the
address_query
property.
Example Request: Find by Latitude & Longitude
This example shows how to get a list of service points for a specific carrier and service by providing longitude and latitude values. The request further specifies a radius of 50 km with a maximum of 25 results.
Example Request: Find by Address
This example shows how to get a list of service points for a specific carrier and service by providing an address
object.
Example Request: Find by Address String
This example shows how to get a list of service points for a specific carrier and service by providing an address_query
string. The request further specifies a radius of 50 km with a maximum of 25 results.
List Service Points Response
The list service points response will include a service_points
array with multiple properties containing various details about each service point it includes. You can pass these properties through to your own applications to provide your customers with service point options in their checkout. You can also use the service_point_id
value in the related PUDO field when creating a PUDO label.
This sample response includes all potential fields that would appear in the response, with sample data.
The available features
values are drop_off_point
, pick_up_point
, print_services
, after_hours_locker
, and after_hours_dropbox
. The available type
values are pudo
and locker
.
If an error occurs, the errors
array will contain the details you need to troubleshoot the issue and change your request body to try again.
error_source
error_type
error_code
message
carrier_id
carrier_code
field_name
Please see the response section of the List Service Points method in our full API reference for the list of potential values for each property.
Get Service Point by ID
If you already know the ID of the service point you wish to use or get details for, you can use the GET method with the service points endpoint.
The response will return the service point location address details, hours_of_operation
(object), features
(array), and type
(ennumerated string).
Requirements
This GET method requires adding the following path parameters to the endpoint:
carrier_code
country_code
service_point_id
Example Request & Response
GET /v1/service_points/{carrier_code}/{country_code}/{service_point_id}
Response