Creates and activates custom agent lists.
Sections in this article:
Create an agent list
POST /agents
Creates a custom agent list based on geolocation or zipcode range.
- If the agent list should be activated immediately, activate should be set to true.
-
type should be set to normal for geolocation and zipcode for zipcode range.
- If normal, mapLongitude and mapLatitude are required.
- If zipcode, an agentZipcodes array for each agent is required.
-
countryCode is always required.
Body example - geolocation
{
"key": "listkey",
"activate": "true",
"type": "normal",
"countryCode": "SE",
"agents": [
{
"id": "1",
"name": "Agent name 1",
"address1": "Test gatan 1",
"address2": "",
"zipcode": "41118",
"city": "Göteborg",
"state": "",
"countryCode": "SE",
"mapLongitude": "22.2",
"mapLatitude": "-11.1",
"phone": "07443332211",
"email": "test@test.com",
"additionalInfo": "Additional information",
"flags": [
"express",
"hem"
],
"openingHourWeekdays": [
{
"weekday": "monday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "tuesday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "wednesday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "thursday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "friday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "saturday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "sunday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
}
],
"openingHourSpecialDays": [
{
"date": "2018-04-27",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
},
{
"date": "2018-04-28",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
},
{
"date": "2018-10-10",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
}
]
},
{
"id": "2",
"name": "Agent name 2",
"address1": "Testvägen 10",
"address2": "",
"zipcode": "11359",
"city": "Stockholm",
"state": "",
"countryCode": "SE",
"mapLongitude": "33.3",
"mapLatitude": "17.4",
"phone": "0700331122",
"email": "test2@test2.com",
"additionalInfo": "Additional information",
"flags": [
"hem"
],
"openingHourWeekdays": [
{
"weekday": "monday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
},
{
"weekday": "tuesday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
},
{
"weekday": "wednesday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
},
{
"weekday": "thursday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
},
{
"weekday": "friday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
},
{
"weekday": "saturday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
},
{
"weekday": "sunday",
"hours": [
{
"start": "10:00",
"stop": "23:00"
}
]
}
],
"openingHourSpecialDays": [
{
"date": "2020-12-24",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
},
{
"date": "2020-12-25",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
},
{
"date": "2020-12-26",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
}
]
}
]
}
Body example - zipcode
{
"key": "listkey",
"activate": "true",
"type": "zipcode",
"countryCode": "SE",
"agents": [
{
"id": "1",
"name": "Agent name 1",
"address1": "Test gatan 1",
"address2": "",
"zipcode": "41118",
"city": "Göteborg",
"state": "",
"country": "SE",
"phone": "07443332211",
"email": "test@test.com",
"additionalInfo": "Additional information",
"flags": [
"express",
"hem"
],
"agentZipcodes": [
{
"from": "40000",
"to": "45000"
},
{
"from": "46000",
"to": ""
}
],
"openingHourWeekdays": [
{
"weekday": "monday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "tuesday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "wednesday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "thursday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "friday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "saturday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
},
{
"weekday": "sunday",
"hours": [
{
"start": "08:00",
"stop": "22:00"
}
]
}
],
"openingHourSpecialDays": [
{
"date": "2018-04-27",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
},
{
"date": "2018-04-28",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
},
{
"date": "2018-10-10",
"hours": [
{
"start": "10:00",
"stop": "16:00"
}
]
}
]
}
]
}
Response example
{
"id": "11111"
}
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /agents POST.
Fetch agent lists
GET /agents
Fetches all custom agent lists on the Delivery Checkout.
Response example
[
{
"id": "11111",
"name": "listkey",
"active": true,
"status": "OK",
"created": "2021-05-19T14:08:00.179+0000"
}
]
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /agents GET.
Activate an agent list
POST /agents/{id}
Activates a custom agent list.
URI parameters
Agent list id |
string |
Identification of the agent list |
Required |
No response body is returned when an agent list is successfully activated.
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to /agents/{id} POST.
Delete an agent list
DELETE /agents/{id}
Deletes an agent list.
URI parameters
Agent list id |
string |
Identification of the agent list |
Required |
No response body is returned when an agent list is successfully deleted.
For a description of properties, please refer to the Property reference guide.
For schema and testing, please refer to https://api.unifaun.com/rs-docs/ and navigate to
/agents/{id} DELETE.