> 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 # GetInventory # Package: suppliersHub # Namespace: MarketplaceProvider # Method link: https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/marketplace-provider-service-plugin/get-inventory.md ## Introduction Retrieves current inventory levels for a product's variants. Wix calls this method when a site owner opens a product details page and wants to see current stock levels. Wix uses the response to display available inventory for each product variant. --- ## REST API ### Schema ``` Method: getInventory Description: Retrieves current inventory levels for a product's variants. Wix calls this method when a site owner opens a product details page and wants to see current stock levels. Wix uses the response to display available inventory for each product variant. URL: null Method: POST Method parameters: param name: choices | type: array | description: Choices to filter by. For example, only return inventory for variants matching "Size: M" and "Color: Black". If empty, inventory for all available variants is returned. | validation: maxItems 10 - name: name | type: string | description: Choice name. For example, "Size", "Color", or "Material". | validation: maxLength 50 - name: value | type: ChoiceValue | description: Choice value. - ONE-OF: - name: simpleValue | type: string | description: Simple text value. For example, "M" for size, or "Cotton" for material. | validation: minLength 1, maxLength 50 - name: color | type: Color | description: Color value with name and hex code. - name: name | type: string | description: Color name. For example, "Black" or "Red". | validation: minLength 1, maxLength 50 - name: hex | type: string | description: Hex color code. For example, `#000000`. | validation: format COLOR_HEX param name: providerProductId | type: providerProductId | description: Unique product identifier on the provider's platform. | validation: minLength 1, maxLength 36 Return type: GetInventoryResponse - name: providerProductId | type: string | description: Unique product identifier on the provider's platform. | validation: minLength 1, maxLength 36 - name: inventoryVariants | type: array | description: Inventory data for each variant matching the requested choices. | validation: maxItems 100 - name: choices | type: array | description: Choices that define this variant. For example, "Size: M" and "Color: Black". | validation: maxItems 10 - name: name | type: string | description: Choice name. For example, "Size", "Color", or "Material". | validation: maxLength 50 - name: value | type: ChoiceValue | description: Choice value. - ONE-OF: - name: simpleValue | type: string | description: Simple text value. For example, "M" for size, or "Cotton" for material. | validation: minLength 1, maxLength 50 - name: color | type: Color | description: Color value with name and hex code. - name: name | type: string | description: Color name. For example, "Black" or "Red". | validation: minLength 1, maxLength 50 - name: hex | type: string | description: Hex color code. For example, `#000000`. | validation: format COLOR_HEX - name: quantity | type: integer | description: Available inventory quantity for this variant. `null` indicates the quantity is unknown or not tracked by the provider. | validation: minimum 0, format int32 ``` ### Examples ### Get Inventory Retrieves current inventory levels for a product's variants ```curl curl -X POST \ 'https://www.wixapis.com/v2/get-inventory' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "providerProductId": "73cfa507-221b-417a-bd62-c7b62065068e", "choices": [ { "name": "Size", "value": { "simpleValue": "L" } }, { "name": "Color", "value": { "color": { "name": "Black", "hex": "#000000" } } } ] }' ``` ---