> For the complete documentation index, see [llms.txt](https://docs.zapiet.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zapiet.com/reference/store-pickup/pickup-calendar.md).

# Dates

## Get pickup dates and times

<mark style="color:green;">`POST`</mark> `https://api.zapiet.com/v1.0/pickup/locations/:locationId/calendar`

This endpoint allows you to fetch calendar rules for a specific location&#x20;

#### Path Parameters

| Name                                         | Type   | Description                   |
| -------------------------------------------- | ------ | ----------------------------- |
| locationId<mark style="color:red;">\*</mark> | string | The ID of the Zapiet location |

#### Query Parameters

| Name                                   | Type   | Description                 |
| -------------------------------------- | ------ | --------------------------- |
| shop<mark style="color:red;">\*</mark> | string | The myshopify.com store url |

#### Request Body

| Name         | Type   | Description                                    |
| ------------ | ------ | ---------------------------------------------- |
| shoppingCart | string | The contents of the customers shopping basket. |

{% tabs %}
{% tab title="200 " %}

```javascript
{
	"minDateTime": "2021-05-13 09:00:00",
	"minDate": "2021-05-13",
	"maxDate": null,
	"minTime": ["09", "00"],
	"maxTime": ["17", "00"],
	"disabled": [],
	"interval": 60,
	"daysOfWeek": {
		"sunday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"monday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"tuesday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"wednesday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"thursday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"friday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"saturday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		}
	},
	"timezone": "America\/New_York"
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request" %}

```javascript
{
    "shoppingCart": [
        {
            "variant_id": 9226255761451,
            "product_id": 852798275627,
            "quantity": 5
        },
        {
            "variant_id": 9226255761452,
            "product_id": 852798275628,
            "quantity": 2
        }
    ]
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
	"minDateTime": "2021-05-13 09:00:00",
	"minDate": "2021-05-13",
	"maxDate": null,
	"minDateSlots" : [],
	"minTime": ["09", "00"],
	"maxTime": ["17", "00"],
	"disabled": [],
	"interval": 60,
	"daysOfWeek": {
		"sunday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"monday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"tuesday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"wednesday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"thursday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"friday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		},
		"saturday": {
			"min": {
				"hour": "09",
				"minute": "00"
			},
			"max": {
				"hour": "17",
				"minute": "00"
			}
		}
	},
	"timezone": "America\/New_York"
}
```

{% endtab %}
{% endtabs %}

## Minimum Date Slots

If the merchant has pickup order limits, we will return an array of time slots available for the minDate

```javascript
{
    "minDate": "2024-01-16",
    "minDateSlots": [
        {
            "id": 1,
            "location_id": 1,
            "day_of_week": "tuesday",
            "available_from": "11:30",
            "available_until": "12:00",
            "limited": true,
            "limit": 10
        },
        {
            "id": 2,
            "location_id": 1,
            "day_of_week": "tuesday",
            "available_from": "12:00",
            "available_until": "12:30",
            "limited": true,
            "limit": 10
        }
}
```

## Blackout dates

If the merchant wants to prevent customers from selecting pickup on specific dates of the year we will return an array of dates as shown below.

{% hint style="info" %}
Months are javascript zero-based meaning December is 11 rather than 12
{% endhint %}

{% tabs %}
{% tab title="Blackout dates" %}

```javascript
/** 
Pickup not allowed on:

13th May 2021 
25th December 2021
**/

{
	"disabled": [
		"2021-04-13",
		"2021-11-25"
	]
}
```

{% endtab %}
{% endtabs %}

## Disabled days of the week

If merchants want to prevent customers from selecting pickup on specific days of the week then we will return an array of integers.

{% hint style="info" %}
Months are javascript zero-based meaning December is 11 rather than 12
{% endhint %}

```javascript
/** 
Pickup not allowed on Sunday or Monday

1: Sunday
2: Monday
3: Tuesday
4: Wednesday
5: Thursday
6: Friday
7: Saturday
**/

{
	"disabled": [
		1,
		2
	]
}
```

## Specifically allowed pickup dates

If a merchant wants to allow pickups only on specific dates of the year we will return the available pickup dates in the disabled array. Note the first element of the array will be `true`  &#x20;

{% hint style="info" %}
Months are javascript zero-based meaning December is 11 rather than 12
{% endhint %}

```javascript
/** 
Pickup is only available on:

13th May 2021 
25th December 2021
**/

{
	"disabled": [
		true,
		"2021-04-13",
		"2021-11-25"
	]
}
```

## Advanced date rules

Merchants can combine both specifically allowed pickup dates and days of the week.&#x20;

{% hint style="info" %}
Months are javascript zero-based meaning December is 11 rather than 12
{% endhint %}

```javascript
/** 
Pickup is only available on:

Sundays
Mondays 
13th May 2021
25th December 2021 
**/

{
	"disabled": [
		true,
		1,
		2,
		"2021-04-13",
		"2021-11-25"
	]
}
```

```javascript
/** 
Pickup is not available on:

Sundays
Mondays 
13th May 2021
25th December 2021 
**/

{
	"disabled": [
		1,
		2,
		"2021-04-13",
		"2021-11-25"
	]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.zapiet.com/reference/store-pickup/pickup-calendar.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
