@@ -124,7 +124,7 @@ client.product.fetchAll().then((products) => {
124
124
});
125
125
126
126
// Fetch a single product by ID
127
- const productId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ= ' ;
127
+ const productId = ' gid://shopify/Product/7857989384 ' ;
128
128
129
129
client .product .fetch (productId).then ((product ) => {
130
130
// Do something with the product
@@ -150,7 +150,7 @@ client.collection.fetchAllWithProducts().then((collections) => {
150
150
});
151
151
152
152
// Fetch a single collection by ID, including its products
153
- const collectionId = ' Z2lkOi8vc2hvcGlmeS9Db2xsZWN0aW9uLzM2OTMxMjU4NA== ' ;
153
+ const collectionId = ' gid://shopify/Collection/369312584 ' ;
154
154
// Set a parameter for first x products, defaults to 20 if you don't provide a param
155
155
156
156
client .collection .fetchWithProducts (collectionId, {productsFirst: 10 }).then ((collection ) => {
@@ -171,7 +171,7 @@ client.checkout.create().then((checkout) => {
171
171
172
172
### Updating checkout attributes
173
173
``` javascript
174
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N= ' ;
174
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ;
175
175
const input = {customAttributes: [{key: " MyKey" , value: " MyValue" }]};
176
176
177
177
client .checkout .updateAttributes (checkoutId, input).then ((checkout ) => {
@@ -181,10 +181,10 @@ client.checkout.updateAttributes(checkoutId, input).then((checkout) => {
181
181
182
182
### Adding Line Items
183
183
``` javascript
184
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI= ' ; // ID of an existing checkout
184
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ; // ID of an existing checkout
185
185
const lineItemsToAdd = [
186
186
{
187
- variantId: ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMjc5Mg== ' ,
187
+ variantId: ' gid://shopify/ProductVariant/29106064584 ' ,
188
188
quantity: 5 ,
189
189
customAttributes: [{key: " MyKey" , value: " MyValue" }]
190
190
}
@@ -199,35 +199,35 @@ client.checkout.addLineItems(checkoutId, lineItemsToAdd).then((checkout) => {
199
199
200
200
### Updating Line Items
201
201
``` javascript
202
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI= ' ; // ID of an existing checkout
202
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ; // ID of an existing checkout
203
203
const lineItemsToUpdate = [
204
- {id: ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ= ' , quantity: 2 }
204
+ {id: ' gid://shopify/Product/7857989384 ' , quantity: 2 }
205
205
];
206
206
207
207
// Update the line item on the checkout (change the quantity or variant)
208
208
client .checkout .updateLineItems (checkoutId, lineItemsToUpdate).then ((checkout ) => {
209
209
// Do something with the updated checkout
210
- console .log (checkout .lineItems ); // Quantity of line item 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ= ' updated to 2
210
+ console .log (checkout .lineItems ); // Quantity of line item 'gid://shopify/Product/7857989384 ' updated to 2
211
211
});
212
212
```
213
213
214
214
### Removing Line Items
215
215
``` javascript
216
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI= ' ; // ID of an existing checkout
216
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ; // ID of an existing checkout
217
217
const lineItemIdsToRemove = [
218
- ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ= '
218
+ ' gid://shopify/Product/7857989384 '
219
219
];
220
220
221
221
// Remove an item from the checkout
222
222
client .checkout .removeLineItems (checkoutId, lineItemIdsToRemove).then ((checkout ) => {
223
223
// Do something with the updated checkout
224
- console .log (checkout .lineItems ); // Checkout with line item 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ= ' removed
224
+ console .log (checkout .lineItems ); // Checkout with line item 'gid://shopify/Product/7857989384 ' removed
225
225
});
226
226
```
227
227
228
228
### Fetching a Checkout
229
229
``` javascript
230
- const checkoutId = ' 2U4NWNkYzI4ZWEyOTdlOD9rZXk9MDVjMzY3Zjk3YWM0YWJjNGRhMTkwMDgwYTUzOGJmYmI= '
230
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 '
231
231
232
232
client .checkout .fetch (checkoutId).then ((checkout ) => {
233
233
// Do something with the checkout
@@ -237,7 +237,7 @@ client.checkout.fetch(checkoutId).then((checkout) => {
237
237
238
238
### Adding a Discount
239
239
``` javascript
240
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI= ' ; // ID of an existing checkout
240
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ; // ID of an existing checkout
241
241
const discountCode = ' best-discount-ever' ;
242
242
243
243
// Add a discount code to the checkout
@@ -249,7 +249,7 @@ client.checkout.addDiscount(checkoutId, discountCode).then(checkout => {
249
249
250
250
### Removing a Discount
251
251
``` javascript
252
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI= ' ; // ID of an existing checkout
252
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ; // ID of an existing checkout
253
253
254
254
// Removes the applied discount from an existing checkout.
255
255
client .checkout .removeDiscount (checkoutId).then (checkout => {
@@ -260,7 +260,7 @@ client.checkout.removeDiscount(checkoutId).then(checkout => {
260
260
261
261
### Updating a Shipping Address
262
262
``` javascript
263
- const checkoutId = ' Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI= ' ; // ID of an existing checkout
263
+ const checkoutId = ' gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8 ' ; // ID of an existing checkout
264
264
265
265
const shippingAddress = {
266
266
address1: ' Chestnut Street 92' ,
0 commit comments