Associating holidays with geographic zones
Some holidays need to be limited to certain geographic areas such as a country, state, or other region. For example, Independence Day (July 4th) is limited to the United States only.
For more information on geographic zones, see Geographic zones.
Querying for geographic zone information
- All geographic zones for a specific holiday:
GET /admin/v1/holidays/{holidayId}/geographic-zones
- A specific geographic zone for a specific holiday:
GET /admin/v1/holidays/{holidayId}/geographic-zones/{holidayZoneId}
For example, the following retrieves all the geographic zones in ClaimCenter where
the Independence Day Holiday (ID of cc:SVtboW6sge5-2PbgWx4Ks) is an
official holiday:
GET admin/v1/holidays/cc:SVtboW6sge5-2PbgWx4Ks/geographic-zones{
"count": 1,
"data": [
{
"attributes": {
"code": "US",
"country": {
"code": "US",
"name": "United States"
},
"id": "cc:SH7Z3TYwHofTr550zAn23",
"zoneType": {
"code": "country",
"name": "Country"
}
},Creating geographic zones for a holiday
You can create a geographic zone for a holiday. For example, you would do this to designate that a holiday applies to another geographic zone. To do this, all that is needed is the id of the zone in the request body.
For example, the following request in ClaimCenter associates the US state of Colorado
(CO) (ID of US:SJgWm2DZDRbn6zSBw8AbX) with the Cesar Chavez Day
holiday, as it is an optional holiday in that state:
Command
POST admin/v1/holidays/cc:SSivbi19APF67brdNHwj0/geographic-zones
Request
{
"data": {
"attributes": {
"geographicZone": {
"id": "US:SJgWm2DZDRbn6zSBw8AbX"
}
}
}
}
Response
{
"data": {
"attributes": {
"code": "CO",
"country": {
"code": "US",
"name": "United States"
},
"id": "cc:SmLiC47UjnoWZlKHWjVfQ",
"zoneType": {
"code": "state",
"name": "State"
}
},
...
Deleting geographic zones for a holiday
You can delete a geographic zone for a holiday. In that way, a particular holiday no longer applies to a particular zone.
Use the following endpoint to delete a geographic zone for a holiday:
- DELETE
/admin/v1/holidays/{holidayId}/geographic-zones/{holidayZoneId}
For example, the following request deletes the geographic zone with the id of
cc:SmLiC47UjnoWZlKHWjVfQ in ClaimCenter for the Cesar Chavez
Day holiday.
Command
DELETE admin/v1/holidays/cc:SSivbi19APF67brdNHwj0/geographic-zones/cc:SmLiC47UjnoWZlKHWjVfQ
<no request body>