export interface InventoryItemV2 { /** Inventory item ID. */ _id?: string | null; /** * @internal * @internal * @readonly * @deprecated Deprecated: use productId. * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string | null; /** * Product ID. * @readonly */ productId?: string | null; /** Whether quantity is being tracked. */ trackQuantity?: boolean | null; /** Variants associated with this inventory item. */ variants?: InventoryVariantV2[]; /** * Last updated timestamp. * @readonly */ lastUpdated?: Date | null; /** * Inventory’s unique numeric ID (assigned in ascending order). * Primarily for sorting and filtering when crawling all inventories. * @readonly */ numericId?: string; /** Preorder information. */ preorderInfo?: PreorderInfo; } export interface InventoryVariantV2 { /** Variant ID. */ variantId?: string; /** Whether the product is listed as in stock. */ inStock?: boolean | null; /** Quantity currently left in inventory. */ quantity?: number | null; /** * Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level. * @readonly */ availableForPreorder?: boolean; } export interface PreorderInfo { /** Whether the item is available for preorder. */ enabled?: boolean; /** A message the buyer will see when the item is out of stock and preorder is enabled. */ message?: string | null; /** Number of products that can be preordered after stock reaches zero. */ limit?: number | null; } export interface InventoryItemChanged { /** Inventory item ID. */ inventoryItemId?: string; /** * @internal * @internal * @deprecated Deprecated: use productId. * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; /** Whether inventory is being tracked. */ trackInventory?: boolean; /** Preorder information. */ preorderInfo?: PreorderInfo; /** Field mask of updated fields. */ fieldMask?: string[]; /** Date and time the inventory item was last updated. */ _updatedDate?: Date | null; } export interface InventoryVariantsChanged { /** Inventory item ID. */ inventoryItemId?: string; /** * @internal * @internal * @deprecated Deprecated: use productId. * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; /** Information about changed variants. */ variants?: ChangedInventoryVariant[]; /** Date and time the inventory variant item was last updated. */ _updatedDate?: Date | null; } export interface ChangedInventoryVariant { /** Variant ID. */ _id?: string; /** Previous inventory variant data. */ oldValue?: ChangedInventoryVariantData; /** Current inventory variant data. */ newValue?: ChangedInventoryVariantData; } export interface ChangedInventoryVariantData { /** Inventory variant quantity. */ quantity?: number | null; /** Whether the product variant is in stock. */ inStock?: boolean; /** Whether the variant is available for preorder. When `true`, the variant is out of stock and preorder is enabled on inventory level. */ availableForPreorder?: boolean; } export declare enum ReasonType { /** Unknown reason. */ UNKNOWN = "UNKNOWN", /** Order related. */ ORDER = "ORDER", /** Manual adjustment. */ MANUAL = "MANUAL", /** Reverting an inventory change. */ REVERT_INVENTORY_CHANGE = "REVERT_INVENTORY_CHANGE" } export interface GetInventoryVariantsRequest extends GetInventoryVariantsRequestIdOneOf { /** Inventory item ID. */ inventoryId: string; /** * @internal * @internal * @deprecated Deprecated (use productID instead). * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; /** Variant IDs to query for this inventory item (optional). */ variantIds?: string[]; } /** @oneof */ export interface GetInventoryVariantsRequestIdOneOf { /** Inventory item ID. */ inventoryId?: string; /** * @internal * @internal * @deprecated Deprecated (use productID instead). * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; } export interface GetInventoryVariantsResponse { /** Inventory item. */ inventoryItem?: InventoryItemV2; } export interface GetInventoryItemsRequest { /** Product IDs */ productIds?: string[]; } export interface GetInventoryItemsResponse { /** Inventory items. */ inventoryItems?: InventoryItemV2[]; } export interface QueryInventoryRequest { /** Information about paging, filters, sorting. */ query?: Query; } export interface Query { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Filter string */ filter?: string | null; /** Sort string */ sort?: string | null; } export interface Paging { /** Amount of items to load per page */ limit?: number | null; /** Number of items to skip in the display (relevant for all pages after the first) */ offset?: number | null; } export interface QueryInventoryResponse { /** Inventory items. */ inventoryItems?: InventoryItemV2[]; /** Display metadata. */ metadata?: PagingMetadata; /** Number of total results. */ totalResults?: number; } export interface PagingMetadata { /** Amount of items to load per page */ items?: number; /** Number of items to skip in the display (relevant for all pages after the first) */ offset?: number; } 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" } export interface UpdateInventoryVariantsRequest { /** Inventory item. */ inventoryItem: InventoryItemV2; } export interface UpdateInventoryVariantsResponse { } export interface BulkUpdateInventoryVariantsRequest extends BulkUpdateInventoryVariantsRequestActionOneOf { /** Change availability. */ setInStock?: boolean | null; /** Set new quantity. */ setQuantity?: number | null; /** Number to increment inventory by. */ incrementBy?: number | null; /** Number to decrement inventory by. */ decrementBy?: number | null; /** Variants filter. Learn more about [API query language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */ filter?: Record | null; } /** @oneof */ export interface BulkUpdateInventoryVariantsRequestActionOneOf { /** Change availability. */ setInStock?: boolean | null; /** Set new quantity. */ setQuantity?: number | null; /** Number to increment inventory by. */ incrementBy?: number | null; /** Number to decrement inventory by. */ decrementBy?: number | null; } export interface BulkUpdateInventoryVariantsResponse { } export interface BulkUpdateInventoryItemsRequest { /** Variants filter */ variantsFilter?: Record | null; /** Whether inventory is being tracked. */ trackInventory?: boolean | null; } export interface BulkUpdateInventoryItemsResponse { } export interface DecrementInventoryRequest { /** Item or product to decrement. */ decrementData?: DecrementData[]; } export interface DecrementData extends DecrementDataIdOneOf { /** Inventory item ID. */ inventoryId?: string; /** * @internal * @internal * @deprecated Deprecated: use productId. * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; /** Variant ID. */ variantId?: string; /** Number to decrement inventory by. */ decrementBy?: number; /** * Whether the request to decrement the item's inventory was made as part of a purchase that includes preorder items. * If true and the item is available for preorder, we allow negative inventory. * If false and the item is not available for preorder, we allow regular buy flow (no negative inventory). */ preorderRequest?: boolean; } /** @oneof */ export interface DecrementDataIdOneOf { /** Inventory item ID. */ inventoryId?: string; /** * @internal * @internal * @deprecated Deprecated: use productId. * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; } export interface DecrementInventoryResponse { } export interface IncrementInventoryRequest { /** Item or product to increment. */ incrementData?: IncrementData[]; } export interface IncrementData extends IncrementDataIdOneOf { /** Inventory item ID. */ inventoryId?: string; /** Product ID. */ productId?: string; /** Variant ID. */ variantId?: string; /** Number to increment inventory by. */ incrementBy?: number; } /** @oneof */ export interface IncrementDataIdOneOf { /** Inventory item ID. */ inventoryId?: string; /** Product ID. */ productId?: string; } export interface IncrementInventoryResponse { } interface InventoryVariantV2NonNullableFields { variantId: string; availableForPreorder: boolean; } interface PreorderInfoNonNullableFields { enabled: boolean; } interface InventoryItemV2NonNullableFields { variants: InventoryVariantV2NonNullableFields[]; numericId: string; preorderInfo?: PreorderInfoNonNullableFields; } export interface GetInventoryVariantsResponseNonNullableFields { inventoryItem?: InventoryItemV2NonNullableFields; } interface PagingMetadataNonNullableFields { items: number; offset: number; } export interface QueryInventoryResponseNonNullableFields { inventoryItems: InventoryItemV2NonNullableFields[]; metadata?: PagingMetadataNonNullableFields; totalResults: number; } export interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } export interface InventoryItemChangedEnvelope { data: InventoryItemChanged; metadata: BaseEventMetadata; } /** * Triggered when an inventory item is changed. * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @permissionId WIX_STORES.READ_INVENTORY * @webhook * @eventType com.wix.ecommerce.inventory.api.v1.InventoryItemChanged */ export declare function onInventoryItemChanged(handler: (event: InventoryItemChangedEnvelope) => void | Promise): void; export interface InventoryVariantsChangedEnvelope { data: InventoryVariantsChanged; metadata: BaseEventMetadata; } /** * Triggered when inventory variants are changed. * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @permissionId WIX_STORES.READ_INVENTORY * @webhook * @eventType com.wix.ecommerce.inventory.api.v1.InventoryVariantsChanged */ export declare function onInventoryVariantsChanged(handler: (event: InventoryVariantsChangedEnvelope) => void | Promise): void; /** * Gets inventory variant information based on the specified option choices. * * * The `getInventoryVariants()` function returns a Promise that resolves to the specified inventory variant information. * @param inventoryId - Inventory item ID. * @public * @requiredField inventoryId * @permissionId WIX_STORES.READ_INVENTORY * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @applicableIdentity APP * @applicableIdentity VISITOR * @fqn wix.inventory.api.v1.InventoryReadApi.GetInventoryVariants */ export declare function getInventoryVariants(inventoryId: string, options?: GetInventoryVariantsOptions): Promise; export interface GetInventoryVariantsOptions extends GetInventoryVariantsRequestIdOneOf { /** * @internal * @internal * @deprecated Deprecated (use productID instead). * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string; /** Product ID. */ productId?: string; /** Variant IDs to query for this inventory item (optional). */ variantIds?: string[]; } /** * Returns a list of inventory items, given the provided paging, sorting and filtering. * @public * @permissionId WIX_STORES.READ_INVENTORY * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Read Stores - all read permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES * @permissionScope Read Products * @permissionScopeId SCOPE.DC-STORES.READ-PRODUCTS * @applicableIdentity APP * @applicableIdentity VISITOR * @fqn wix.inventory.api.v1.InventoryReadApi.QueryInventory */ export declare function queryInventory(options?: QueryInventoryOptions): Promise; export interface QueryInventoryOptions { /** Information about paging, filters, sorting. */ query?: Query; } /** * Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked. * * * The `updateInventoryVariants()` function is a Promise that resolves to the updated inventory variant data. * @param productId - Product ID. * @public * @requiredField inventoryItem * @requiredField productId * @param inventoryItem - Inventory item to update. * @permissionId WIX_STORES.MODIFY_INVENTORY * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @applicableIdentity APP * @fqn wix.inventory.api.v1.InventoryWriteApi.UpdateInventoryVariants */ export declare function updateInventoryVariants(productId: string | null, inventoryItem: UpdateInventoryVariantsInventoryItem): Promise; export interface UpdateInventoryVariantsInventoryItem { /** Inventory item ID. */ _id?: string | null; /** * @internal * @internal * @readonly * @deprecated Deprecated: use productId. * @replacedBy product_id * @targetRemovalDate 2024-12-31 */ externalId?: string | null; /** Whether quantity is being tracked. */ trackQuantity?: boolean | null; /** Variants associated with this inventory item. */ variants?: InventoryVariantV2[]; /** * Last updated timestamp. * @readonly */ lastUpdated?: Date | null; /** * Inventory’s unique numeric ID (assigned in ascending order). * Primarily for sorting and filtering when crawling all inventories. * @readonly */ numericId?: string; /** Preorder information. */ preorderInfo?: PreorderInfo; } /** * Subtracts a set number of items from inventory. * * * The `decrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory. * @param decrementData - Item or product to decrement. * @public * @documentationMaturity preview * @requiredField decrementData * @permissionId WIX_STORES.MODIFY_INVENTORY * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @applicableIdentity APP * @fqn wix.inventory.api.v1.InventoryWriteApi.DecrementInventory */ export declare function decrementInventory(decrementData: DecrementData[]): Promise; /** * Adds a set number of items to inventory. * * * The `incrementInventory()` function returns a Promise that is resolved when the specified item's quantity has been updated in the inventory. * @param incrementData - Item or product to increment. * @public * @documentationMaturity preview * @requiredField incrementData * @permissionId WIX_STORES.MODIFY_INVENTORY * @permissionScope Manage Stores - all permissions * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES * @permissionScope Manage Products * @permissionScopeId SCOPE.DC-STORES.MANAGE-PRODUCTS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @applicableIdentity APP * @fqn wix.inventory.api.v1.InventoryWriteApi.IncrementInventory */ export declare function incrementInventory(incrementData: IncrementData[]): Promise; export {};