import { NonNullablePaths } from '@wix/sdk-types'; /** * A Wishlist is a collection of catalog items saved by a site member. * Items are embedded (capped at 100) and identified by a CatalogReference * (catalog_item_id + app_id + options), so different variants are distinct. See: * https://dev.wix.com/docs/rest/business-solutions/e-commerce/catalog-service-plugin/handle-item-variants */ interface Wishlist { /** * Wishlist ID. * @format GUID * @readonly */ _id?: string | null; /** * The ID of the wishlist owner. * @readonly * @format GUID */ memberId?: string; /** * Saved items. Managed via AddItem / RemoveItem. * @maxSize 100 * @readonly */ items?: WishlistItem[]; /** * Date and time the wishlist was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the wishlist was last updated. * @readonly */ _updatedDate?: Date | null; /** Data Extensions */ extendedFields?: ExtendedFields; /** Tags */ tags?: Tags; } /** * A single item saved in a wishlist. * Managed via Wishlists.AddItem / RemoveItem. */ interface WishlistItem { /** Catalog reference identifying the saved item (the uniqueness key within a wishlist). */ catalogReference?: CatalogReference; /** * When the item was added to the wishlist. * @readonly */ addedDate?: Date | null; } /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */ interface CatalogReference { /** * ID of the item within the catalog it belongs to. * @minLength 1 * @maxLength 36 */ catalogItemId?: string; /** * ID of the app providing the catalog. * * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/). * * For items from Wix catalogs, the following values always apply: * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"` * @minLength 1 */ appId?: string; /** * Additional item details in `key:value` pairs. * * Use this optional field for more specificity with item selection. The values of the `options` field differ depending on which catalog is providing the items. * * For Wix Stores products, learn more about integrating with [Catalog V3](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration) * or [Catalog V1](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/e-commerce-integration), depending on [the version the site uses](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-versioning/introduction). */ options?: Record | null; } interface ExtendedFields { /** * 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). */ namespaces?: Record>; } /** * Common object for tags. * Should be use as in this example: * message Foo { * option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo"; * string id = 1; * ... * Tags tags = 5 * } * * example of taggable entity * { * id: "123" * tags: { * public_tags: { * tag_ids:["11","22"] * }, * private_tags: { * tag_ids: ["33", "44"] * } * } * } */ interface Tags { /** Tags that require an additional permission in order to access them, normally not given to site members or visitors. */ privateTags?: TagList; /** Tags that are exposed to anyone who has access to the labeled entity itself, including site members and visitors. */ publicTags?: TagList; } interface TagList { /** * List of tag IDs. * @maxSize 100 * @maxLength 5 */ tagIds?: string[]; } /** Payload for the WishlistItemAdded ACTION domain event. */ interface WishlistItemAdded { /** * ID of the wishlist the item was added to. * @format GUID */ wishlistId?: string; /** The item that was added. */ item?: WishlistItem; } /** Payload for the WishlistItemRemoved ACTION domain event. */ interface WishlistItemRemoved { /** * ID of the wishlist the item was removed from. * @format GUID */ wishlistId?: string; /** The item that was removed. */ item?: WishlistItem; } /** Payload for the WishlistTagsModified ACTION domain event. */ interface WishlistTagsModified { /** The wishlist whose tags changed. */ wishlist?: Wishlist; /** Tags assigned in this change. */ assignedTags?: Tags; /** Tags unassigned in this change. */ unassignedTags?: Tags; } /** Empty — resolves the caller's wishlist from request context. */ interface GetDefaultWishlistRequest { } interface GetDefaultWishlistResponse { /** The caller's wishlist (empty representation if none exists). */ wishlist?: Wishlist; } interface AddItemRequest { /** Item to add. Already present items (full three-field equality) are silently skipped. */ catalogReference: CatalogReference; /** Whether to return the updated wishlist in the response. */ returnEntity?: boolean; } interface AddItemResponse { /** The updated wishlist. */ wishlist?: Wishlist; } interface RemoveItemRequest { /** Item to remove. Absent items are silently skipped. */ catalogReference: CatalogReference; /** Whether to return the updated wishlist in the response. */ returnEntity?: boolean; } interface RemoveItemResponse { /** The updated wishlist. */ wishlist?: Wishlist; } /** Tags by wishlist ID. assign_tags or unassign_tags (or both) must be non-empty. */ interface BulkUpdateWishlistTagsRequest { /** * Wishlist IDs to update (1–100). * @minSize 1 * @maxSize 100 * @format GUID */ wishlistIds: string[]; /** Tags to assign. A tag present in both lists is assigned. */ assignTags?: Tags; /** Tags to unassign. */ unassignTags?: Tags; } interface BulkUpdateWishlistTagsResponse { /** * Per-wishlist results. * @minSize 1 * @maxSize 100 */ results?: BulkUpdateWishlistTagsResult[]; /** Aggregate metadata for the bulk action. */ bulkActionMetadata?: BulkActionMetadata; } interface ItemMetadata { /** * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed. * @format GUID */ _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 for this item was successful. When `false`, the `error` field is returned. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface BulkUpdateWishlistTagsResult { /** Per-item result metadata (success/failure). */ itemMetadata?: ItemMetadata; } interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } /** * Tags by filter (empty filter = all wishlists belonging to the site_member_id). * assign_tags or unassign_tags (or both) must be non-empty. */ interface BulkUpdateWishlistTagsByFilterRequest { /** WQL filter selecting wishlists (empty = all belonging to the site_member_id). */ filter: Record | null; /** Tags to assign. A tag present in both lists is assigned. */ assignTags?: Tags; /** Tags to unassign. */ unassignTags?: Tags; } interface BulkUpdateWishlistTagsByFilterResponse { /** * Async job ID for tracking the operation. * @format GUID */ jobId?: string; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For 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 that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number. * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } 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. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } /** @docsIgnore */ type AddItemApplicationErrors = { code?: 'WISHLIST_ITEMS_LIMIT_EXCEEDED'; description?: string; data?: Record; }; /** @docsIgnore */ type BulkUpdateWishlistTagsApplicationErrors = { code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS'; description?: string; data?: Record; }; /** @docsIgnore */ type BulkUpdateWishlistTagsByFilterApplicationErrors = { code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS'; description?: string; data?: Record; }; /** * Returns the caller's default wishlist. Empty representation if none exists. * @internal * @documentationMaturity preview * @permissionId ecom:v1:wishlist:get_default_wishlist * @fqn wix.ecom.wishlist.v1.Wishlists.GetDefaultWishlist */ declare function getDefaultWishlist(): Promise>; /** * Adds items to the caller's wishlist (auto-created on first use). Duplicates are skipped; * exceeding the 100-item cap returns WISHLIST_ITEMS_LIMIT_EXCEEDED. * @param catalogReference - Item to add. Already present items (full three-field equality) are silently skipped. * @internal * @documentationMaturity preview * @requiredField catalogReference * @requiredField catalogReference.appId * @requiredField catalogReference.catalogItemId * @permissionId ecom:v1:wishlist:add_item * @fqn wix.ecom.wishlist.v1.Wishlists.AddItem */ declare function addItem(catalogReference: NonNullablePaths, options?: AddItemOptions): Promise & { __applicationErrorsType?: AddItemApplicationErrors; }>; interface AddItemOptions { /** Whether to return the updated wishlist in the response. */ returnEntity?: boolean; } /** * Removes an item from the caller's wishlist. Absent item / no wishlist is a silent no-op. * @param catalogReference - Item to remove. Absent items are silently skipped. * @internal * @documentationMaturity preview * @requiredField catalogReference * @requiredField catalogReference.appId * @requiredField catalogReference.catalogItemId * @permissionId ecom:v1:wishlist:remove_item * @fqn wix.ecom.wishlist.v1.Wishlists.RemoveItem */ declare function removeItem(catalogReference: NonNullablePaths, options?: RemoveItemOptions): Promise>; interface RemoveItemOptions { /** Whether to return the updated wishlist in the response. */ returnEntity?: boolean; } /** * Synchronously assigns/unassigns tags on wishlists by ID. * @param wishlistIds - Wishlist IDs to update (1–100). * @internal * @documentationMaturity preview * @requiredField wishlistIds * @permissionId ecom:v1:wishlist:bulk_update_wishlist_tags * @fqn wix.ecom.wishlist.v1.Wishlists.BulkUpdateWishlistTags */ declare function bulkUpdateWishlistTags(wishlistIds: string[], options?: BulkUpdateWishlistTagsOptions): Promise & { __applicationErrorsType?: BulkUpdateWishlistTagsApplicationErrors; }>; interface BulkUpdateWishlistTagsOptions { /** Tags to assign. A tag present in both lists is assigned. */ assignTags?: Tags; /** Tags to unassign. */ unassignTags?: Tags; } /** * Asynchronously assigns/unassigns tags on wishlists matching a filter * (empty filter = all wishlists belonging to the site_member_id). Returns a job_id. * @param filter - WQL filter selecting wishlists (empty = all belonging to the site_member_id). * @internal * @documentationMaturity preview * @requiredField filter * @permissionId ecom:v1:wishlist:bulk_update_wishlist_tags_by_filter * @fqn wix.ecom.wishlist.v1.Wishlists.BulkUpdateWishlistTagsByFilter */ declare function bulkUpdateWishlistTagsByFilter(filter: Record, options?: BulkUpdateWishlistTagsByFilterOptions): Promise & { __applicationErrorsType?: BulkUpdateWishlistTagsByFilterApplicationErrors; }>; interface BulkUpdateWishlistTagsByFilterOptions { /** Tags to assign. A tag present in both lists is assigned. */ assignTags?: Tags; /** Tags to unassign. */ unassignTags?: Tags; } export { type AccountInfo, type ActionEvent, type AddItemApplicationErrors, type AddItemOptions, type AddItemRequest, type AddItemResponse, type ApplicationError, type BulkActionMetadata, type BulkUpdateWishlistTagsApplicationErrors, type BulkUpdateWishlistTagsByFilterApplicationErrors, type BulkUpdateWishlistTagsByFilterOptions, type BulkUpdateWishlistTagsByFilterRequest, type BulkUpdateWishlistTagsByFilterResponse, type BulkUpdateWishlistTagsOptions, type BulkUpdateWishlistTagsRequest, type BulkUpdateWishlistTagsResponse, type BulkUpdateWishlistTagsResult, type CatalogReference, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type GetDefaultWishlistRequest, type GetDefaultWishlistResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MessageEnvelope, type RemoveItemOptions, type RemoveItemRequest, type RemoveItemResponse, type RestoreInfo, type TagList, type Tags, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type Wishlist, type WishlistItem, type WishlistItemAdded, type WishlistItemRemoved, type WishlistTagsModified, addItem, bulkUpdateWishlistTags, bulkUpdateWishlistTagsByFilter, getDefaultWishlist, removeItem };