# Data

## Delivery options

Available delivery options for the current zip code

### Get

```javascript
ZapietEats.getDeliveryOptions()
```

#### Example response

```json
{
    "zipCode": 123456,
    "settings": {
        "all_restaurants_closed": false,
        "pickup": {
            "count": 1,
            "estimated_ready_for_pickup_time": 15,
            "restaurants": {
                "current_page": 1,
                "data": [
                    {
                        "id": 1,
                        "zapiet_id": 1,
                        "company_name": "Restaurant",
                        "address_line_1": "",
                        "address_line_2": "",
                        "phone": "",
                        "phone_formatted": "",
                        "postal_code": "",
                        "region": "",
                        "country_code": "",
                        "country_name": "",
                        "latitude": "",
                        "longitude": "",
                        "distance": "",
                        "max_radius": "",
                        "city": "",
                        "estimated_pickup_time": "",
                        "accepting_orders": true,
                        "status": "open",
                        "zone": null,
                        "menus": [
                            {
                                "id": 1,
                                "name": {
                                    "en": "Menu"
                                },
                                "collection": {
                                    "id": 1,
                                    "zapiet_id": 1,
                                    "external_id": "",
                                    "account_id": 1,
                                    "handle": "",
                                    "title": "Menu 1",
                                    "image": null,
                                    "config": "{\"status\": true}",
                                },
                                "status": {
                                    "store_pickup": true,
                                    "local_delivery": true
                                }
                            }
                        ],
                        "config": {
                            "tags": {
                                "store_pickup": [
                                    "Store Pickup"
                                ],
                                "local_delivery": [
                                    "Local Delivery"
                                ]
                            },
                            "pickup_rate": {
                                "rate_name": {
                                    "en": "Pickup"
                                },
                                "max_radius": 0,
                                "rate_price": 0,
                                "phone_required": false,
                                "min_order_value": 0,
                                "rate_description": {
                                    "en": null
                                },
                                "max_radius_enabled": false,
                                "free_pickup_enabled": false,
                                "estimated_pickup_time": 15,
                                "free_pickup_min_order_value": 0
                            }
                        }
                    }
                ],
                "from": 1,
                "last_page": 1,
                "per_page": 3,
                "to": 3,
                "total": 3
            }
        },
        "delivery": {
            "estimated_delivery_time": 20,
            "restaurant": {
                "id": 1,
                "zapiet_id": 1,
                "company_name": "Restaurant",
                "address_line_1": "",
                "address_line_2": "",
                "phone": "",
                "phone_formatted": "",
                "postal_code": "",
                "region": "",
                "country_code": "",
                "country_name": "",
                "latitude": "",
                "longitude": "",
                "distance": "",
                "max_radius": null,
                "city": "",
                "estimated_pickup_time": "",
                "accepting_orders": true,
                "status": "open",
                "zone": {
                    "id": 1,
                    "name": "Zone 1",
                    "config": {
                        "rate_name": {
                            "en": "Delivery"
                        },
                        "rate_price": 4.95,
                        "validation": {
                            "option": "postcode",
                            "max_radius": 0,
                            "eligible_post_codes": "",
                            "max_driving_distance": 0
                        },
                        "phone_required": false,
                        "min_order_value": 0,
                        "free_delivery_enabled": false,
                        "estimated_delivery_time": 20,
                        "free_delivery_min_order_value": 0
                    }
                },
                "menus": [
                    {
                        "id": 1,
                        "name": {
                            "en": "Menu"
                        },
                        "collection": {
                            "id": 1,
                            "zapiet_id": 1,
                            "external_id": "",
                            "account_id": 1,
                            "handle": "",
                            "title": "Menu",
                            "image": null,
                            "config": "{\"status\": true}",
                        },
                        "status": {
                            "store_pickup": true,
                            "local_delivery": true
                        }
                    }
                ],
                "config": {
                    "tags": {
                        "store_pickup": [
                            "Store Pickup"
                        ],
                        "local_delivery": [
                            "Local Delivery"
                        ]
                    },
                    "pickup_rate": {
                        "rate_name": {
                            "en": "Pickup"
                        },
                        "max_radius": 0,
                        "rate_price": 0,
                        "phone_required": false,
                        "min_order_value": 0,
                        "rate_description": {
                            "en": null
                        },
                        "max_radius_enabled": false,
                        "free_pickup_enabled": false,
                        "estimated_pickup_time": 15,
                        "free_pickup_min_order_value": 0
                    }
                }
            }
        }
    }
}
```

## Delivery Option

Currently selected delivery option

### Get

```javascript
ZapietEats.getDeliveryOption()
```

#### Response

A string with the value `"pickup"` or `"delivery"`

### Set

#### Example call

```javascript
ZapietEats.setDeliveryOption("pickup")
```

#### Parameters

A string with the value `"pickup"` or `"delivery"`

## Restaurant

Currently selected restaurant

### Get

```javascript
ZapietEats.getRestaurant()
```

#### Example response

```json
{
  "id": 1,
  "zapiet_id": 1,
  "company_name": "Restaurant",
  "address_line_1": "",
  "address_line_2": "",
  "phone": "",
  "phone_formatted": "",
  "postal_code": "",
  "region": "",
  "country_code": "",
  "country_name": "",
  "latitude": "",
  "longitude": "",
  "distance": "",
  "max_radius": "",
  "city": "",
  "estimated_pickup_time": "",
  "accepting_orders": true,
  "status": "open",
  "menus": [
    {
      "id": 1,
      "name": {
        "en": "Menu"
      },
      "collection": {
        "id": 1,
        "zapiet_id": 1,
        "external_id": "",
        "account_id": 1,
        "handle": "",
        "title": "Menu 1",
        "config": "{\"status\": true}"
      },
      "status": {
        "store_pickup": true,
        "local_delivery": true
      }
    }
  ],
  "config": {
    "tags": {
      "store_pickup": [
        "Store Pickup"
      ],
      "local_delivery": [
        "Local Delivery"
      ]
    },
    "pickup_rate": {
      "rate_name": {
        "en": "Pickup"
      },
      "max_radius": 0,
      "rate_price": 0,
      "phone_required": false,
      "min_order_value": 0,
      "rate_description": {},
      "max_radius_enabled": false,
      "free_pickup_enabled": false,
      "estimated_pickup_time": 15,
      "free_pickup_min_order_value": 0
    }
  }
}
```

### Set

#### Example call

```javascript
ZapietEats.setRestaurant(1)
```

#### Parameters

An integer with the restaurant's `zapiet_id`

## Menu

Currently selected menu

### Get

```javascript
ZapietEats.getMenu()
```

#### Example response

```json
{
    "id": 1,
    "name": {
        "en": "Daily menu"
    },
    "collection": {
        "id": 1,
        "zapiet_id": 1,
        "external_id": "1234564789",
        "account_id": 1,
        "handle": "daily-menu",
        "title": "Daily menu",
        "image": null,
        "config": "{\"status\": true}"
    },
    "status": {
        "store_pickup": true,
        "local_delivery": true
    }
}
```

### Set

#### Example call

```javascript
ZapietEats.setMenu(1)
```

#### Parameters

An integer with the menu's `zapiet_id`

## Language

Widget's current display language

### Get

```javascript
ZapietEats.getLanguage()
```

#### Response

A string with the widget's current language code

### Set

#### Example call

```javascript
ZapietEats.setLanguage("fr")
```

#### Parameters

An string with the language code


---

# Agent Instructions: 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:

```
GET https://docs.zapiet.com/zapiet-eats/reference/data.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
