Returning Options for the nearest PUDOs
To return the next available carrier service options for the nearest PUDOs:
-
Specify the latitude/longitude or postal code for the search point.
-
Use return type lsc to ensure the listing of the next available delivery option for each carrier service.
-
Specify
PUDO
as your optionType. -
To return the next available options, include only the
NEXT DAY
group that you created in Setup, by using the incgrp parameter. -
Specify a limited radius to return just the nearest PUDO(s).
-
Display the PUDO(s) on your checkout page.
Here is an example of an API call designed to return the cheapest PUDO options within 800 metres of a particular latitude/longitude:
GET https://dmo.metapack.com/dmoptions/find?key=<API-Key>&wh_code=SL123&c_lat=51.5234&c_long=-0.1141&r_t=lsc&optionType=PUDO&radius=800&incgrp=NEXT
Here is an example of the server response (assuming a 200 OK
status):
{ "header": { "requestId": "718961b8-9a84-4a76-b052-c13af27fe71f", "requestDate": "2020-04-07T13:46:25.949Z", "inputParameters": { "optionType": [ "PUDO" ], "c_long": [ "-0.1141" ], "r_t": [ "lsc" ], "c_lat": [ "51.5234" ], "radius": [ "800" ], "wh_code": [ "SL123" ], "key": [ "<API-Key>" ], "incgrp": [ "NEXT" ] }, "responseDate": "2020-04-07T13:46:26.960Z" }, "results": [ { "groupCodes": [ "NEXT" ], "photoUrls": [], "telephoneNumber": null, "distance": { "unit": "m", "value": 128 }, "description": null, "carrierServiceCode": "HERMPSND_7753_6612", "long": -0.113678, "optionType": "PUDO", "countryCode": "GBR", "storeName": "Retail 24", "shippingCharge": 0, "lat": 51.522278, "delivery": { "from": "2020-04-08T07:00:00.000Z", "to": "2020-04-08T19:00:59.999Z" }, "address": "Retail 24, 164 GRAYS INN ROAD, KINGS CROSS", "carrierServiceName": "ParcelShop Next Day\nS07753\nRetail 24\n 164 GRAYS INN ROAD\n\n\nKINGS CROSS\n\nGBR\nWC1X 8ED", "postcode": "WC1X 8ED", "fullName": "Hermes ParcelShop Next Day\nS07753\nRetail 24\n 164 GRAYS INN ROAD\n\n\nKINGS CROSS\n\nGBR\nWC1X 8ED", "collection": { "from": "2020-04-07T17:30:00.000Z", "to": "2020-04-07T18:30:59.999Z" }, "storeId": null, "logoUrl": null, "storeTimes": { "monday": [ "07:00-20:00" ], "tuesday": [ "07:00-20:00" ], "wednesday": [ "07:00-20:00" ], "thursday": [ "07:00-20:00" ], "friday": [ "07:00-20:00" ], "saturday": [ "07:00-20:00" ], "sunday": null }, "carrierCode": "HERMESPOS", "hasDisabledAccess": false, "bookingCode": "HERMPSND_7753_6612/2020-04-07/*-*/*/*-*", "cutOffDateTime": "2020-04-07T17:00:00.000Z" }, { "groupCodes": [ "NEXT" ], "photoUrls": [], "telephoneNumber": null, "distance": { "unit": "m", "value": 761 }, "description": null, "carrierServiceCode": "HERMPSND_7727_6612", "long": -0.116515, "optionType": "PUDO", "countryCode": "GBR", "storeName": "Am 2 Pm Food & Wine", "shippingCharge": 0, "lat": 51.53008, "delivery": { "from": "2020-04-08T07:00:00.000Z", "to": "2020-04-08T19:00:59.999Z" }, "address": "Am 2 Pm Food & Wine, 153 Kingcross Road, King cross", "carrierServiceName": "ParcelShop Next Day\nS07727\nAm 2 Pm Food & Wine\n 153 Kingcross Road\n\n\nKing cross\n\nGBR\nWC1X 9BN", "postcode": "WC1X 9BN", "fullName": "Hermes ParcelShop Next Day\nS07727\nAm 2 Pm Food & Wine\n 153 Kingcross Road\n\n\nKing cross\n\nGBR\nWC1X 9BN", "collection": { "from": "2020-04-07T17:30:00.000Z", "to": "2020-04-07T18:30:59.999Z" }, "storeId": null, "logoUrl": null, "storeTimes": { "monday": [ "07:00-23:59" ], "tuesday": [ "07:00-23:59" ], "wednesday": [ "07:00-23:59" ], "thursday": [ "07:00-23:59" ], "friday": [ "07:00-23:59" ], "saturday": [ "07:00-00:00" ], "sunday": [ "07:00-23:30" ] }, "carrierCode": "HERMESPOS", "hasDisabledAccess": false, "bookingCode": "HERMPSND_7727_6612/2020-04-07/*-*/*/*-*", "cutOffDateTime": "2020-04-07T17:00:00.000Z" } ] }
You can now display the PUDOs on your checkout page, for example: