@wix/ditto-codegen-public 1.0.162 → 1.0.164
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs-output/api-docs/bookings-bookings-onBookingCanceled-doc.txt +169 -0
- package/dist/docs-output/api-docs/bookings-bookings-onBookingCreated-doc.txt +154 -0
- package/dist/docs-output/api-docs/crm-contacts-onContactCreated-doc.txt +87 -171
- package/dist/docs-output/api-docs/crm-contacts-onContactDeleted-doc.txt +58 -0
- package/dist/docs-output/api-docs/crm-contacts-onContactUpdated-doc.txt +99 -0
- package/dist/docs-output/api-docs/data-items-get-doc.txt +95 -54
- package/dist/docs-output/api-docs/data-items-insert-doc.txt +235 -43
- package/dist/docs-output/api-docs/data-items-onDataItemCreated-doc.txt +61 -0
- package/dist/docs-output/api-docs/data-items-onDataItemDeleted-doc.txt +58 -0
- package/dist/docs-output/api-docs/data-items-onDataItemUpdated-doc.txt +61 -0
- package/dist/docs-output/api-docs/data-items-query-doc.txt +507 -302
- package/dist/docs-output/api-docs/data-items-remove-doc.txt +120 -40
- package/dist/docs-output/api-docs/data-items-update-doc.txt +425 -46
- package/dist/docs-output/api-docs/ecom-cart-addToCart-doc.txt +488 -0
- package/dist/docs-output/api-docs/ecom-cart-createCart-doc.txt +518 -0
- package/dist/docs-output/api-docs/ecom-cart-createCheckout-doc.txt +155 -0
- package/dist/docs-output/api-docs/ecom-cart-deleteCart-doc.txt +92 -0
- package/dist/docs-output/api-docs/ecom-cart-getCart-doc.txt +376 -0
- package/dist/docs-output/api-docs/ecom-cart-onCartCreated-doc.txt +89 -80
- package/dist/docs-output/api-docs/ecom-cart-onCartUpdated-doc.txt +91 -81
- package/dist/docs-output/api-docs/ecom-cart-removeLineItemsFromCart-doc.txt +321 -0
- package/dist/docs-output/api-docs/ecom-cart-updateCart-doc.txt +539 -0
- package/dist/docs-output/api-docs/ecom-checkout-addToCheckout-doc.txt +1005 -0
- package/dist/docs-output/api-docs/ecom-checkout-createCheckout-doc.txt +1641 -0
- package/dist/docs-output/api-docs/ecom-checkout-getCheckout-doc.txt +1027 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCompleted-doc.txt +151 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCreated-doc.txt +150 -0
- package/dist/docs-output/api-docs/ecom-checkout-onCheckoutUpdated-doc.txt +150 -0
- package/dist/docs-output/api-docs/ecom-checkout-removeLineItemsFromCheckout-doc.txt +879 -0
- package/dist/docs-output/api-docs/ecom-checkout-updateCheckout-doc.txt +1011 -0
- package/dist/docs-output/api-docs/ecom-currentCart-getCurrentCart-doc.txt +368 -322
- package/dist/docs-output/api-docs/ecom-currentCart-updateCurrentCart-doc.txt +506 -321
- package/dist/docs-output/api-docs/ecom-orders-bulkUpdateOrders-doc.txt +1040 -0
- package/dist/docs-output/api-docs/ecom-orders-cancelOrder-doc.txt +608 -0
- package/dist/docs-output/api-docs/ecom-orders-getOrder-doc.txt +926 -0
- package/dist/docs-output/api-docs/ecom-orders-onOrderCreated-doc.txt +245 -0
- package/dist/docs-output/api-docs/ecom-orders-onOrderUpdated-doc.txt +244 -0
- package/dist/docs-output/api-docs/ecom-orders-searchOrders-doc.txt +670 -0
- package/dist/docs-output/api-docs/ecom-orders-updateOrder-doc.txt +818 -0
- package/dist/docs-output/api-docs/search-wixSiteSearch-search-doc.txt +162 -0
- package/dist/docs-output/api-docs/stores-collections-addProductsToCollection-doc.txt +86 -0
- package/dist/docs-output/api-docs/stores-collections-createCollection-doc.txt +108 -0
- package/dist/docs-output/api-docs/stores-collections-getCollection-doc.txt +102 -0
- package/dist/docs-output/api-docs/stores-collections-queryCollections-doc.txt +209 -0
- package/dist/docs-output/api-docs/stores-collections-removeProductsFromCollection-doc.txt +86 -0
- package/dist/docs-output/api-docs/stores-collections-updateCollection-doc.txt +110 -0
- package/dist/docs-output/api-docs/stores-inventory-queryInventory-doc.txt +98 -0
- package/dist/docs-output/api-docs/stores-inventory-updateInventoryVariants-doc.txt +249 -0
- package/dist/docs-output/api-docs/stores-inventoryItemsV3-queryInventoryItems-doc.txt +236 -0
- package/dist/docs-output/api-docs/stores-inventoryItemsV3-updateInventoryItem-doc.txt +139 -0
- package/dist/docs-output/api-docs/stores-productsV3-createProduct-doc.txt +1697 -0
- package/dist/docs-output/api-docs/stores-productsV3-deleteProduct-doc.txt +73 -0
- package/dist/docs-output/api-docs/stores-productsV3-getProduct-doc.txt +933 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductCreated-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductDeleted-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-onProductUpdated-doc.txt +794 -0
- package/dist/docs-output/api-docs/stores-productsV3-queryProducts-doc.txt +1051 -0
- package/dist/docs-output/api-docs/stores-productsV3-searchProducts-doc.txt +1144 -0
- package/dist/docs-output/api-docs/stores-productsV3-updateProduct-doc.txt +1730 -1600
- package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-queryVariants-doc.txt +290 -0
- package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-searchVariants-doc.txt +353 -0
- package/dist/out.js +24996 -553
- package/package.json +2 -2
- package/dist/docs-output/api-docs/data-items-onDataItemCreated.txt +0 -103
- package/dist/docs-output/api-docs/stores-product-onProductCreated-doc.txt +0 -118
- package/dist/docs-output/api-docs/stores-productV3-onProductCreated-doc.txt +0 -184
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<stores_inventory_updateInventoryVariants>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
4
|
+
|
|
5
|
+
stores.inventory.updateInventoryVariants(productId: string, inventoryItem: UpdateInventoryVariantsInventoryItem)
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/stores/inventory/update-inventory-variants
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Updates product inventory, including total quantity, whether the product is in stock, and whether the product inventory is tracked.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
The `updateInventoryVariants()` function is a Promise that resolves to the updated inventory variant data.
|
|
17
|
+
|
|
18
|
+
# Method Permissions:
|
|
19
|
+
|
|
20
|
+
- WIX_STORES.MODIFY_INVENTORY
|
|
21
|
+
|
|
22
|
+
# Method Permissions Scopes IDs:
|
|
23
|
+
|
|
24
|
+
undefined
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Method Code Examples:
|
|
29
|
+
|
|
30
|
+
## Update a variant's inventory information by product ID (with $w)
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
/**************************************
|
|
34
|
+
* Backend code - inventory.web.js/ts *
|
|
35
|
+
**************************************/
|
|
36
|
+
|
|
37
|
+
import { Permissions, webMethod } from '@wix/web-methods';
|
|
38
|
+
import { inventory } from '@wix/stores';
|
|
39
|
+
|
|
40
|
+
export const updateInventoryVariantFieldsByProductId = webMethod(Permissions.Anyone, (productId, inventoryItem) => {
|
|
41
|
+
return inventory.updateInventoryVariants(productId, inventoryItem);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/*************
|
|
45
|
+
* Page code *
|
|
46
|
+
*************/
|
|
47
|
+
|
|
48
|
+
import { updateInventoryVariantFieldsByProductId } from 'backend/inventory.web';
|
|
49
|
+
|
|
50
|
+
$w.onReady(async function () {
|
|
51
|
+
const product = await $w('#productPage1').getProduct();
|
|
52
|
+
let options = product.variants;
|
|
53
|
+
let foundVariant = options.find((option) => {
|
|
54
|
+
return option.choices.Color === "red" && option.choices.Size === "large";
|
|
55
|
+
});
|
|
56
|
+
let inventoryItem = {
|
|
57
|
+
trackQuantity: false,
|
|
58
|
+
variants: [{
|
|
59
|
+
inStock: true,
|
|
60
|
+
variantId: foundVariant._id,
|
|
61
|
+
}]
|
|
62
|
+
};
|
|
63
|
+
updateInventoryVariantFieldsByProductId(product._id, inventoryItem);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/* A sample inventory item with variants is:
|
|
67
|
+
*
|
|
68
|
+
* {
|
|
69
|
+
* "_id" : 133c6\-...-0fb2,
|
|
70
|
+
* "productId" : ecc3-...-1f04d,
|
|
71
|
+
* "trackQuantity" : true,
|
|
72
|
+
* "variants" : -[
|
|
73
|
+
* {
|
|
74
|
+
* "variantId" : 00000000-0000-0020-0005-9ec14dfb2270,
|
|
75
|
+
* "inStock" : false,
|
|
76
|
+
* "quantity" : 0
|
|
77
|
+
* },
|
|
78
|
+
* {
|
|
79
|
+
* "variantId" : 00000000-0000-0021-0005-9ec14dfb2270,
|
|
80
|
+
* "inStock" : false,
|
|
81
|
+
* "quantity" : 0
|
|
82
|
+
* },
|
|
83
|
+
* {
|
|
84
|
+
* "variantId" : 00000000-0000-0022-0005-9ec14dfb2270,
|
|
85
|
+
* "inStock" : true,
|
|
86
|
+
* "quantity" : 100
|
|
87
|
+
* },
|
|
88
|
+
* {
|
|
89
|
+
* "variantId" : 00000000-0000-003f-0005-9ec14dfb2270,
|
|
90
|
+
* "inStock" : true,
|
|
91
|
+
* "quantity" : 123
|
|
92
|
+
* },
|
|
93
|
+
* {
|
|
94
|
+
* "variantId" : 00000000-0000-0040-0005-9ec14dfb2270,
|
|
95
|
+
* "inStock" : false,
|
|
96
|
+
* "quantity" : 0
|
|
97
|
+
* },
|
|
98
|
+
* {
|
|
99
|
+
* "variantId" : 00000000-0000-0041-0005-9ec14dfb2270,
|
|
100
|
+
* "inStock" : true,
|
|
101
|
+
* "quantity" : 1
|
|
102
|
+
* }
|
|
103
|
+
* ],
|
|
104
|
+
* "_updatedDate" : 2020-02-17T08:25:57.734Z
|
|
105
|
+
* }
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Update a variant's inventory information by product ID using user input (with $w)
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
/**************************************
|
|
114
|
+
* Backend code - inventory.web.js/ts *
|
|
115
|
+
**************************************/
|
|
116
|
+
|
|
117
|
+
import { Permissions, webMethod } from '@wix/web-methods';
|
|
118
|
+
import { inventory } from '@wix/stores';
|
|
119
|
+
|
|
120
|
+
export const updateInventoryVariantFieldsByProductId = webMethod(Permissions.Anyone, (productId, inventoryItem) => {
|
|
121
|
+
return inventory.updateInventoryVariants(productId, inventoryItem);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
/*************
|
|
125
|
+
* Page code *
|
|
126
|
+
*************/
|
|
127
|
+
|
|
128
|
+
import { updateInventoryVariantFieldsByProductId } from 'backend/inventory.web';
|
|
129
|
+
import { items } from '@wix/data';
|
|
130
|
+
|
|
131
|
+
export function updateByProductIdButton_click(event) {
|
|
132
|
+
const productId = $w('#updateByProductIdInventoryId').value;
|
|
133
|
+
const trackQuantity = $w('#updateByProductIdTrackInventory').checked;
|
|
134
|
+
const variantId = $w('#updateByProductIdVariantId').value;
|
|
135
|
+
const inStock = $w('#updateByProductIdInStock').checked;
|
|
136
|
+
const quantity = $w('#updateByProductIdQuantity').value;
|
|
137
|
+
|
|
138
|
+
updateInventoryVariantFieldsByProductId(productId, {
|
|
139
|
+
trackQuantity,
|
|
140
|
+
variants: [{
|
|
141
|
+
variantId,
|
|
142
|
+
inStock,
|
|
143
|
+
quantity
|
|
144
|
+
}]
|
|
145
|
+
}).then(console.log("Variant inventory updated."));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Populate variant dropdown options
|
|
149
|
+
// from which the user will choose.
|
|
150
|
+
export async function updateByProductIdRefreshVariantId_click(event) {
|
|
151
|
+
const productId = $w('#updateByProductIdInventoryId').value;
|
|
152
|
+
const variantRefreshResults = await items.query('Stores/InventoryItems').eq('productId', productId).find();
|
|
153
|
+
const ids = variantRefreshResults.items[0].variants.map(variant => {
|
|
154
|
+
return { label: variant.variantId, value: variant.variantId };
|
|
155
|
+
});
|
|
156
|
+
$w('#updateByProductIdVariantId').options = ids;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* A sample inventory item with variants is:
|
|
160
|
+
*
|
|
161
|
+
* {
|
|
162
|
+
* "_id" : 133c6\-...-0fb2,
|
|
163
|
+
* "externalId" : ecc3-...-1f04d,
|
|
164
|
+
* "trackQuantity" : true,
|
|
165
|
+
* "variants" : -[
|
|
166
|
+
* {
|
|
167
|
+
* "variantId" : 00000000-0000-0020-0005-9ec14dfb2270,
|
|
168
|
+
* "inStock" : false,
|
|
169
|
+
* "quantity" : 0
|
|
170
|
+
* },
|
|
171
|
+
* {
|
|
172
|
+
* "variantId" : 00000000-0000-0021-0005-9ec14dfb2270,
|
|
173
|
+
* "inStock" : false,
|
|
174
|
+
* "quantity" : 0
|
|
175
|
+
* },
|
|
176
|
+
* {
|
|
177
|
+
* "variantId" : 00000000-0000-0022-0005-9ec14dfb2270,
|
|
178
|
+
* "inStock" : true,
|
|
179
|
+
* "quantity" : 100
|
|
180
|
+
* },
|
|
181
|
+
* {
|
|
182
|
+
* "variantId" : 00000000-0000-003f-0005-9ec14dfb2270,
|
|
183
|
+
* "inStock" : true,
|
|
184
|
+
* "quantity" : 123
|
|
185
|
+
* },
|
|
186
|
+
* {
|
|
187
|
+
* "variantId" : 00000000-0000-0040-0005-9ec14dfb2270,
|
|
188
|
+
* "inStock" : false,
|
|
189
|
+
* "quantity" : 0
|
|
190
|
+
* },
|
|
191
|
+
* {
|
|
192
|
+
* "variantId" : 00000000-0000-0041-0005-9ec14dfb2270,
|
|
193
|
+
* "inStock" : true,
|
|
194
|
+
* "quantity" : 1
|
|
195
|
+
* }
|
|
196
|
+
* ],
|
|
197
|
+
* "_updatedDate" : 2020-02-17T08:25:57.734Z
|
|
198
|
+
* }
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
## default
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
try {
|
|
209
|
+
const result = await inventory.updateInventoryVariants("7bb38a7a-70b7-9cf3-fc80-584205694465", {
|
|
210
|
+
_id: "844c7585-8f48-630c-037f-a7bdfa96bb9a",
|
|
211
|
+
trackQuantity: true,
|
|
212
|
+
variants: [{
|
|
213
|
+
variantId: "00000000-0000-0000-0000-000000000000",
|
|
214
|
+
inStock: true,
|
|
215
|
+
quantity: 10
|
|
216
|
+
}],
|
|
217
|
+
preorderInfo: {
|
|
218
|
+
enabled: false
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
return result;
|
|
222
|
+
} catch (error) {
|
|
223
|
+
console.error(error);
|
|
224
|
+
throw error;
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
</description>
|
|
228
|
+
<type_definition>
|
|
229
|
+
```
|
|
230
|
+
Method: stores.inventory.updateInventoryVariants(productId, inventoryItem)
|
|
231
|
+
Description: 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.
|
|
232
|
+
Method parameters:
|
|
233
|
+
param name: productId | type: string | description: Product GUID. | required: true
|
|
234
|
+
param name: inventoryItem | type: UpdateInventoryVariantsInventoryItem | description: Inventory item to update. | required: true
|
|
235
|
+
- name: _id | type: string | description: Inventory item GUID.
|
|
236
|
+
- name: preorderInfo | type: PreorderInfo | description: Preorder information.
|
|
237
|
+
- name: enabled | type: boolean | description: Whether the item is available for preorder.
|
|
238
|
+
- name: limit | type: number | description: Number of products that can be preordered after stock reaches zero.
|
|
239
|
+
- name: message | type: string | description: A message the buyer will see when the item is out of stock and preorder is enabled.
|
|
240
|
+
- name: trackQuantity | type: boolean | description: Whether quantity is being tracked.
|
|
241
|
+
- name: variants | type: Array<InventoryVariantV2> | description: Variants associated with this inventory item.
|
|
242
|
+
- name: inStock | type: boolean | description: Whether the product is listed as in stock.
|
|
243
|
+
- name: quantity | type: number | description: Quantity currently left in inventory.
|
|
244
|
+
- name: variantId | type: string | description: Variant GUID.
|
|
245
|
+
Return type: PROMISE<void>
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
</type_definition>
|
|
249
|
+
</stores_inventory_updateInventoryVariants>
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<stores_inventoryItemsV3_queryInventoryItems>
|
|
2
|
+
<description>
|
|
3
|
+
# Method name:
|
|
4
|
+
|
|
5
|
+
stores.inventoryItemsV3.queryInventoryItems()
|
|
6
|
+
|
|
7
|
+
# Method Link:
|
|
8
|
+
|
|
9
|
+
https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/inventory-items-v3/query-inventory-items
|
|
10
|
+
|
|
11
|
+
# Method Description:
|
|
12
|
+
|
|
13
|
+
Retrieves a list of up to 1,000 inventory items, given the provided filtering, sorting, and cursor paging.
|
|
14
|
+
|
|
15
|
+
For field support for filters and sorting,
|
|
16
|
+
see [Inventory Items: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/inventory-items-v3/supported-filters-and-sorting).
|
|
17
|
+
|
|
18
|
+
To learn about working with _Query_ endpoints, see
|
|
19
|
+
[API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language),
|
|
20
|
+
and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging).
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|PROPERTY |SUPPORTED FILTERS & SORTING
|
|
24
|
+
|:---:|:---:|
|
|
25
|
+
|`inStock`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
26
|
+
|`quantity`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`gt()`](/inventory-items-query-builder/gt),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
27
|
+
|`_id`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge)|
|
|
28
|
+
|`_createdDate`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`gt()`](/inventory-items-query-builder/gt),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
29
|
+
|`_updatedDate`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`gt()`](/inventory-items-query-builder/gt),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
30
|
+
|`variantId`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge)|
|
|
31
|
+
|`locationId`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge)|
|
|
32
|
+
|`productId`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
33
|
+
|`trackQuantity`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
34
|
+
|`availabilityStatus`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
35
|
+
|`preorderInfo.enabled`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
36
|
+
|`product.name`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
37
|
+
|`product.directCategoryIds`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`hasAll()`](/inventory-items-query-builder/has-all),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
38
|
+
|`product.variantName`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
39
|
+
|`product.variantSku`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
40
|
+
|
|
41
|
+
# Method Permissions:
|
|
42
|
+
|
|
43
|
+
- WIX_STORES.INVENTORY_READ
|
|
44
|
+
|
|
45
|
+
# Method Permissions Scopes IDs:
|
|
46
|
+
|
|
47
|
+
undefined
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
# Method Code Examples:
|
|
52
|
+
|
|
53
|
+
## queryInventoryItems
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import { inventoryItemsV3 } from '@wix/stores';
|
|
57
|
+
|
|
58
|
+
async function queryInventoryItems() {
|
|
59
|
+
const { items } = await inventoryItemsV3.queryInventoryItems().find();
|
|
60
|
+
};
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## queryInventoryItems (with elevated permissions)
|
|
64
|
+
|
|
65
|
+
```javascript
|
|
66
|
+
import { inventoryItemsV3 } from '@wix/stores';
|
|
67
|
+
import { auth } from '@wix/essentials';
|
|
68
|
+
|
|
69
|
+
async function myQueryInventoryItemsMethod(query) {
|
|
70
|
+
const elevatedQueryInventoryItems = auth.elevate(inventoryItemsV3.queryInventoryItems);
|
|
71
|
+
const response = await elevatedQueryInventoryItems(query);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
## default
|
|
78
|
+
|
|
79
|
+
```javascript
|
|
80
|
+
try {
|
|
81
|
+
const { items } = await inventoryItemsV3.queryInventoryItems().find();
|
|
82
|
+
return items;
|
|
83
|
+
} catch (error) {
|
|
84
|
+
console.error(error);
|
|
85
|
+
throw error;
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
</description>
|
|
89
|
+
<type_definition>
|
|
90
|
+
```
|
|
91
|
+
Method: stores.inventoryItemsV3.queryInventoryItems()
|
|
92
|
+
Description: Retrieves a list of up to 1,000 inventory items, given the provided filtering, sorting, and cursor paging. For field support for filters and sorting, see [Inventory Items: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/stores/catalog-v3/inventory-items-v3/supported-filters-and-sorting). To learn about working with _Query_ endpoints, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language), and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/getting-started/sorting-and-paging). |PROPERTY |SUPPORTED FILTERS & SORTING |:---:|:---:| |`inStock`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`quantity`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`gt()`](/inventory-items-query-builder/gt),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`_id`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge)| |`_createdDate`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`gt()`](/inventory-items-query-builder/gt),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`_updatedDate`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`gt()`](/inventory-items-query-builder/gt),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`variantId`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge)| |`locationId`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge)| |`productId`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`trackQuantity`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`availabilityStatus`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`preorderInfo.enabled`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`product.name`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`product.directCategoryIds`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`hasAll()`](/inventory-items-query-builder/has-all),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`product.variantName`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)| |`product.variantSku`|[`eq()`](/inventory-items-query-builder/eq),[`ne()`](/inventory-items-query-builder/ne),[`exists()`](/inventory-items-query-builder/exists),[`in()`](/inventory-items-query-builder/in),[`hasSome()`](/inventory-items-query-builder/has-some),[`startsWith()`](/inventory-items-query-builder/starts-with),[`gt()`](/inventory-items-query-builder/gt),[`lt()`](/inventory-items-query-builder/lt),[`le()`](/inventory-items-query-builder/le),[`ge()`](/inventory-items-query-builder/ge),[`ascending()`](/inventory-items-query-builder/ascending),[`descending()`](/inventory-items-query-builder/descending)|
|
|
93
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
94
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().ascending(propertyNames)
|
|
95
|
+
Description: Adds a sort to a query, sorting by the specified properties in ascending order. The `ascending()` function refines a `InventoryItemsQueryBuilder` to sort by the value of `propertyName` in ascending order. You can specify multiple properties for sorting in ascending order by passing each property name as an additional argument. `ascending()` sorts the results in the order the properties are passed. You can sort the following types: - Number: Sorts numerically. - Date: Sorts by date and time. - String: Sorts lexicographically, so `'abc'` comes after `'XYZ'`. If a property contains a number stored as a string (for example, `'0'`), that value is sorted alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest.
|
|
96
|
+
Method parameters:
|
|
97
|
+
param name: propertyNames | type: Array<string> | description: Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
98
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
99
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().descending(propertyNames)
|
|
100
|
+
Description: Adds a sort to a query, sorting by the specified properties in descending order. The `descending()` function refines a `InventoryItemsQueryBuilder` to sort by the value of `propertyName` in descending order. You can specify multiple properties for sorting in descending order by passing each property name as an additional argument. `descending()` sorts the results in the order the properties are passed. You can sort the following types: - Number: Sorts numerically. - Date: Sorts by date and time. - String: Sorts lexicographically, so `'abc'` comes after `'XYZ'`. If a property contains a number stored as a string (for example, `'0'`), that value is sorted alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest.
|
|
101
|
+
Method parameters:
|
|
102
|
+
param name: propertyNames | type: Array<string> | description: Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
103
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
104
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().eq(propertyName, value)
|
|
105
|
+
Description: Refines a query to match items where the specified property equals the specified value. The `eq()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` equals the specified `value`. `eq()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. Matching strings with `eq()` is case-sensitive, so `'text'` isn't equal to `'Text'`.
|
|
106
|
+
Method parameters:
|
|
107
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
108
|
+
param name: value | type: any | description: Value to compare against.
|
|
109
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
110
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().exists(propertyName, value)
|
|
111
|
+
Description: Refines a query to match items where the specified property contains a value. The `exists()` function refines a `InventoryItemsQueryBuilder` to only match items where the value of the specified `propertyName` doesn't equal null or undefined. `exists()` checks for either existence or non-existence based on the boolean parameter. Note that `exists()` does match items where the value of the specified `propertyName` is an empty string or an invalid value. `exists()` is only useful for properties which don't contain default values and therefore their values may be unassigned.
|
|
112
|
+
Method parameters:
|
|
113
|
+
param name: propertyName | type: string | description: none
|
|
114
|
+
param name: value | type: boolean | description: none
|
|
115
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
116
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().find()
|
|
117
|
+
Description: Returns the query results. The `find()` function returns a Promise that resolves to the query results and metadata. The Promise is rejected if `find()` is called with insufficient permissions or if any of the previous functions used to refine the query are invalid.
|
|
118
|
+
Return type: PROMISE<InventoryItemsQueryResult>
|
|
119
|
+
- name: cursors | type: Cursors | description: Returns the query cursors. `cursors` returns the query's `next` and `prev` cursors.
|
|
120
|
+
- name: cursors.next | type: string | description: Cursor string pointing to the next page in the list of results.
|
|
121
|
+
- name: cursors.prev | type: string | description: Cursor pointing to the previous page in the list of results.
|
|
122
|
+
- name: items | type: Array<InventoryItem> | description: Returns an array of `inventoryItemsV3` items that match the query. `items` contains the current page of results retrieved by the query. If no results match the query, `items` is an empty array. The page size is defined by the [`limit()`](/inventory-items-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `inventoryItemsV3` to navigate the pages of a query result.
|
|
123
|
+
- name: items[]._createdDate | type: Date | description: Date and time the inventory item was created.
|
|
124
|
+
- name: items[]._id | type: string | description: Inventory item GUID.
|
|
125
|
+
- name: items[]._updatedDate | type: Date | description: Date and time the inventory item was created.
|
|
126
|
+
- name: items[].availabilityStatus | type: AvailabilityStatus | description: Inventory item availability status. Supported values: + OUT_OF_STOCK: Product is out of stock. + IN_STOCK: Product is in stock. See `quantity` field for exact amount in stock. + PREORDER: Product is only available for preorder. See `preorderInfo` field for more info.
|
|
127
|
+
enum:
|
|
128
|
+
IN_STOCK: Product is in stock. See `quantity` field for exact amount in stock.
|
|
129
|
+
OUT_OF_STOCK: Product is out of stock.
|
|
130
|
+
PREORDER: Product is only available for preorder. See `preorderInfo` field for more info.
|
|
131
|
+
UNKNOWN_AVAILABILITY_STATUS
|
|
132
|
+
- name: items[].extendedFields | type: ExtendedFields | description: Custom field data for the inventory item object. [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
|
|
133
|
+
- name: items[].extendedFields.namespaces | type: Record<string, undefined> | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
134
|
+
- name: items[].locationId | type: string | description: Stores location GUID.
|
|
135
|
+
- name: items[].preorderInfo | type: PreorderInfo | description: Item preorder info.
|
|
136
|
+
- name: items[].preorderInfo.counter | type: number | description: Number of times the product was preordered. Supported only for inventory items with `trackQuantity = true`.
|
|
137
|
+
- name: items[].preorderInfo.enabled | type: boolean | description: Whether preorder is enabled for the product. Default: `false`
|
|
138
|
+
- name: items[].preorderInfo.limit | type: number | description: Number of products that can be preordered after stock reaches zero. Supported only for inventory items with `trackQuantity = true`. Default: `100000`
|
|
139
|
+
- name: items[].preorderInfo.message | type: string | description: A message the customer will see when the item is out of stock and preorder is enabled.
|
|
140
|
+
- name: items[].preorderInfo.quantity | type: number | description: Quantity of products that can be preordered. Supported only for inventory items with `trackQuantity = true`.
|
|
141
|
+
- name: items[].product | type: Product | description: Product.
|
|
142
|
+
- name: items[].product.directCategoryIds | type: Array<string> | description: List of category GUIDs that this product is included in directly.
|
|
143
|
+
- name: items[].product.name | type: string | description: Product name.
|
|
144
|
+
- name: items[].product.variantName | type: string | description: Variant name.
|
|
145
|
+
- name: items[].product.variantSku | type: string | description: Variant SKU (stock keeping unit).
|
|
146
|
+
- name: items[].product.variantVisible | type: boolean | description: Variant visible.
|
|
147
|
+
- name: items[].productId | type: string | description: Product GUID.
|
|
148
|
+
- name: items[].revision | type: string | description: Revision number, which increments by 1 each time the inventory item is updated. To prevent conflicting changes, the current revision must be passed when updating the inventory item. Ignored when creating an inventory item.
|
|
149
|
+
- name: items[].trackQuantity | type: boolean | description: Whether the quantity is being tracked.
|
|
150
|
+
- name: items[].variantId | type: string | description: Variant GUID.
|
|
151
|
+
- ONE-OF:
|
|
152
|
+
- name: items[].inStock | type: boolean | description: Tracking method - in stock. When set to `true`, the item is available for sale without a quantity limit.
|
|
153
|
+
- name: items[].quantity | type: number | description: Tracking method - quantity left in inventory. Quantity can be negative when decrementing inventory for an order that has already been paid.
|
|
154
|
+
- name: length | type: number | description: Returns the number of items in the current page of results. `length` returns just the number of items in the current page, not the total number of items that match the query. The page size is defined by the [`limit()`](/inventory-items-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `inventoryItemsV3` to navigate the pages of a query result.
|
|
155
|
+
- name: pageSize | type: number | description: Returns the requested page size. `pageSize` returns the page size set in [`limit()`](/inventory-items-query-builder/limit) in `InventoryItemsQueryBuilder`.
|
|
156
|
+
- name: query | type: InventoryItemsQueryBuilder | description: Returns the `InventoryItemsQueryBuilder` object used to get the current results. Use `query` to create and run a new query by chaining additional `InventoryItemsQueryBuilder` functions to it. You can filter only on properties that haven't already been used in the previous `InventoryItemsQueryBuilder`.
|
|
157
|
+
Method: stores.inventoryItemsV3.hasNext()
|
|
158
|
+
Description: Indicates whether the query has more results. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `inventoryItemsV3` to navigate the pages of a query result.
|
|
159
|
+
Return type: PRIMITIVE<boolean>
|
|
160
|
+
Method: stores.inventoryItemsV3.hasPrev()
|
|
161
|
+
Description: Indicates whether the query has previous results. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `inventoryItemsV3` to navigate the pages of a query result.
|
|
162
|
+
Return type: PRIMITIVE<boolean>
|
|
163
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().next()
|
|
164
|
+
Description: Retrieves the next page of query results. The `next()` function retrieves the next page of query results. The page size is defined by the [`limit()`](/inventory-items-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `inventoryItemsV3` to navigate the pages of a query result. If items are added or removed between calls to `next()`, the values returned by `InventoryItemsQueryBuilder` may change.
|
|
165
|
+
Return type: PROMISE<InventoryItemsQueryResult>
|
|
166
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().prev()
|
|
167
|
+
Description: Retrieves the previous page of query results. The `prev()` function retrieves the previous page of query results. The page size is defined by the [`limit()`](/inventory-items-query-builder/limit) function and can be retrieved using the [`pageSize`](#page-size) property. You can use the [`next()`](#next) and [`prev()`](#prev) functions returned by `inventoryItemsV3` to navigate the pages of a query result. If items are added or removed between calls to `prev()`, the values returned may change.
|
|
168
|
+
Return type: PROMISE<InventoryItemsQueryResult>
|
|
169
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().ge(propertyName, value)
|
|
170
|
+
Description: Refines a query to match items where the specified property is greater than or equal to the specified value. The `ge()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` is greater than or equal to the specified `value`. `ge()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'abc'` is greater than `'ABC'`.
|
|
171
|
+
Method parameters:
|
|
172
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
173
|
+
param name: value | type: any | description: Value to compare against.
|
|
174
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
175
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().gt(propertyName, value)
|
|
176
|
+
Description: Refines a query to match items where the specified property is greater than the specified value. The `gt()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` is greater than the specified `value`. `gt()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'abc'` is greater than `'ABC'`.
|
|
177
|
+
Method parameters:
|
|
178
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
179
|
+
param name: value | type: any | description: Value to compare against.
|
|
180
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
181
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().hasAll(propertyName, value)
|
|
182
|
+
Description: Refines a query to match items whose specified property contains all of the specified values. The `hasAll()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` equals all of the specified `values`. Matching strings with `hasAll()` is case-sensitive, so `'text'` isn't equal to `'Text'`. If the specified property is an array, `hasAll()` matches if that array's elements match all of the specified values.
|
|
183
|
+
Method parameters:
|
|
184
|
+
param name: propertyName | type: string | description: Property whose value is compared with `values`.
|
|
185
|
+
param name: value | type: Array<any> | description: none
|
|
186
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
187
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().hasSome(propertyName, value)
|
|
188
|
+
Description: Refines a query to match items whose specified property contains any of the specified values. The `hasSome()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` equals any of the specified `values`. Matching strings with `hasSome()` is case-sensitive, so `'text'` isn't equal to `'Text'`. If the specified property is an array, `hasSome()` matches if any of that array's elements equal any of the specified values.
|
|
189
|
+
Method parameters:
|
|
190
|
+
param name: propertyName | type: string | description: Property whose value is compared with `values`.
|
|
191
|
+
param name: value | type: Array<any> | description: none
|
|
192
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
193
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().in(propertyName, value)
|
|
194
|
+
Description: Refines a query to only match items where the specified property contains any of the values in the provided array of values. The `in()` function refines a `InventoryItemsQueryBuilder` to match only items where the specified `propertyName` is equal to any of the values in the provided array. Matching strings with `in()` is case-sensitive, so `'text'` isn't equal to `'Text'`.
|
|
195
|
+
Method parameters:
|
|
196
|
+
param name: propertyName | type: string | description: none
|
|
197
|
+
param name: value | type: any | description: none
|
|
198
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
199
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().le(propertyName, value)
|
|
200
|
+
Description: Refines a query to match items where the specified property is less than or equal to the specified value. The `le()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` is less than or equal to the specified `value`. `le()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'ABC'` is less than `'abc'`.
|
|
201
|
+
Method parameters:
|
|
202
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
203
|
+
param name: value | type: any | description: Value to compare against.
|
|
204
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
205
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().limit(limit)
|
|
206
|
+
Description: Limits the number of items the query returns. The `limit()` function defines the number of results a query returns in each page. Only one page of results is retrieved at a time. You can use the `next()` and `prev()` functions to navigate the pages of a query result.
|
|
207
|
+
Method parameters:
|
|
208
|
+
param name: limit | type: number | description: Number of items to return, which is also the `pageSize` of the results object.
|
|
209
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
210
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().lt(propertyName, value)
|
|
211
|
+
Description: Refines a query to match items where the specified property is less than the specified value. The `le()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` is less than the specified `value`. `le()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest. The following types of properties can be compared: - Number: Compares numerically. - Date: Compares JavaScript Date objects. - String: Compares lexicographically, so `'ABC'` is less than `'abc'`.
|
|
212
|
+
Method parameters:
|
|
213
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
214
|
+
param name: value | type: any | description: Value to compare against.
|
|
215
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
216
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().ne(propertyName, value)
|
|
217
|
+
Description: Refines a query to match items where the specified property doesn't equal the specified value. The `ne()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` doesn't equal the specified `value`. `ne()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string. Matching strings with `ne()` is case-sensitive, so `'text'` isn't equal to `'Text'`.
|
|
218
|
+
Method parameters:
|
|
219
|
+
param name: propertyName | type: string | description: Property whose value is compared with `value`.
|
|
220
|
+
param name: value | type: any | description: Value to compare against.
|
|
221
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
222
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().skipTo(cursor)
|
|
223
|
+
Description: Refines a query that skips to a specific record. The `skipTo()` function refines a `InventoryItemsQueryBuilder` to return items that appear before or after the item pointed to by the provided cursor. Get the relevant cursor for a specific item from the `cursors` object in previous call's response. Then you can skip to `cursors.prev` to return items before the cursor, or `cursors.next` to return items after the cursor. When using `skipTo()`, the filters and the sorting order of the original query can't be changed. Only the `limit()` property of the query can be changed.
|
|
224
|
+
Method parameters:
|
|
225
|
+
param name: cursor | type: string | description: A pointer to specific record
|
|
226
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
227
|
+
Method: stores.inventoryItemsV3.queryInventoryItems().startsWith(propertyName, value)
|
|
228
|
+
Description: Refines a query to match items where the specified property starts with the specified value. The `startsWith()` function refines a `InventoryItemsQueryBuilder` to match only items where the value of the specified `propertyName` starts with the specified `string`. Matching with `startsWith()` is case-sensitive, so `'TEXT'` doesn't start with `'text'`. You can only use `startsWith()` with a property whose value is a string.
|
|
229
|
+
Method parameters:
|
|
230
|
+
param name: propertyName | type: string | description: Property whose value is compared with `string`.
|
|
231
|
+
param name: value | type: string | description: none
|
|
232
|
+
Return type: REFERENCE<InventoryItemsQueryBuilder>
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
</type_definition>
|
|
236
|
+
</stores_inventoryItemsV3_queryInventoryItems>
|