> 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`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # BulkCreateAvailabilityExceptions # Package: onlineOrders # Namespace: AvailabilityExceptionsService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/restaurants/online-orders/availability-exceptions/bulk-create-availability-exceptions.md ## Permission Scopes: Manage Restaurants - all permissions: SCOPE.RESTAURANTS.MEGA-SCOPES ## Introduction Creates multiple availability exceptions. --- ## REST API ### Schema ``` Method: bulkCreateAvailabilityExceptions Description: Creates multiple availability exceptions. URL: https://www.wixapis.com/v1/bulk/availability-exceptions/create Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: availabilityExceptions, availabilityExceptions.startTime, availabilityExceptions.endTime, availabilityExceptions.affectedFulfillmentMethods, availabilityExceptions.affectedFulfillmentMethods.affectedMethods, availabilityExceptions.operationId, availabilityExceptions.available Method parameters: param name: availabilityExceptions | type: array | description: Availability exception details. | required: true - name: startTime | type: string | description: The start time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. | required: true - name: endTime | type: string | description: The end time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. | required: true - name: available | type: boolean | description: Whether the exception makes the [`start_time`, `end_time`] range available. If `true`, the exception makes the restaurant available for online ordering during the time range. If `false`, the exception makes the restaurant unavailable for ordering during the time range. Currently, only `false` is supported. | required: true - name: name | type: string | description: Exception name. - name: affectedFulfillmentMethods | type: AffectedFulfillmentMethods | description: Fulfillment methods for which this exception applies. | required: true - ONE-OF: - name: specificFulfillmentMethodsOptions | type: SpecificFulfillmentMethodsImpactScope | description: Settings for specific fulfillment methods. - name: fulfillmentMethodIds | type: array | description: IDs of the fulfillment methods this exception applies to. - name: affectedMethods | type: AffectedMethods | description: The type of the fulfillment methods this exception applies to. | required: true - enum: - ALL_FULFILLMENT_METHODS: All fulfillment methods of this operation applied for this exception. - SPECIFIC_FULFILLMENT_METHODS: Specific fulfillment methods applied for this exception. - ALL_PICKUP_FULFILLMENT_METHODS: All pickup fulfillment methods applied for this exception. - ALL_DELIVERY_FULFILLMENT_METHODS: All delivery fulfillment methods applied for this exception. - name: operationId | type: string | description: GUID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.) | required: true - name: extendedFields | type: ExtendedFields | description: Extended fields. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of availability exceptions. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. param name: returnEntity | type: returnEntity | description: Whether the full availability exception entity is returned. Defaults to `true`. Return type: BulkCreateAvailabilityExceptionsResponse - name: results | type: array | description: Information about the created availability exception. - name: itemMetadata | type: ItemMetadata | description: Metadata for availability exception creation. - name: id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: availabilityException | type: AvailabilityException | description: Created availability exception. - name: id | type: string | description: Availability exception GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the availability exception is updated. To prevent conflicting changes, the current revision must be specified when updating the availability exception. - name: createdDate | type: string | description: Date and time the availability exception was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: updatedDate | type: string | description: Date and time the availability exception was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: startTime | type: string | description: The start time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: endTime | type: string | description: The end time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: available | type: boolean | description: Whether the exception makes the [`start_time`, `end_time`] range available. If `true`, the exception makes the restaurant available for online ordering during the time range. If `false`, the exception makes the restaurant unavailable for ordering during the time range. Currently, only `false` is supported. - name: name | type: string | description: Exception name. - name: affectedFulfillmentMethods | type: AffectedFulfillmentMethods | description: Fulfillment methods for which this exception applies. - ONE-OF: - name: specificFulfillmentMethodsOptions | type: SpecificFulfillmentMethodsImpactScope | description: Settings for specific fulfillment methods. - name: fulfillmentMethodIds | type: array | description: IDs of the fulfillment methods this exception applies to. - name: affectedMethods | type: AffectedMethods | description: The type of the fulfillment methods this exception applies to. - enum: - ALL_FULFILLMENT_METHODS: All fulfillment methods of this operation applied for this exception. - SPECIFIC_FULFILLMENT_METHODS: Specific fulfillment methods applied for this exception. - ALL_PICKUP_FULFILLMENT_METHODS: All pickup fulfillment methods applied for this exception. - ALL_DELIVERY_FULFILLMENT_METHODS: All delivery fulfillment methods applied for this exception. - name: operationId | type: string | description: GUID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.) - name: extendedFields | type: ExtendedFields | description: Extended fields. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: businessLocationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the operation this availability exception applies to. - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of availability exceptions. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata for the API call. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.onlineOrders.AvailabilityExceptionsService.bulkCreateAvailabilityExceptions(availabilityExceptions, options) Description: Creates multiple availability exceptions. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: availabilityExceptions, availabilityExceptions.startTime, availabilityExceptions.endTime, availabilityExceptions.affectedFulfillmentMethods, availabilityExceptions.affectedFulfillmentMethods.affectedMethods, availabilityExceptions.operationId, availabilityExceptions.available Method parameters: param name: availabilityExceptions | type: array | description: Availability exception details. | required: true - name: startTime | type: Date | description: The start time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. | required: true - name: endTime | type: Date | description: The end time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. | required: true - name: available | type: boolean | description: Whether the exception makes the [`start_time`, `end_time`] range available. If `true`, the exception makes the restaurant available for online ordering during the time range. If `false`, the exception makes the restaurant unavailable for ordering during the time range. Currently, only `false` is supported. | required: true - name: name | type: string | description: Exception name. - name: affectedFulfillmentMethods | type: AffectedFulfillmentMethods | description: Fulfillment methods for which this exception applies. | required: true - ONE-OF: - name: specificFulfillmentMethodsOptions | type: SpecificFulfillmentMethodsImpactScope | description: Settings for specific fulfillment methods. - name: fulfillmentMethodIds | type: array | description: IDs of the fulfillment methods this exception applies to. - name: affectedMethods | type: AffectedMethods | description: The type of the fulfillment methods this exception applies to. | required: true - enum: - ALL_FULFILLMENT_METHODS: All fulfillment methods of this operation applied for this exception. - SPECIFIC_FULFILLMENT_METHODS: Specific fulfillment methods applied for this exception. - ALL_PICKUP_FULFILLMENT_METHODS: All pickup fulfillment methods applied for this exception. - ALL_DELIVERY_FULFILLMENT_METHODS: All delivery fulfillment methods applied for this exception. - name: operationId | type: string | description: GUID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.) | required: true - name: extendedFields | type: ExtendedFields | description: Extended fields. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of availability exceptions. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. param name: options | type: BulkCreateAvailabilityExceptionsOptions none - name: returnEntity | type: boolean | description: Whether the full availability exception entity is returned. Defaults to `true`. Return type: PROMISE - name: results | type: array | description: Information about the created availability exception. - name: itemMetadata | type: ItemMetadata | description: Metadata for availability exception creation. - name: _id | type: string | description: Item GUID. Should always be available, unless it's impossible (for example, when failing to create an item). - name: originalIndex | type: integer | description: Index of the item within the request array. Allows for correlation between request and response items. - name: success | type: boolean | description: Whether the requested action was successful for this item. When `false`, the `error` field is populated. - name: error | type: ApplicationError | description: Details about the error in case of failure. - name: code | type: string | description: Error code. - name: description | type: string | description: Description of the error. - name: data | type: object | description: Data related to the error. - name: availabilityException | type: AvailabilityException | description: Created availability exception. - name: _id | type: string | description: Availability exception GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the availability exception is updated. To prevent conflicting changes, the current revision must be specified when updating the availability exception. - name: _createdDate | type: Date | description: Date and time the availability exception was created in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: _updatedDate | type: Date | description: Date and time the availability exception was last updated in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: startTime | type: Date | description: The start time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: endTime | type: Date | description: The end time of the availability exception in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601#combined_date_and_time_representations) format. - name: available | type: boolean | description: Whether the exception makes the [`start_time`, `end_time`] range available. If `true`, the exception makes the restaurant available for online ordering during the time range. If `false`, the exception makes the restaurant unavailable for ordering during the time range. Currently, only `false` is supported. - name: name | type: string | description: Exception name. - name: affectedFulfillmentMethods | type: AffectedFulfillmentMethods | description: Fulfillment methods for which this exception applies. - ONE-OF: - name: specificFulfillmentMethodsOptions | type: SpecificFulfillmentMethodsImpactScope | description: Settings for specific fulfillment methods. - name: fulfillmentMethodIds | type: array | description: IDs of the fulfillment methods this exception applies to. - name: affectedMethods | type: AffectedMethods | description: The type of the fulfillment methods this exception applies to. - enum: - ALL_FULFILLMENT_METHODS: All fulfillment methods of this operation applied for this exception. - SPECIFIC_FULFILLMENT_METHODS: Specific fulfillment methods applied for this exception. - ALL_PICKUP_FULFILLMENT_METHODS: All pickup fulfillment methods applied for this exception. - ALL_DELIVERY_FULFILLMENT_METHODS: All delivery fulfillment methods applied for this exception. - name: operationId | type: string | description: GUID of the restaurant operation this exception is associated with. (See the Restaurants Operations API for more information.) - name: extendedFields | type: ExtendedFields | description: Extended fields. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). - name: businessLocationId | type: string | description: Business location GUID ([SDK](https://dev.wix.com/docs/sdk/backend-modules/restaurants/wix-restaurants-new/about-business-locations.md) | [REST](https://dev.wix.com/docs/rest/business-solutions/restaurants/wix-restaurants-new/about-business-locations.md)) of the operation this availability exception applies to. - name: tags | type: Tags | description: Tags ([SDK](https://dev.wix.com/docs/sdk/backend-modules/tags/tags/introduction.md) | [REST](https://dev.wix.com/docs/rest/business-management/tags/introduction.md)) used to classify and sort different types of availability exceptions. - name: privateTags | type: TagList | description: Tags that require an additional permission in order to access them, normally not given to site members or visitors. - name: tagIds | type: array | description: List of tag GUIDs - name: tags | type: TagList | description: Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. - name: bulkActionMetadata | type: BulkActionMetadata | description: Metadata for the API call. - name: totalSuccesses | type: integer | description: Number of items that were successfully processed. - name: totalFailures | type: integer | description: Number of items that couldn't be processed. - name: undetailedFailures | type: integer | description: Number of failures without details because detailed failure threshold was exceeded. ``` ### Examples ### bulkCreateAvailabilityExceptions ```javascript import { availabilityExceptions } from '@wix/restaurants'; async function bulkCreateAvailabilityExceptions(availabilityExceptions,options) { const response = await availabilityExceptions.bulkCreateAvailabilityExceptions(availabilityExceptions,options); }; ``` ### bulkCreateAvailabilityExceptions (with elevated permissions) ```javascript import { availabilityExceptions } from '@wix/restaurants'; import { auth } from '@wix/essentials'; async function myBulkCreateAvailabilityExceptionsMethod(availabilityExceptions,options) { const elevatedBulkCreateAvailabilityExceptions = auth.elevate(availabilityExceptions.bulkCreateAvailabilityExceptions); const response = await elevatedBulkCreateAvailabilityExceptions(availabilityExceptions,options); } ``` ### bulkCreateAvailabilityExceptions (self-hosted) Self-hosted 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 { availabilityExceptions } from '@wix/restaurants'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { availabilityExceptions }, // Include the auth strategy and host as relevant }); async function bulkCreateAvailabilityExceptions(availabilityExceptions,options) { const response = await myWixClient.availabilityExceptions.bulkCreateAvailabilityExceptions(availabilityExceptions,options); }; ``` ---