> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetAggregatedMethodAvailability

# Package: onlineOrders

# Namespace: FulfillmentMethodsService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/fulfillment-methods/get-aggregated-method-availability.md

## Permission Scopes:
Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES

## Introduction

Retrieves the aggregated availability of a list of fulfillment methods.

The aggregated availability is a list of times during which one or more of the given fulfillment methods is available, and the types of those fulfillment methods.

---

## REST API

### Schema

```
 Method: getAggregatedMethodAvailability
 Description: Retrieves the aggregated availability of a list of fulfillment methods.  The aggregated availability is a list of times during which one or more of the given fulfillment methods is available, and the types of those fulfillment methods.
 URL: https://www.wixapis.com/fulfillment-methods/v1/fulfillment-methods/aggregated-availability
 Method: POST
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  fulfillmentMethodIds
 Method parameters: 
   param name: fulfillmentMethodIds | type: array<fulfillmentMethodIds> | description: IDs of fulfillment methods used to determine the aggregated availability. | required: true | validation: maxItems 500, format GUID
 Return type: GetAggregatedMethodAvailabilityResponse
  - name: aggregatedAvailability | type: Availability | description: The aggregated availability of the given fulfillment methods.  
     - name: availableTimes | type: array<DayOfWeekAvailability> | description: A list of availability times for the days of the week.  
        - name: dayOfWeek | type: DayOfWeek | description: The day of week this availability relates to.  
             - enum:
             -     MON: Monday.
             -     TUE: Tuesday.
             -     WED: Wednesday.
             -     THU: Thursday.
             -     FRI: Friday.
             -     SAT: Saturday.
             -     SUN: Sunday.
        - name: timeRanges | type: array<TimeOfDayRange> | description: A list of time ranges during which the fulfillment should be available.  
           - name: startTime | type: TimeOfDay | description: The start time in time of day representation.  
              - name: hours | type: integer | description: Hours. <br /> Min: `0`. <br /> Max: `23`.  
              - name: minutes | type: integer | description: Minutes. <br /> Min: `0`. <br /> Max: `23`.  
           - name: endTime | type: TimeOfDay | description: The end time in time of day representation.  
     - name: timeZone | type: string | description: The timezone in which the availability times are given.  | read-only: true 
  - name: fulfillmentTypes | type: array<Type> | description: Types of fulfillment methods available during at least some the aggregated availability's `availableTimes`.  | validation: maxItems 100
     - enum:
     -     UNKNOWN_FULFILLMENT_TYPE: Unknown fulfillment type.
     -     PICKUP: The customer must pick up the order from the restaurant.
     -     DELIVERY: The restaurant, or someone on behalf of the restaurant, must deliver the order to the customer.


```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.restaurants.fulfillmentMethods.getAggregatedMethodAvailability(fulfillmentMethodIds)
 Description: Retrieves the aggregated availability of a list of fulfillment methods.  The aggregated availability is a list of times during which one or more of the given fulfillment methods is available, and the types of those fulfillment methods.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  fulfillmentMethodIds
 Method parameters: 
   param name: fulfillmentMethodIds | type: array<string> | description: IDs of fulfillment methods used to determine the aggregated availability. | required: true | validation: maxItems 500, format GUID
 Return type: PROMISE<GetAggregatedMethodAvailabilityResponse>
  - name: aggregatedAvailability | type: Availability | description: The aggregated availability of the given fulfillment methods.  
     - name: availableTimes | type: array<DayOfWeekAvailability> | description: A list of availability times for the days of the week.  
        - name: dayOfWeek | type: DayOfWeek | description: The day of week this availability relates to.  
             - enum:
             -     MON: Monday.
             -     TUE: Tuesday.
             -     WED: Wednesday.
             -     THU: Thursday.
             -     FRI: Friday.
             -     SAT: Saturday.
             -     SUN: Sunday.
        - name: timeRanges | type: array<TimeOfDayRange> | description: A list of time ranges during which the fulfillment should be available.  
           - name: startTime | type: TimeOfDay | description: The start time in time of day representation.  
              - name: hours | type: integer | description: Hours. <br /> Min: `0`. <br /> Max: `23`.  
              - name: minutes | type: integer | description: Minutes. <br /> Min: `0`. <br /> Max: `23`.  
           - name: endTime | type: TimeOfDay | description: The end time in time of day representation.  
     - name: timeZone | type: string | description: The timezone in which the availability times are given.  | read-only: true 
  - name: fulfillmentTypes | type: array<Type> | description: Types of fulfillment methods available during at least some the aggregated availability's `availableTimes`.  | validation: maxItems 100
     - enum:
     -     UNKNOWN_FULFILLMENT_TYPE: Unknown fulfillment type.
     -     PICKUP: The customer must pick up the order from the restaurant.
     -     DELIVERY: The restaurant, or someone on behalf of the restaurant, must deliver the order to the customer.


```

### Examples

### getAggregatedMethodAvailability
```javascript
import { fulfillmentMethods } from '@wix/restaurants';

async function getAggregatedMethodAvailability(fulfillmentMethodIds) {
  const response = await fulfillmentMethods.getAggregatedMethodAvailability(fulfillmentMethodIds);
};
```

### getAggregatedMethodAvailability (with elevated permissions)
```javascript
import { fulfillmentMethods } from '@wix/restaurants';
import { auth } from '@wix/essentials';

async function myGetAggregatedMethodAvailabilityMethod(fulfillmentMethodIds) {
  const elevatedGetAggregatedMethodAvailability = auth.elevate(fulfillmentMethods.getAggregatedMethodAvailability);
  const response = await elevatedGetAggregatedMethodAvailability(fulfillmentMethodIds);
}
```

### getAggregatedMethodAvailability (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { fulfillmentMethods } from '@wix/restaurants';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { fulfillmentMethods },
  // Include the auth strategy and host as relevant
});


async function getAggregatedMethodAvailability(fulfillmentMethodIds) {
  const response = await myWixClient.fulfillmentMethods.getAggregatedMethodAvailability(fulfillmentMethodIds);
};
```

---