Skip to content

Commit a0ef51c

Browse files
authored
Merge pull request #913 from Shopify/update-sfapi-v2022-10
Update SDK to use Storefront API v2022-10
2 parents 78f2bb1 + aab22f4 commit a0ef51c

File tree

65 files changed

+4162
-3028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+4162
-3028
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
### v2.17.0 (October x, 2022)
4+
* Bumps the SDK to use Storefront API version `2022-10`. For more information, see the [Release Notes](https://shopify.dev/api/release-notes/2022-10).
5+
* **NOTABLE API DATA CHANGE:** Storefront API version `2022-10` includes the removal of the `Money` scalar and all fields that had previously returned a [Money](https://shopify.dev/api/storefront/2022-07/scalars/Money) scalar will now return a [MoneyV2](https://shopify.dev/api/storefront/2022-10/objects/MoneyV2) object. Affected fields include:
6+
* AppliedGiftCard fields: `amountUsed`, `balance`
7+
* Checkout fields: `paymentDue`, `totalTax`, `subtotalPrice`, `totalPrice`
8+
* ShippingRate fields: `price`
9+
* Order fields: `subtotalPrice`, `totalShippingPrice`, `totalTax`, `totalPrice`, `totalRefunded`
10+
* ProductVariant fields: `price`, `compareAtPrice`
11+
312
### v2.16.1 (July 5, 2022)
413
* Bumps the SDK to use Storefront API version `2022-07`. For more information, see the [Release Notes](https://shopify.dev/api/release-notes/2022-07).
514
* Alias all instances of `Image.src` to use `Image.url`.

README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ client.product.fetchAll().then((products) => {
124124
});
125125

126126
// Fetch a single product by ID
127-
const productId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ=';
127+
const productId = 'gid://shopify/Product/7857989384';
128128

129129
client.product.fetch(productId).then((product) => {
130130
// Do something with the product
@@ -150,7 +150,7 @@ client.collection.fetchAllWithProducts().then((collections) => {
150150
});
151151

152152
// Fetch a single collection by ID, including its products
153-
const collectionId = 'Z2lkOi8vc2hvcGlmeS9Db2xsZWN0aW9uLzM2OTMxMjU4NA==';
153+
const collectionId = 'gid://shopify/Collection/369312584';
154154
// Set a parameter for first x products, defaults to 20 if you don't provide a param
155155

156156
client.collection.fetchWithProducts(collectionId, {productsFirst: 10}).then((collection) => {
@@ -171,7 +171,7 @@ client.checkout.create().then((checkout) => {
171171

172172
### Updating checkout attributes
173173
```javascript
174-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9DaGVja291dC9kMTZmM2EzMDM4Yjc4N=';
174+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8';
175175
const input = {customAttributes: [{key: "MyKey", value: "MyValue"}]};
176176

177177
client.checkout.updateAttributes(checkoutId, input).then((checkout) => {
@@ -181,10 +181,10 @@ client.checkout.updateAttributes(checkoutId, input).then((checkout) => {
181181

182182
### Adding Line Items
183183
```javascript
184-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI='; // ID of an existing checkout
184+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; // ID of an existing checkout
185185
const lineItemsToAdd = [
186186
{
187-
variantId: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0VmFyaWFudC8yOTEwNjAyMjc5Mg==',
187+
variantId: 'gid://shopify/ProductVariant/29106064584',
188188
quantity: 5,
189189
customAttributes: [{key: "MyKey", value: "MyValue"}]
190190
}
@@ -199,35 +199,35 @@ client.checkout.addLineItems(checkoutId, lineItemsToAdd).then((checkout) => {
199199

200200
### Updating Line Items
201201
```javascript
202-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI='; // ID of an existing checkout
202+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; // ID of an existing checkout
203203
const lineItemsToUpdate = [
204-
{id: 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ=', quantity: 2}
204+
{id: 'gid://shopify/Product/7857989384', quantity: 2}
205205
];
206206

207207
// Update the line item on the checkout (change the quantity or variant)
208208
client.checkout.updateLineItems(checkoutId, lineItemsToUpdate).then((checkout) => {
209209
// 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
211211
});
212212
```
213213

214214
### Removing Line Items
215215
```javascript
216-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI='; // ID of an existing checkout
216+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; // ID of an existing checkout
217217
const lineItemIdsToRemove = [
218-
'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0Lzc4NTc5ODkzODQ='
218+
'gid://shopify/Product/7857989384'
219219
];
220220

221221
// Remove an item from the checkout
222222
client.checkout.removeLineItems(checkoutId, lineItemIdsToRemove).then((checkout) => {
223223
// 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
225225
});
226226
```
227227

228228
### Fetching a Checkout
229229
```javascript
230-
const checkoutId = '2U4NWNkYzI4ZWEyOTdlOD9rZXk9MDVjMzY3Zjk3YWM0YWJjNGRhMTkwMDgwYTUzOGJmYmI='
230+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'
231231

232232
client.checkout.fetch(checkoutId).then((checkout) => {
233233
// Do something with the checkout
@@ -237,7 +237,7 @@ client.checkout.fetch(checkoutId).then((checkout) => {
237237

238238
### Adding a Discount
239239
```javascript
240-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI='; // ID of an existing checkout
240+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; // ID of an existing checkout
241241
const discountCode = 'best-discount-ever';
242242

243243
// Add a discount code to the checkout
@@ -249,7 +249,7 @@ client.checkout.addDiscount(checkoutId, discountCode).then(checkout => {
249249

250250
### Removing a Discount
251251
```javascript
252-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI='; // ID of an existing checkout
252+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; // ID of an existing checkout
253253

254254
// Removes the applied discount from an existing checkout.
255255
client.checkout.removeDiscount(checkoutId).then(checkout => {
@@ -260,7 +260,7 @@ client.checkout.removeDiscount(checkoutId).then(checkout => {
260260

261261
### Updating a Shipping Address
262262
```javascript
263-
const checkoutId = 'Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0SW1hZ2UvMTgyMTc3ODc1OTI='; // ID of an existing checkout
263+
const checkoutId = 'gid://shopify/Checkout/e3bd71f7248c806f33725a53e33931ef?key=47092e448529068d1be52e5051603af8'; // ID of an existing checkout
264264

265265
const shippingAddress = {
266266
address1: 'Chestnut Street 92',

docs/CheckoutResource.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3032,7 +3032,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
30323032
<br class="clear">
30333033

30343034
<footer>
3035-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
3035+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
30363036
</footer>
30373037

30383038
<script> prettyPrint(); </script>

docs/Client.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
627627
<br class="clear">
628628

629629
<footer>
630-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
630+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
631631
</footer>
632632

633633
<script> prettyPrint(); </script>

docs/CollectionResource.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
12781278
<br class="clear">
12791279

12801280
<footer>
1281-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
1281+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
12821282
</footer>
12831283

12841284
<script> prettyPrint(); </script>

docs/Config.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
282282
<br class="clear">
283283

284284
<footer>
285-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
285+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
286286
</footer>
287287

288288
<script> prettyPrint(); </script>

docs/ImageHelpers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
385385
<br class="clear">
386386

387387
<footer>
388-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
388+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
389389
</footer>
390390

391391
<script> prettyPrint(); </script>

docs/ImageResource.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
161161
<br class="clear">
162162

163163
<footer>
164-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
164+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
165165
</footer>
166166

167167
<script> prettyPrint(); </script>

docs/ProductHelpers.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
315315
<br class="clear">
316316

317317
<footer>
318-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
318+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
319319
</footer>
320320

321321
<script> prettyPrint(); </script>

docs/ProductResource.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
13891389
<br class="clear">
13901390

13911391
<footer>
1392-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
1392+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
13931393
</footer>
13941394

13951395
<script> prettyPrint(); </script>

docs/ShopResource.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
406406
<br class="clear">
407407

408408
<footer>
409-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
409+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
410410
</footer>
411411

412412
<script> prettyPrint(); </script>

docs/checkout-resource.js.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
373373
<br class="clear">
374374

375375
<footer>
376-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
376+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
377377
</footer>
378378

379379
<script> prettyPrint(); </script>

docs/client.js.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
144144
<br class="clear">
145145

146146
<footer>
147-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
147+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
148148
</footer>
149149

150150
<script> prettyPrint(); </script>

docs/collection-resource.js.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
172172
<br class="clear">
173173

174174
<footer>
175-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
175+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
176176
</footer>
177177

178178
<script> prettyPrint(); </script>

docs/config.js.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h1 class="page-title">Source: config.js</h1>
8585
if (attrs.hasOwnProperty('apiVersion')) {
8686
this.apiVersion = attrs.apiVersion;
8787
} else {
88-
this.apiVersion = '2022-07';
88+
this.apiVersion = '2022-10';
8989
}
9090

9191
if (attrs.hasOwnProperty('source')) {
@@ -115,7 +115,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
115115
<br class="clear">
116116

117117
<footer>
118-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
118+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
119119
</footer>
120120

121121
<script> prettyPrint(); </script>

docs/image-helpers.js.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
7878
<br class="clear">
7979

8080
<footer>
81-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
81+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
8282
</footer>
8383

8484
<script> prettyPrint(); </script>

docs/image-resource.js.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h2><a href="index.html">Home</a></h2><h3>Namespaces</h3><ul><li><a href="ImageH
5656
<br class="clear">
5757

5858
<footer>
59-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Mon Jul 04 2022 13:51:51 GMT-0400 (Eastern Daylight Time)
59+
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Thu Oct 06 2022 14:19:55 GMT-0400 (Eastern Daylight Time)
6060
</footer>
6161

6262
<script> prettyPrint(); </script>

0 commit comments

Comments
 (0)