Drop Off Locations
Once a return is submitted, the user can find their ideal drop off locations via the return details step.
When the user updates their location, the drop_off_locations
step is executed again with a updated_user_location
object as an input.
⚠️ For security purposes, any website using this step must be whitelisted in the DigitalGenius Google Cloud account.
Please ask a member of the frontend team to do this.
{
"type": "drop_off_locations",
"payload": {
"countryCode": "uk",
"distanceUnit": "mi",
"userLocation": {
"coordinates": {
"lat": 51.5034,
"lng": -0.1276
},
"addressString": "10 Downing Street, London, SW1A 2AA, UK"
},
"locationsMode": "static",
"dropOffLocations": [
{
"id": "LOC_001",
"name": "Victoria Station",
"image": "https://upload.wikimedia.org/wikipedia/commons/6/63/Happy_Returns_Icon.svg",
"coordinates": {
"lat": 51.4952,
"lng": -0.1441
},
"addressString": "Victoria Street, London, SW1E 5ND, UK",
"operatingHours": {
"fri": "09:00-18:00",
"mon": "closed",
"sat": "10:00-16:00",
"sun": "closed",
"thu": "09:00-18:00",
"tue": "09:00-18:00",
"wed": "09:00-18:00"
}
},
{
"id": "LOC_002",
"name": "Westminster Underground",
"image": "https://upload.wikimedia.org/wikipedia/commons/6/63/Happy_Returns_Icon.svg",
"coordinates": {
"lat": 51.5014,
"lng": -0.1247
},
"addressString": "Bridge Street, London, SW1A 2JR, UK",
"operatingHours": {
"fri": "10:00-16:00",
"mon": "06:00-18:00",
"sat": "10:00-16:00",
"sun": "closed",
"thu": "06:00-18:00",
"tue": "06:00-18:00",
"wed": "06:00-18:00"
}
},
{
"id": "LOC_003",
"name": "St James's Park",
"image": "https://upload.wikimedia.org/wikipedia/commons/6/63/Happy_Returns_Icon.svg",
"coordinates": {
"lat": 51.5025,
"lng": -0.1335
},
"addressString": "Horse Guards Road, London, SW1A 2BJ, UK",
"operatingHours": {
"fri": "closed",
"mon": "10:00-20:00",
"sat": "closed",
"sun": "closed",
"thu": "10:00-20:00",
"tue": "10:00-20:00",
"wed": "10:00-20:00"
}
}
]
}
}
Properties
* indicates required field
Field | Description |
---|---|
type * | Must be "drop_off_locations" |
payload.countryCode * | Two-letter country code (ISO 3166-1) |
payload.distanceUnit * | Unit of distance measurement ("mi" or "km") |
payload.userLocation.coordinates.lat * | Latitude coordinate |
payload.userLocation.coordinates.lng * | Longitude coordinate |
payload.userLocation.addressString * | Full address as a single string |
payload.locationsMode * | Mode for location search static |
payload.mapsApiSearches[] | Only required for mapsAPI mode. |
payload.mapsApiSearches[].logo | URL of the location provider's logo |
payload.mapsApiSearches[].radius | Search radius in metres e.g. 2000 |
payload.mapsApiSearches[].keyword | The keyword used to search for locations e.g. "DPD", "DHL", "Royal Mail" |
payload.dropOffLocations[].id * | Unique identifier for the location |
payload.dropOffLocations[].name * | Name of the drop off location |
payload.dropOffLocations[].image * | URL of the location image |
payload.dropOffLocations[].coordinates.lat * | Latitude coordinate for drop off location |
payload.dropOffLocations[].coordinates.lng * | Longitude coordinate for drop off location |
payload.dropOffLocations[].addressString * | Full address as a single string |
payload.dropOffLocations[].operatingHours * | Mon-Sun operating hours (format: "HH:MM-HH:MM" or "closed") |
locationsMode
Possible modes are static
, dynamic
and mapsAPI
.
static
Use static when the flow is returning a full list of drop off locations.
dynamic
Use dynamic when the flow is returning a list of drop off locations based on the user's location.
When the user changes their location, the updated_user_location
object is passed in as an input, which should be used to return locations based on the new user location.
{
"updated_user_location": {
"coordinates": {
"lat": 51.53087600000001,
"lng": -0.1257838
},
"addressString": "St Pancras Station, Euston Rd., London N1C 4QL"
}
}
mapsAPI
⚠️ This mode is not recommended as it is not accurate and incurs additional costs.
This mode uses the Google Maps API to search for drop off locations based on the user's location, rather than flow providing a list of dropOffLocations
.
You must include a mapsApiSearches
array in the payload
:
{
"locationsMode": "mapsAPI",
"mapsApiSearches": [
{
"logo": "https://cdn.brandfetch.io/idx14eSfkg/theme/dark/symbol.svg?c=1bx1741003239475id64Mup7ac1ufe3Qd_&t=1690264244158",
"radius": 2000,
"keyword": "DPD"
}
]
}
Updated 8 days ago