export interface DataItem { /** Data item ID. */ id?: string; /** * ID of the collection this item belongs to * @readonly */ dataCollectionId?: string; /** * Data item contents. * * Property-value pairs representing the data item's payload. When retrieving a data item, it also includes the following read-only fields: * * + `_id`: Item ID. * + `_createdDate`: Date and time the item was added to the collection. * + `_updatedDate`: Date and time the item was last modified. When the item is first inserted, `_createdDate` and `_updatedDate` have the same value. * + `_ownerId`: ID of the user who created the item. Can be modified with site owner permissions. */ data?: Record | null; } export interface InsertDataItemRequest { /** ID of the collection in which to insert the item. */ dataCollectionId: string; /** Item to insert. */ dataItem: DataItem; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; } export declare enum Environment { LIVE = "LIVE", SANDBOX = "SANDBOX", SANDBOX_PREFERRED = "SANDBOX_PREFERRED" } export interface Options { } export interface PublishPluginOptions { showDraftItems?: boolean; } export interface InsertDataItemResponse { /** Inserted data item. */ dataItem?: DataItem; } export interface PatchDataItemRequest { /** ID of the collection containing the existing item. */ dataCollectionId?: string; /** Patch set applied during item update. */ patchSet?: PatchSet; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface PatchSet { /** Data item ID. */ dataItemId?: string; /** Set of field updates to be applied */ fieldUpdates?: FieldUpdate[]; } export interface FieldUpdate extends FieldUpdateActionOptionsOneOf { setField?: SetField; incrementField?: IncrementField; appendToArray?: AppendToArray; removeFromArray?: RemoveFromArray; /** Field ID to be patched. For ex "title", "address.street" */ fieldPath?: string; /** Action to be applied */ action?: ACTION; } /** @oneof */ export interface FieldUpdateActionOptionsOneOf { setField?: SetField; incrementField?: IncrementField; appendToArray?: AppendToArray; removeFromArray?: RemoveFromArray; } export declare enum ACTION { UNKNOWN_ACTION = "UNKNOWN_ACTION", SET_FIELD = "SET_FIELD", REMOVE_FIELD = "REMOVE_FIELD", INCREMENT_FIELD = "INCREMENT_FIELD", APPEND_TO_ARRAY = "APPEND_TO_ARRAY", REMOVE_FROM_ARRAY = "REMOVE_FROM_ARRAY" } export interface SetField { value?: any; } export interface IncrementField { value?: number; } export interface AppendToArray { value?: any; } export interface RemoveFromArray { value?: any; } export interface DataPublishPluginOptions { /** * Whether to include draft items. * When `true`, the response includes both published and draft items. Default: `false`. */ includeDraftItems?: boolean; } export interface PatchDataItemResponse { /** Updated data item. */ dataItem?: DataItem; } export interface BulkPatchDataItemsRequest { /** ID of the collection in which to update items. */ dataCollectionId?: string; /** Patch sets to apply. */ patchSets?: PatchSet[]; /** * Whether to return the updated data items. * When `true`, the `results` objects contain a `dataItem` field. * * Default: `false` */ returnEntity?: boolean; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying: * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface BulkPatchDataItemsResponse { /** Information about the updated items. */ results?: BulkDataItemResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkDataItemResult { /** The action attempted for the data item. */ action?: BulkActionType; /** Metadata related to the data item for which the action was attempted. */ itemMetadata?: ItemMetadata; /** The data item for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */ dataItem?: DataItem; } export declare enum BulkActionType { UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE", INSERT = "INSERT", UPDATE = "UPDATE", DELETE = "DELETE", PATCH = "PATCH" } export interface ItemMetadata { /** Item ID. This field doesn't appear if there is no item ID, for example, when item creation fails. */ id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } export interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } export interface BulkActionMetadata { /** Number of items successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; } export interface UpdateDataItemRequest { /** ID of the collection containing the existing item. */ dataCollectionId: string; /** Updated data item content. The existing data item's content is replaced entirely. */ dataItem: DataItem; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface UpdateDataItemResponse { /** Updated data item. */ dataItem?: DataItem; } export interface SaveDataItemRequest { /** ID of the collection in which to insert or update the item. */ dataCollectionId: string; /** Data item to insert or update. */ dataItem: DataItem; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface SaveDataItemResponse { /** The action carried out for the item. */ action?: Action; /** Inserted or updated data item. */ dataItem?: DataItem; } export declare enum Action { /** Undefined action. */ UNKNOWN_ACTION = "UNKNOWN_ACTION", /** A new item was added to the collection. */ INSERTED = "INSERTED", /** An existing item in the collection was updated. */ UPDATED = "UPDATED" } export interface GetDataItemRequest { /** ID of the collection from which to retrieve the data item. */ dataCollectionId: string; /** ID of the data item to retrieve. */ dataItemId: string; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. * If provided, the result text is returned in the specified language. * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). * * If not provided, result text is not translated. */ language?: string | null; /** * Fields to return for the item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned. * **Note:** The `_id` system field is always returned. */ fields?: string[]; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface GetDataItemResponse { /** Retrieved item. */ dataItem?: DataItem; } export interface RemoveDataItemRequest { /** ID of the collection from which to remove the item. */ dataCollectionId: string; /** ID of the item to remove. */ dataItemId: string; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface RemoveDataItemResponse { /** Removed item. */ dataItem?: DataItem; } export interface TruncateDataItemsRequest { /** ID of the collection to truncate. */ dataCollectionId: string; } export interface TruncateDataItemsResponse { } export interface QueryDataItemsRequest { /** ID of the collection to query. */ dataCollectionId: string; /** Query preferences. For more details on using queries, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language). */ query?: QueryV2; /** * Whether to return the total count in the response for a query with offset paging. * When `true`, the `pagingMetadata` object in the response contains a `total` field. * * Default: `false` */ returnTotalCount?: boolean; /** * Properties for which to include referenced items in the query's results. * Up to 50 referenced items can be included for each item that matches the query. * @deprecated * @replacedBy referenced_item_options * @targetRemovalDate 2025-08-01 */ includeReferencedItems?: string[]; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. * If provided, the result text is returned in the specified language. * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). * * If not provided, result text is not translated. */ language?: string | null; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; /** Options for retrieving referenced items. */ referencedItemOptions?: ReferencedItemOptions[]; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` * * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data). */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** * Fields to return for each item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned. * **Note:** The `_id` system field is always returned. */ fields?: string[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface CursorPaging { /** Number of items to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface ReferencedItemOptions { /** Field containing references in the queried item. */ fieldName?: string; /** Maximum number of referenced items to include for each queried item. */ limit?: number | null; } export interface QueryDataItemsResponse { /** Retrieved items. */ dataItems?: DataItem[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface CachingInfo { /** Caching tags for this collection */ tags?: string[]; /** max caching time if set */ maxAge?: number | null; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used, `returnTotalCount` is `true` in the request, and `tooManyToCount` is false. */ total?: number | null; /** Whether the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface AggregateDataItemsRequest extends AggregateDataItemsRequestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** ID of the collection on which to run the aggregation. */ dataCollectionId: string; /** * Filter applied to the collection's data prior to running the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object. * * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data). */ initialFilter?: Record | null; /** Aggregation applied to the data. */ aggregation?: Aggregation; /** * Filter applied to the processed data following the aggregation. See [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language#getting-started_api-query-language_the-filter-section) for information on how to structure a filter object. * **Note:** The values you provide for each filter field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data). */ finalFilter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** * Whether to return the total count in the response for a query with offset paging. * When `true`, the `pagingMetadata` object in the response contains a `total` field. * * Default: `false` */ returnTotalCount?: boolean; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. * If provided, the result text is returned in the specified language. * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). * * If not provided, result text is not translated. */ language?: string | null; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } /** @oneof */ export interface AggregateDataItemsRequestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } export interface Average { /** Name of the field for which to calculate the average value. */ itemFieldName?: string; } export interface Min { /** Name of the field for which to calculate the minimum value. */ itemFieldName?: string; } export interface Max { /** Name of the field for which to calculate the maximum value. */ itemFieldName?: string; } export interface Sum { /** Name of the field for which to calculate the sum. */ itemFieldName?: string; } export interface Count { } export interface Operation extends OperationCalculateOneOf { /** Calculate the average value of a specified field for all items in the grouping. */ average?: Average; /** Calculate the minimum value of a specified field for all items in the grouping. */ min?: Min; /** Calculate the maximum value of a specified field for all items in the grouping. */ max?: Max; /** Calculate the sum of values of a specified field for all items in the grouping. */ sum?: Sum; /** Calculate the number of items in the grouping. */ itemCount?: Count; /** Name of the field containing results of the operation. */ resultFieldName?: string; } /** @oneof */ export interface OperationCalculateOneOf { /** Calculate the average value of a specified field for all items in the grouping. */ average?: Average; /** Calculate the minimum value of a specified field for all items in the grouping. */ min?: Min; /** Calculate the maximum value of a specified field for all items in the grouping. */ max?: Max; /** Calculate the sum of values of a specified field for all items in the grouping. */ sum?: Sum; /** Calculate the number of items in the grouping. */ itemCount?: Count; } export interface Aggregation { /** Fields by which to group items for the aggregation. If empty, the aggregation is carried out on all items in the collection. */ groupingFields?: string[]; /** Operations to carry out on the data in each grouping. */ operations?: Operation[]; } export interface AggregateDataItemsResponse { /** Aggregation results. */ results?: Record[] | null; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface CountDataItemsRequest { /** ID of the collection for which to count query results. */ dataCollectionId: string; /** * Filter object in the following format: * * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }`. * * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`. * * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data). */ filter?: Record | null; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. * If provided, the result text is returned in the specified language. * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). * * If not provided, result text is not translated. */ language?: string | null; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface CountDataItemsResponse { /** Number of items matching the query. */ totalCount?: number; } export interface QueryDistinctValuesRequest extends QueryDistinctValuesRequestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** ID of the collection to query. */ dataCollectionId: string; /** Item field name for which to return all distinct values. */ fieldName?: string; /** * Filter object in the following format: * * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }`. * * Examples of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`. * * **Note:** The values you provide for each field must adhere to that field's type. For example, when filtering by a field whose type is Date and Time, use an object in the following format: `"someDateAndTimeFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}`. Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-items/data-types-in-wix-data). */ filter?: Record | null; /** Sort order. */ order?: SortOrder; /** * Whether to return the total count in the response for a query with offset paging. * When `true`, the `pagingMetadata` object in the response contains a `total` field. * * Default: `false` */ returnTotalCount?: boolean; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. * If provided, the result text is returned in the specified language. * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). * * If not provided, result text is not translated. */ language?: string | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } /** @oneof */ export interface QueryDistinctValuesRequestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } export interface QueryDistinctValuesResponse { /** List of distinct values contained in the field specified in `fieldName`. */ distinctValues?: any[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface BulkInsertDataItemsRequest { /** ID of the collection in which to insert the items. */ dataCollectionId: string; /** Data items to insert. */ dataItems: DataItem[]; /** * Whether to return the inserted data items. * When `true`, the `results` objects contain a `dataItem` field. * * Default: `false` */ returnEntity?: boolean; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; } export interface BulkInsertDataItemsResponse { /** Information about the inserted items. */ results?: BulkDataItemResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkUpdateDataItemsRequest { /** ID of the collection in which to update items. */ dataCollectionId: string; /** Data items to update. */ dataItems: DataItem[]; /** * Whether to return the updated data items. * When `true`, the `results` objects contain a `dataItem` field. * * Default: `false` */ returnEntity?: boolean; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface BulkUpdateDataItemsResponse { /** Information about the updated items. */ results?: BulkDataItemResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkSaveDataItemsRequest { /** ID of the collection in which to insert or update the items. */ dataCollectionId: string; /** Data items to insert or update. */ dataItems: DataItem[]; /** * Whether to return the saved data item. * When `true`, the `results` objects contain a `dataItem` field. * * Default: `false` */ returnEntity?: boolean; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface BulkSaveDataItemsResponse { /** Information about the saved items. */ results?: BulkDataItemResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkRemoveDataItemsRequest { /** ID of the collection from which to remove the item. */ dataCollectionId: string; /** IDs of data items to remove. */ dataItemIds: string[]; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } export interface BulkRemoveDataItemsResponse { /** Information about the removed data items. */ results?: BulkDataItemResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface QueryReferencedDataItemsRequest extends QueryReferencedDataItemsRequestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** ID of the collection containing the referring item. */ dataCollectionId: string; /** ID of the referring item. */ referringItemId?: string; /** Field containing references in the referring item. */ referringItemFieldName?: string; /** Order of the returned referenced items. Sorted by the date each item was referenced. */ order?: SortOrder; /** * Whether to return the total count in the response. * When `true`, the `pagingMetadata` object in the response contains a `total` field. * * Default: `false` */ returnTotalCount?: boolean; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; /** * Language to translate result text into, in [IETF BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) format. * If provided, the result text is returned in the specified language. * **Note:** Translation for the specified language must be enabled for the collection in [Wix Multilingual](https://www.wix.com/app-market/wix-multilingual). * * If not provided, result text is not translated. */ language?: string | null; /** * Fields to return for each referenced item. Only fields specified in the array are included in the response. If the array is empty, all fields are returned. * **Note:** The `_id` system field is always returned. */ fields?: string[]; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying: * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; /** * Options for the Publish plugin. * This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object) to be marked as draft or published. Published items are visible to site visitors, while draft items are not. */ publishPluginOptions?: DataPublishPluginOptions; } /** @oneof */ export interface QueryReferencedDataItemsRequestPagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } export interface QueryReferencedDataItemsResponse { /** Referenced items and/or IDs. For successfully resolved references, the referenced data item is returned. For references that can't be resolved, the ID is returned. */ results?: ReferencedResult[]; /** Paging information. */ pagingMetadata?: PagingMetadataV2; } export interface UnresolvedReference { /** * ID of the referring item. * @deprecated * @targetRemovalDate 2025-03-01 */ referringItemId?: string; /** * Field specified to query for references. * @deprecated * @targetRemovalDate 2025-03-01 */ referringItemFieldName?: string; /** ID of unresolved referenced item */ referencedItemId?: string; /** Flag is set if item exists, but user is not authorized to read it */ unauthorized?: boolean; } export interface ReferencedResult extends ReferencedResultEntityOneOf { /** Data item referenced. */ dataItem?: DataItem; /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */ unresolvedReference?: UnresolvedReference; /** ID of the referring item. */ referringItemId?: string; } /** @oneof */ export interface ReferencedResultEntityOneOf { /** Data item referenced. */ dataItem?: DataItem; /** Unresolved reference. Appears instead of the data item when the reference doesn't resolve, for example, when an ID isn't found or if an item is in draft state. */ unresolvedReference?: UnresolvedReference; } export interface IsReferencedDataItemRequest { /** ID of the collection containing the referring data item. */ dataCollectionId: string; /** Field to check for a reference to the item that may be referenced. */ referringItemFieldName: string; /** ID of the referring item. */ referringItemId: string; /** ID of the item that may be referenced. */ referencedItemId: string; /** * Whether to retrieve data from the primary database instance. * This decreases performance but ensures data retrieved is up to date even immediately after an update. * Learn more about [Wix Data and eventual consistency](https://dev.wix.com/api/rest/wix-data/wix-data/eventual-consistency). * * Default: `false` */ consistentRead?: boolean; } export interface IsReferencedDataItemResponse { /** Whether the specified reference exists. */ isReferenced?: boolean; } export interface InsertDataItemReferenceRequest { /** ID of the collection in which to insert the reference. */ dataCollectionId: string; /** Reference to insert */ dataItemReference?: DataItemReference; /** * Additional parameters specific to the [Wix app collection](https://support.wix.com/en/article/cms-formerly-content-manager-working-with-wix-app-collections) you are querying. * * When querying the Wix Stores [Products collection](https://dev.wix.com/docs/develop-websites/articles/wix-apps/wix-e-commerce-stores/wix-stores-products-collection-fields), pass the following optional parameters: * - `includeHiddenProducts`: Whether to include hidden products in the response. Default: `false`. * - `includeVariants`: Whether to include product variants in the query. Default: `false`. */ appOptions?: Record | null; } export interface DataItemReference { /** Referring item field containing the references to the referenced items. */ referringItemFieldName?: string; /** ID of the referring item. */ referringItemId?: string; /** ID of the referenced item. */ referencedItemId?: string; } export interface InsertDataItemReferenceResponse { /** Inserted reference. */ dataItemReference?: DataItemReference; } export interface RemoveDataItemReferenceRequest { /** ID of the collection containing the referring item. */ dataCollectionId: string; /** Reference to remove. */ dataItemReference: DataItemReference; } export interface RemoveDataItemReferenceResponse { /** Removed reference. */ dataItemReference?: DataItemReference; } export interface BulkInsertDataItemReferencesRequest { /** ID of the collection containing the referring items. */ dataCollectionId: string; /** References to insert. */ dataItemReferences: DataItemReference[]; /** * Whether to return the inserted data item references. * When `true`, the `results` objects contain a `dataItemReference` field. * * Default: `false` */ returnEntity?: boolean; } export interface BulkInsertDataItemReferencesResponse { /** Information about the inserted references. */ results?: BulkDataItemReferenceResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface BulkDataItemReferenceResult { /** The action attempted for the reference. */ action?: BulkActionType; /** Metadata related to the reference for which the action was attempted. */ referenceMetadata?: ItemMetadata; /** The reference for which the action was attempted. Only returned if `returnEntity` is `true` in the request and the action is successful. */ dataItemReference?: DataItemReference; } export interface BulkRemoveDataItemReferencesRequest { /** ID of the collection containing the referring items. */ dataCollectionId: string; /** References to remove. */ dataItemReferences: DataItemReference[]; } export interface BulkRemoveDataItemReferencesResponse { /** Information about the removed references. */ results?: BulkDataItemReferenceResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } export interface ReplaceDataItemReferencesRequest { /** ID of the collection containing the referring item. */ dataCollectionId: string; /** Field containing references in the referring item. */ referringItemFieldName: string; /** ID of the referring item. */ referringItemId: string; /** List of new referenced item IDs to replace the existing ones. */ newReferencedItemIds?: string[]; } export interface ReplaceDataItemReferencesResponse { /** Updated references. */ dataItemReferences?: DataItemReference[]; } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface DataItemNonNullableFields { id: string; dataCollectionId: string; } export interface InsertDataItemResponseNonNullableFields { dataItem?: DataItemNonNullableFields; } export interface UpdateDataItemResponseNonNullableFields { dataItem?: DataItemNonNullableFields; } export interface SaveDataItemResponseNonNullableFields { action: Action; dataItem?: DataItemNonNullableFields; } export interface GetDataItemResponseNonNullableFields { dataItem?: DataItemNonNullableFields; } export interface RemoveDataItemResponseNonNullableFields { dataItem?: DataItemNonNullableFields; } interface CachingInfoNonNullableFields { tags: string[]; } export interface QueryDataItemsResponseNonNullableFields { dataItems: DataItemNonNullableFields[]; cachingInfo?: CachingInfoNonNullableFields; } export interface CountDataItemsResponseNonNullableFields { totalCount: number; } interface ApplicationErrorNonNullableFields { code: string; description: string; } interface ItemMetadataNonNullableFields { originalIndex: number; success: boolean; error?: ApplicationErrorNonNullableFields; } interface BulkDataItemResultNonNullableFields { action: BulkActionType; itemMetadata?: ItemMetadataNonNullableFields; dataItem?: DataItemNonNullableFields; } interface BulkActionMetadataNonNullableFields { totalSuccesses: number; totalFailures: number; } export interface BulkInsertDataItemsResponseNonNullableFields { results: BulkDataItemResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface BulkUpdateDataItemsResponseNonNullableFields { results: BulkDataItemResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface BulkSaveDataItemsResponseNonNullableFields { results: BulkDataItemResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface BulkRemoveDataItemsResponseNonNullableFields { results: BulkDataItemResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } interface UnresolvedReferenceNonNullableFields { referringItemId: string; referringItemFieldName: string; referencedItemId: string; unauthorized: boolean; } interface ReferencedResultNonNullableFields { dataItem?: DataItemNonNullableFields; unresolvedReference?: UnresolvedReferenceNonNullableFields; referringItemId: string; } export interface QueryReferencedDataItemsResponseNonNullableFields { results: ReferencedResultNonNullableFields[]; } export interface IsReferencedDataItemResponseNonNullableFields { isReferenced: boolean; } interface DataItemReferenceNonNullableFields { referringItemFieldName: string; referringItemId: string; referencedItemId: string; } export interface InsertDataItemReferenceResponseNonNullableFields { dataItemReference?: DataItemReferenceNonNullableFields; } export interface RemoveDataItemReferenceResponseNonNullableFields { dataItemReference?: DataItemReferenceNonNullableFields; } interface BulkDataItemReferenceResultNonNullableFields { action: BulkActionType; referenceMetadata?: ItemMetadataNonNullableFields; dataItemReference?: DataItemReferenceNonNullableFields; } export interface BulkInsertDataItemReferencesResponseNonNullableFields { results: BulkDataItemReferenceResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface BulkRemoveDataItemReferencesResponseNonNullableFields { results: BulkDataItemReferenceResultNonNullableFields[]; bulkActionMetadata?: BulkActionMetadataNonNullableFields; } export interface ReplaceDataItemReferencesResponseNonNullableFields { dataItemReferences: DataItemReferenceNonNullableFields[]; } export {};