Listing service points
The end goal is to list the closest service points based on the customer's address and selected carrier. To get there, start by querying the available carriers on your Shipmondo account.
Fetching carriers
Use /api/public/v3/shipping_modules/carriers
In our example our account has access to two carriers
[
{
"name": "PostNord",
"code": "pdk"
},
{
"name": "GLS",
"code": "gls"
}
]
Fetching products
Once the carriers have been fetched, the available products for each carrier can be fetched using /api/public/v3/shipping_modules/products
Response format example for PostNord:
[
{
"name": "Return Drop Off",
"product_code": "PDK_RDO",
"service_point_product": false
},
{
"name": "MyPack Collect",
"product_code": "PDK_MC",
"service_point_product": true
},
{
"name": "MyPack Home",
"product_code": "PDK_MH",
"service_point_product": false
}
]
In this case, there are three products available. Note the field service_point_product
. If this is false
, a service point is not required when booking the product.
For a shipping module, this means that a service point locator should not be displayed for these products.
Fetching service point types
Some carriers offer different types of service points. A service point type could be, for example, a "Locker" - indicating that the service point is unmanned.
To list the available types for a given carrier, use /api/public/v3/service_point/service_point_types
Response example:
[
{
"code": "SP",
"name": "PostNord Service Point"
}
]
The code
can then be included in the service_point_types
parameter when fetching service points, in order to filter service points only of that type (see next section).
Fetching service point
By now, all the required information to list service points is available.
Use /api/public/v3/service_point/service_points to fetch the service points.
Response format example:
[
{
"id": "5280",
"name": "Pakkeshop Dagli Brugsen",
"address": "Virketoften 1",
"address2": null,
"zipcode": "5220",
"city": "ODENSE SØ",
"country": "DK",
"distance": 3843,
"longitude": 10.492567,
"latitude": 55.358236,
"carrier_code": "pdk",
"type": "SP",
"opening_hours": [
"Monday: 08:00 - 20:00",
"Tuesday: 08:00 - 20:00",
"Wednesday: 08:00 - 20:00",
"Thursday: 08:00 - 20:00",
"Friday: 08:00 - 20:00",
"Saturday: 08:00 - 20:00",
"Sunday: 08:00 - 20:00"
],
"drop_off_allowed": true,
"pickup_allowed": true
}
]
Important note for carrier_code
When fetching service points, you may occasionally receive locations operated by carriers that were not originally specified. This occurs because some carriers act as brokers and have partnerships with other carriers for the final-mile delivery. As part of these agreements, the final delivery may be handled by a different carrier, and their service points will therefore be included in the results.