shopify_api 13.3.1 → 14.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (627) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +0 -1
  3. data/.rubocop.yml +2 -0
  4. data/CHANGELOG.md +12 -0
  5. data/CODE_OF_CONDUCT.md +46 -0
  6. data/Gemfile.lock +39 -42
  7. data/dev.yml +3 -2
  8. data/docs/usage/graphql.md +30 -1
  9. data/docs/usage/rest.md +81 -13
  10. data/docs/usage/webhooks.md +34 -9
  11. data/lib/shopify_api/admin_versions.rb +2 -1
  12. data/lib/shopify_api/auth/oauth/access_token_response.rb +37 -0
  13. data/lib/shopify_api/auth/oauth.rb +2 -33
  14. data/lib/shopify_api/auth/session.rb +26 -0
  15. data/lib/shopify_api/auth/token_exchange.rb +80 -0
  16. data/lib/shopify_api/clients/graphql/client.rb +1 -0
  17. data/lib/shopify_api/clients/http_client.rb +7 -2
  18. data/lib/shopify_api/clients/http_response.rb +29 -2
  19. data/lib/shopify_api/context.rb +8 -1
  20. data/lib/shopify_api/logger.rb +1 -1
  21. data/lib/shopify_api/rest/base.rb +93 -22
  22. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +7 -3
  23. data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +7 -3
  24. data/lib/shopify_api/rest/resources/2022_04/android_pay_key.rb +7 -3
  25. data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +7 -3
  26. data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +7 -3
  27. data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +7 -3
  28. data/lib/shopify_api/rest/resources/2022_04/article.rb +7 -3
  29. data/lib/shopify_api/rest/resources/2022_04/asset.rb +7 -3
  30. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +12 -6
  31. data/lib/shopify_api/rest/resources/2022_04/balance.rb +6 -3
  32. data/lib/shopify_api/rest/resources/2022_04/blog.rb +7 -3
  33. data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +7 -3
  34. data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +7 -3
  35. data/lib/shopify_api/rest/resources/2022_04/checkout.rb +7 -3
  36. data/lib/shopify_api/rest/resources/2022_04/collect.rb +7 -3
  37. data/lib/shopify_api/rest/resources/2022_04/collection.rb +7 -3
  38. data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +7 -3
  39. data/lib/shopify_api/rest/resources/2022_04/comment.rb +7 -3
  40. data/lib/shopify_api/rest/resources/2022_04/country.rb +7 -3
  41. data/lib/shopify_api/rest/resources/2022_04/currency.rb +7 -3
  42. data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +7 -3
  43. data/lib/shopify_api/rest/resources/2022_04/customer.rb +7 -3
  44. data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +17 -3
  45. data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +7 -3
  46. data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +7 -3
  47. data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +7 -3
  48. data/lib/shopify_api/rest/resources/2022_04/dispute.rb +7 -3
  49. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +7 -3
  50. data/lib/shopify_api/rest/resources/2022_04/event.rb +7 -3
  51. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +7 -3
  52. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +7 -3
  53. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +7 -3
  54. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +17 -3
  55. data/lib/shopify_api/rest/resources/2022_04/fulfillment_service.rb +7 -3
  56. data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +7 -3
  57. data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +7 -3
  58. data/lib/shopify_api/rest/resources/2022_04/image.rb +7 -3
  59. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +7 -3
  60. data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +7 -3
  61. data/lib/shopify_api/rest/resources/2022_04/location.rb +7 -3
  62. data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +7 -3
  63. data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +7 -3
  64. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +7 -3
  65. data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +7 -3
  66. data/lib/shopify_api/rest/resources/2022_04/order.rb +7 -3
  67. data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +12 -6
  68. data/lib/shopify_api/rest/resources/2022_04/page.rb +7 -3
  69. data/lib/shopify_api/rest/resources/2022_04/payment.rb +7 -3
  70. data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +7 -3
  71. data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +7 -3
  72. data/lib/shopify_api/rest/resources/2022_04/payout.rb +7 -3
  73. data/lib/shopify_api/rest/resources/2022_04/policy.rb +7 -3
  74. data/lib/shopify_api/rest/resources/2022_04/price_rule.rb +7 -3
  75. data/lib/shopify_api/rest/resources/2022_04/product.rb +7 -3
  76. data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +7 -3
  77. data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +7 -3
  78. data/lib/shopify_api/rest/resources/2022_04/province.rb +7 -3
  79. data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +7 -3
  80. data/lib/shopify_api/rest/resources/2022_04/redirect.rb +7 -3
  81. data/lib/shopify_api/rest/resources/2022_04/refund.rb +7 -3
  82. data/lib/shopify_api/rest/resources/2022_04/report.rb +7 -3
  83. data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +7 -3
  84. data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +7 -3
  85. data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +7 -3
  86. data/lib/shopify_api/rest/resources/2022_04/shop.rb +7 -3
  87. data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +7 -3
  88. data/lib/shopify_api/rest/resources/2022_04/storefront_access_token.rb +7 -3
  89. data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +7 -3
  90. data/lib/shopify_api/rest/resources/2022_04/theme.rb +7 -3
  91. data/lib/shopify_api/rest/resources/2022_04/transaction.rb +7 -3
  92. data/lib/shopify_api/rest/resources/2022_04/usage_charge.rb +7 -3
  93. data/lib/shopify_api/rest/resources/2022_04/user.rb +7 -3
  94. data/lib/shopify_api/rest/resources/2022_04/variant.rb +7 -3
  95. data/lib/shopify_api/rest/resources/2022_04/webhook.rb +7 -3
  96. data/lib/shopify_api/rest/resources/2022_07/abandoned_checkout.rb +7 -3
  97. data/lib/shopify_api/rest/resources/2022_07/access_scope.rb +7 -3
  98. data/lib/shopify_api/rest/resources/2022_07/android_pay_key.rb +7 -3
  99. data/lib/shopify_api/rest/resources/2022_07/apple_pay_certificate.rb +7 -3
  100. data/lib/shopify_api/rest/resources/2022_07/application_charge.rb +7 -3
  101. data/lib/shopify_api/rest/resources/2022_07/application_credit.rb +7 -3
  102. data/lib/shopify_api/rest/resources/2022_07/article.rb +7 -3
  103. data/lib/shopify_api/rest/resources/2022_07/asset.rb +7 -3
  104. data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +12 -6
  105. data/lib/shopify_api/rest/resources/2022_07/balance.rb +11 -3
  106. data/lib/shopify_api/rest/resources/2022_07/blog.rb +7 -3
  107. data/lib/shopify_api/rest/resources/2022_07/cancellation_request.rb +7 -3
  108. data/lib/shopify_api/rest/resources/2022_07/carrier_service.rb +7 -3
  109. data/lib/shopify_api/rest/resources/2022_07/checkout.rb +7 -3
  110. data/lib/shopify_api/rest/resources/2022_07/collect.rb +7 -3
  111. data/lib/shopify_api/rest/resources/2022_07/collection.rb +7 -3
  112. data/lib/shopify_api/rest/resources/2022_07/collection_listing.rb +7 -3
  113. data/lib/shopify_api/rest/resources/2022_07/comment.rb +7 -3
  114. data/lib/shopify_api/rest/resources/2022_07/country.rb +7 -3
  115. data/lib/shopify_api/rest/resources/2022_07/currency.rb +7 -3
  116. data/lib/shopify_api/rest/resources/2022_07/custom_collection.rb +7 -3
  117. data/lib/shopify_api/rest/resources/2022_07/customer.rb +7 -3
  118. data/lib/shopify_api/rest/resources/2022_07/customer_address.rb +17 -3
  119. data/lib/shopify_api/rest/resources/2022_07/deprecated_api_call.rb +7 -3
  120. data/lib/shopify_api/rest/resources/2022_07/discount_code.rb +7 -3
  121. data/lib/shopify_api/rest/resources/2022_07/dispute.rb +7 -3
  122. data/lib/shopify_api/rest/resources/2022_07/dispute_evidence.rb +7 -3
  123. data/lib/shopify_api/rest/resources/2022_07/dispute_file_upload.rb +7 -3
  124. data/lib/shopify_api/rest/resources/2022_07/draft_order.rb +7 -3
  125. data/lib/shopify_api/rest/resources/2022_07/event.rb +7 -3
  126. data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +7 -3
  127. data/lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb +7 -3
  128. data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +7 -3
  129. data/lib/shopify_api/rest/resources/2022_07/fulfillment_request.rb +17 -3
  130. data/lib/shopify_api/rest/resources/2022_07/fulfillment_service.rb +7 -3
  131. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +7 -3
  132. data/lib/shopify_api/rest/resources/2022_07/gift_card_adjustment.rb +7 -3
  133. data/lib/shopify_api/rest/resources/2022_07/image.rb +7 -3
  134. data/lib/shopify_api/rest/resources/2022_07/inventory_item.rb +7 -3
  135. data/lib/shopify_api/rest/resources/2022_07/inventory_level.rb +7 -3
  136. data/lib/shopify_api/rest/resources/2022_07/location.rb +7 -3
  137. data/lib/shopify_api/rest/resources/2022_07/locations_for_move.rb +7 -3
  138. data/lib/shopify_api/rest/resources/2022_07/marketing_event.rb +7 -3
  139. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +7 -3
  140. data/lib/shopify_api/rest/resources/2022_07/mobile_platform_application.rb +7 -3
  141. data/lib/shopify_api/rest/resources/2022_07/order.rb +10 -3
  142. data/lib/shopify_api/rest/resources/2022_07/order_risk.rb +12 -6
  143. data/lib/shopify_api/rest/resources/2022_07/page.rb +7 -3
  144. data/lib/shopify_api/rest/resources/2022_07/payment.rb +7 -3
  145. data/lib/shopify_api/rest/resources/2022_07/payment_gateway.rb +7 -3
  146. data/lib/shopify_api/rest/resources/2022_07/payment_transaction.rb +7 -3
  147. data/lib/shopify_api/rest/resources/2022_07/payout.rb +7 -3
  148. data/lib/shopify_api/rest/resources/2022_07/policy.rb +7 -3
  149. data/lib/shopify_api/rest/resources/2022_07/price_rule.rb +7 -3
  150. data/lib/shopify_api/rest/resources/2022_07/product.rb +7 -3
  151. data/lib/shopify_api/rest/resources/2022_07/product_listing.rb +7 -3
  152. data/lib/shopify_api/rest/resources/2022_07/product_resource_feedback.rb +7 -3
  153. data/lib/shopify_api/rest/resources/2022_07/province.rb +7 -3
  154. data/lib/shopify_api/rest/resources/2022_07/recurring_application_charge.rb +7 -3
  155. data/lib/shopify_api/rest/resources/2022_07/redirect.rb +7 -3
  156. data/lib/shopify_api/rest/resources/2022_07/refund.rb +7 -3
  157. data/lib/shopify_api/rest/resources/2022_07/report.rb +7 -3
  158. data/lib/shopify_api/rest/resources/2022_07/resource_feedback.rb +7 -3
  159. data/lib/shopify_api/rest/resources/2022_07/script_tag.rb +7 -3
  160. data/lib/shopify_api/rest/resources/2022_07/shipping_zone.rb +7 -3
  161. data/lib/shopify_api/rest/resources/2022_07/shop.rb +7 -3
  162. data/lib/shopify_api/rest/resources/2022_07/smart_collection.rb +7 -3
  163. data/lib/shopify_api/rest/resources/2022_07/storefront_access_token.rb +7 -3
  164. data/lib/shopify_api/rest/resources/2022_07/tender_transaction.rb +7 -3
  165. data/lib/shopify_api/rest/resources/2022_07/theme.rb +7 -3
  166. data/lib/shopify_api/rest/resources/2022_07/transaction.rb +7 -3
  167. data/lib/shopify_api/rest/resources/2022_07/usage_charge.rb +7 -3
  168. data/lib/shopify_api/rest/resources/2022_07/user.rb +7 -3
  169. data/lib/shopify_api/rest/resources/2022_07/variant.rb +7 -3
  170. data/lib/shopify_api/rest/resources/2022_07/webhook.rb +7 -3
  171. data/lib/shopify_api/rest/resources/2022_10/abandoned_checkout.rb +7 -3
  172. data/lib/shopify_api/rest/resources/2022_10/access_scope.rb +7 -3
  173. data/lib/shopify_api/rest/resources/2022_10/android_pay_key.rb +7 -3
  174. data/lib/shopify_api/rest/resources/2022_10/apple_pay_certificate.rb +7 -3
  175. data/lib/shopify_api/rest/resources/2022_10/application_charge.rb +7 -3
  176. data/lib/shopify_api/rest/resources/2022_10/application_credit.rb +7 -3
  177. data/lib/shopify_api/rest/resources/2022_10/article.rb +7 -3
  178. data/lib/shopify_api/rest/resources/2022_10/asset.rb +7 -3
  179. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +7 -3
  180. data/lib/shopify_api/rest/resources/2022_10/balance.rb +11 -3
  181. data/lib/shopify_api/rest/resources/2022_10/blog.rb +7 -3
  182. data/lib/shopify_api/rest/resources/2022_10/cancellation_request.rb +7 -3
  183. data/lib/shopify_api/rest/resources/2022_10/carrier_service.rb +7 -3
  184. data/lib/shopify_api/rest/resources/2022_10/checkout.rb +7 -3
  185. data/lib/shopify_api/rest/resources/2022_10/collect.rb +7 -3
  186. data/lib/shopify_api/rest/resources/2022_10/collection.rb +7 -3
  187. data/lib/shopify_api/rest/resources/2022_10/collection_listing.rb +7 -3
  188. data/lib/shopify_api/rest/resources/2022_10/comment.rb +7 -3
  189. data/lib/shopify_api/rest/resources/2022_10/country.rb +7 -3
  190. data/lib/shopify_api/rest/resources/2022_10/currency.rb +7 -3
  191. data/lib/shopify_api/rest/resources/2022_10/custom_collection.rb +7 -3
  192. data/lib/shopify_api/rest/resources/2022_10/customer.rb +7 -3
  193. data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +7 -3
  194. data/lib/shopify_api/rest/resources/2022_10/deprecated_api_call.rb +7 -3
  195. data/lib/shopify_api/rest/resources/2022_10/discount_code.rb +7 -3
  196. data/lib/shopify_api/rest/resources/2022_10/dispute.rb +7 -3
  197. data/lib/shopify_api/rest/resources/2022_10/dispute_evidence.rb +7 -3
  198. data/lib/shopify_api/rest/resources/2022_10/dispute_file_upload.rb +7 -3
  199. data/lib/shopify_api/rest/resources/2022_10/draft_order.rb +7 -3
  200. data/lib/shopify_api/rest/resources/2022_10/event.rb +7 -3
  201. data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +7 -3
  202. data/lib/shopify_api/rest/resources/2022_10/fulfillment_event.rb +7 -3
  203. data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +7 -3
  204. data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +7 -3
  205. data/lib/shopify_api/rest/resources/2022_10/fulfillment_service.rb +7 -3
  206. data/lib/shopify_api/rest/resources/2022_10/gift_card.rb +7 -3
  207. data/lib/shopify_api/rest/resources/2022_10/gift_card_adjustment.rb +7 -3
  208. data/lib/shopify_api/rest/resources/2022_10/image.rb +7 -3
  209. data/lib/shopify_api/rest/resources/2022_10/inventory_item.rb +7 -3
  210. data/lib/shopify_api/rest/resources/2022_10/inventory_level.rb +7 -3
  211. data/lib/shopify_api/rest/resources/2022_10/location.rb +7 -3
  212. data/lib/shopify_api/rest/resources/2022_10/locations_for_move.rb +7 -3
  213. data/lib/shopify_api/rest/resources/2022_10/marketing_event.rb +7 -3
  214. data/lib/shopify_api/rest/resources/2022_10/metafield.rb +7 -3
  215. data/lib/shopify_api/rest/resources/2022_10/mobile_platform_application.rb +7 -3
  216. data/lib/shopify_api/rest/resources/2022_10/order.rb +10 -3
  217. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +7 -3
  218. data/lib/shopify_api/rest/resources/2022_10/page.rb +7 -3
  219. data/lib/shopify_api/rest/resources/2022_10/payment.rb +7 -3
  220. data/lib/shopify_api/rest/resources/2022_10/payment_gateway.rb +7 -3
  221. data/lib/shopify_api/rest/resources/2022_10/payment_transaction.rb +7 -3
  222. data/lib/shopify_api/rest/resources/2022_10/payout.rb +7 -3
  223. data/lib/shopify_api/rest/resources/2022_10/policy.rb +7 -3
  224. data/lib/shopify_api/rest/resources/2022_10/price_rule.rb +7 -3
  225. data/lib/shopify_api/rest/resources/2022_10/product.rb +7 -3
  226. data/lib/shopify_api/rest/resources/2022_10/product_listing.rb +7 -3
  227. data/lib/shopify_api/rest/resources/2022_10/product_resource_feedback.rb +7 -3
  228. data/lib/shopify_api/rest/resources/2022_10/province.rb +7 -3
  229. data/lib/shopify_api/rest/resources/2022_10/recurring_application_charge.rb +7 -3
  230. data/lib/shopify_api/rest/resources/2022_10/redirect.rb +7 -3
  231. data/lib/shopify_api/rest/resources/2022_10/refund.rb +7 -3
  232. data/lib/shopify_api/rest/resources/2022_10/report.rb +7 -3
  233. data/lib/shopify_api/rest/resources/2022_10/resource_feedback.rb +7 -3
  234. data/lib/shopify_api/rest/resources/2022_10/script_tag.rb +7 -3
  235. data/lib/shopify_api/rest/resources/2022_10/shipping_zone.rb +7 -3
  236. data/lib/shopify_api/rest/resources/2022_10/shop.rb +7 -6
  237. data/lib/shopify_api/rest/resources/2022_10/smart_collection.rb +7 -3
  238. data/lib/shopify_api/rest/resources/2022_10/storefront_access_token.rb +7 -3
  239. data/lib/shopify_api/rest/resources/2022_10/tender_transaction.rb +7 -3
  240. data/lib/shopify_api/rest/resources/2022_10/theme.rb +7 -3
  241. data/lib/shopify_api/rest/resources/2022_10/transaction.rb +7 -3
  242. data/lib/shopify_api/rest/resources/2022_10/usage_charge.rb +7 -3
  243. data/lib/shopify_api/rest/resources/2022_10/user.rb +7 -3
  244. data/lib/shopify_api/rest/resources/2022_10/variant.rb +8 -8
  245. data/lib/shopify_api/rest/resources/2022_10/webhook.rb +7 -3
  246. data/lib/shopify_api/rest/resources/2023_01/abandoned_checkout.rb +7 -3
  247. data/lib/shopify_api/rest/resources/2023_01/access_scope.rb +7 -3
  248. data/lib/shopify_api/rest/resources/2023_01/apple_pay_certificate.rb +7 -3
  249. data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +7 -3
  250. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +7 -3
  251. data/lib/shopify_api/rest/resources/2023_01/article.rb +7 -3
  252. data/lib/shopify_api/rest/resources/2023_01/asset.rb +7 -3
  253. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +7 -3
  254. data/lib/shopify_api/rest/resources/2023_01/balance.rb +7 -3
  255. data/lib/shopify_api/rest/resources/2023_01/blog.rb +7 -3
  256. data/lib/shopify_api/rest/resources/2023_01/cancellation_request.rb +7 -3
  257. data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +7 -3
  258. data/lib/shopify_api/rest/resources/2023_01/checkout.rb +7 -3
  259. data/lib/shopify_api/rest/resources/2023_01/collect.rb +7 -3
  260. data/lib/shopify_api/rest/resources/2023_01/collection.rb +7 -3
  261. data/lib/shopify_api/rest/resources/2023_01/collection_listing.rb +7 -3
  262. data/lib/shopify_api/rest/resources/2023_01/comment.rb +7 -3
  263. data/lib/shopify_api/rest/resources/2023_01/country.rb +7 -3
  264. data/lib/shopify_api/rest/resources/2023_01/currency.rb +7 -3
  265. data/lib/shopify_api/rest/resources/2023_01/custom_collection.rb +7 -3
  266. data/lib/shopify_api/rest/resources/2023_01/customer.rb +7 -3
  267. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +7 -3
  268. data/lib/shopify_api/rest/resources/2023_01/customer_saved_search.rb +7 -3
  269. data/lib/shopify_api/rest/resources/2023_01/deprecated_api_call.rb +7 -3
  270. data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +7 -3
  271. data/lib/shopify_api/rest/resources/2023_01/dispute.rb +7 -3
  272. data/lib/shopify_api/rest/resources/2023_01/dispute_evidence.rb +7 -3
  273. data/lib/shopify_api/rest/resources/2023_01/dispute_file_upload.rb +7 -3
  274. data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +7 -3
  275. data/lib/shopify_api/rest/resources/2023_01/event.rb +7 -3
  276. data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +7 -3
  277. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +7 -3
  278. data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +12 -6
  279. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +7 -3
  280. data/lib/shopify_api/rest/resources/2023_01/fulfillment_service.rb +7 -3
  281. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +7 -3
  282. data/lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb +7 -3
  283. data/lib/shopify_api/rest/resources/2023_01/image.rb +7 -3
  284. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +7 -3
  285. data/lib/shopify_api/rest/resources/2023_01/inventory_level.rb +7 -3
  286. data/lib/shopify_api/rest/resources/2023_01/location.rb +7 -3
  287. data/lib/shopify_api/rest/resources/2023_01/locations_for_move.rb +7 -3
  288. data/lib/shopify_api/rest/resources/2023_01/marketing_event.rb +7 -3
  289. data/lib/shopify_api/rest/resources/2023_01/metafield.rb +7 -3
  290. data/lib/shopify_api/rest/resources/2023_01/mobile_platform_application.rb +7 -3
  291. data/lib/shopify_api/rest/resources/2023_01/order.rb +7 -3
  292. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +7 -3
  293. data/lib/shopify_api/rest/resources/2023_01/page.rb +7 -3
  294. data/lib/shopify_api/rest/resources/2023_01/payment.rb +7 -3
  295. data/lib/shopify_api/rest/resources/2023_01/payment_gateway.rb +7 -3
  296. data/lib/shopify_api/rest/resources/2023_01/payment_transaction.rb +12 -5
  297. data/lib/shopify_api/rest/resources/2023_01/payout.rb +7 -3
  298. data/lib/shopify_api/rest/resources/2023_01/policy.rb +7 -3
  299. data/lib/shopify_api/rest/resources/2023_01/price_rule.rb +7 -3
  300. data/lib/shopify_api/rest/resources/2023_01/product.rb +7 -3
  301. data/lib/shopify_api/rest/resources/2023_01/product_listing.rb +7 -3
  302. data/lib/shopify_api/rest/resources/2023_01/product_resource_feedback.rb +7 -3
  303. data/lib/shopify_api/rest/resources/2023_01/province.rb +7 -3
  304. data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +7 -3
  305. data/lib/shopify_api/rest/resources/2023_01/redirect.rb +7 -3
  306. data/lib/shopify_api/rest/resources/2023_01/refund.rb +7 -3
  307. data/lib/shopify_api/rest/resources/2023_01/report.rb +7 -3
  308. data/lib/shopify_api/rest/resources/2023_01/resource_feedback.rb +7 -3
  309. data/lib/shopify_api/rest/resources/2023_01/script_tag.rb +7 -3
  310. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +7 -3
  311. data/lib/shopify_api/rest/resources/2023_01/shop.rb +7 -3
  312. data/lib/shopify_api/rest/resources/2023_01/smart_collection.rb +7 -3
  313. data/lib/shopify_api/rest/resources/2023_01/storefront_access_token.rb +7 -3
  314. data/lib/shopify_api/rest/resources/2023_01/tender_transaction.rb +7 -3
  315. data/lib/shopify_api/rest/resources/2023_01/theme.rb +7 -3
  316. data/lib/shopify_api/rest/resources/2023_01/transaction.rb +7 -3
  317. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +7 -3
  318. data/lib/shopify_api/rest/resources/2023_01/user.rb +7 -3
  319. data/lib/shopify_api/rest/resources/2023_01/variant.rb +7 -3
  320. data/lib/shopify_api/rest/resources/2023_01/webhook.rb +7 -3
  321. data/lib/shopify_api/rest/resources/2023_04/abandoned_checkout.rb +7 -3
  322. data/lib/shopify_api/rest/resources/2023_04/access_scope.rb +7 -3
  323. data/lib/shopify_api/rest/resources/2023_04/apple_pay_certificate.rb +7 -3
  324. data/lib/shopify_api/rest/resources/2023_04/application_charge.rb +7 -3
  325. data/lib/shopify_api/rest/resources/2023_04/application_credit.rb +7 -3
  326. data/lib/shopify_api/rest/resources/2023_04/article.rb +7 -3
  327. data/lib/shopify_api/rest/resources/2023_04/asset.rb +7 -3
  328. data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +7 -3
  329. data/lib/shopify_api/rest/resources/2023_04/balance.rb +7 -3
  330. data/lib/shopify_api/rest/resources/2023_04/blog.rb +7 -3
  331. data/lib/shopify_api/rest/resources/2023_04/cancellation_request.rb +7 -3
  332. data/lib/shopify_api/rest/resources/2023_04/carrier_service.rb +7 -3
  333. data/lib/shopify_api/rest/resources/2023_04/checkout.rb +7 -3
  334. data/lib/shopify_api/rest/resources/2023_04/collect.rb +7 -3
  335. data/lib/shopify_api/rest/resources/2023_04/collection.rb +7 -3
  336. data/lib/shopify_api/rest/resources/2023_04/collection_listing.rb +7 -3
  337. data/lib/shopify_api/rest/resources/2023_04/comment.rb +7 -3
  338. data/lib/shopify_api/rest/resources/2023_04/country.rb +7 -3
  339. data/lib/shopify_api/rest/resources/2023_04/currency.rb +7 -3
  340. data/lib/shopify_api/rest/resources/2023_04/custom_collection.rb +7 -3
  341. data/lib/shopify_api/rest/resources/2023_04/customer.rb +7 -3
  342. data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +7 -3
  343. data/lib/shopify_api/rest/resources/2023_04/customer_saved_search.rb +7 -3
  344. data/lib/shopify_api/rest/resources/2023_04/deprecated_api_call.rb +7 -3
  345. data/lib/shopify_api/rest/resources/2023_04/discount_code.rb +7 -3
  346. data/lib/shopify_api/rest/resources/2023_04/dispute.rb +7 -3
  347. data/lib/shopify_api/rest/resources/2023_04/dispute_evidence.rb +7 -3
  348. data/lib/shopify_api/rest/resources/2023_04/dispute_file_upload.rb +7 -3
  349. data/lib/shopify_api/rest/resources/2023_04/draft_order.rb +7 -3
  350. data/lib/shopify_api/rest/resources/2023_04/event.rb +7 -3
  351. data/lib/shopify_api/rest/resources/2023_04/fulfillment.rb +7 -3
  352. data/lib/shopify_api/rest/resources/2023_04/fulfillment_event.rb +7 -3
  353. data/lib/shopify_api/rest/resources/2023_04/fulfillment_order.rb +12 -6
  354. data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +7 -3
  355. data/lib/shopify_api/rest/resources/2023_04/fulfillment_service.rb +7 -3
  356. data/lib/shopify_api/rest/resources/2023_04/gift_card.rb +7 -3
  357. data/lib/shopify_api/rest/resources/2023_04/gift_card_adjustment.rb +7 -3
  358. data/lib/shopify_api/rest/resources/2023_04/image.rb +7 -3
  359. data/lib/shopify_api/rest/resources/2023_04/inventory_item.rb +7 -3
  360. data/lib/shopify_api/rest/resources/2023_04/inventory_level.rb +7 -3
  361. data/lib/shopify_api/rest/resources/2023_04/location.rb +7 -3
  362. data/lib/shopify_api/rest/resources/2023_04/locations_for_move.rb +7 -3
  363. data/lib/shopify_api/rest/resources/2023_04/marketing_event.rb +7 -3
  364. data/lib/shopify_api/rest/resources/2023_04/metafield.rb +7 -3
  365. data/lib/shopify_api/rest/resources/2023_04/mobile_platform_application.rb +7 -3
  366. data/lib/shopify_api/rest/resources/2023_04/order.rb +7 -9
  367. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +7 -3
  368. data/lib/shopify_api/rest/resources/2023_04/page.rb +7 -3
  369. data/lib/shopify_api/rest/resources/2023_04/payment.rb +7 -3
  370. data/lib/shopify_api/rest/resources/2023_04/payment_gateway.rb +7 -3
  371. data/lib/shopify_api/rest/resources/2023_04/payment_transaction.rb +12 -5
  372. data/lib/shopify_api/rest/resources/2023_04/payout.rb +7 -3
  373. data/lib/shopify_api/rest/resources/2023_04/policy.rb +7 -3
  374. data/lib/shopify_api/rest/resources/2023_04/price_rule.rb +7 -3
  375. data/lib/shopify_api/rest/resources/2023_04/product.rb +7 -3
  376. data/lib/shopify_api/rest/resources/2023_04/product_listing.rb +7 -3
  377. data/lib/shopify_api/rest/resources/2023_04/product_resource_feedback.rb +7 -3
  378. data/lib/shopify_api/rest/resources/2023_04/province.rb +7 -3
  379. data/lib/shopify_api/rest/resources/2023_04/recurring_application_charge.rb +7 -3
  380. data/lib/shopify_api/rest/resources/2023_04/redirect.rb +7 -3
  381. data/lib/shopify_api/rest/resources/2023_04/refund.rb +7 -3
  382. data/lib/shopify_api/rest/resources/2023_04/report.rb +7 -3
  383. data/lib/shopify_api/rest/resources/2023_04/resource_feedback.rb +7 -3
  384. data/lib/shopify_api/rest/resources/2023_04/script_tag.rb +7 -3
  385. data/lib/shopify_api/rest/resources/2023_04/shipping_zone.rb +7 -3
  386. data/lib/shopify_api/rest/resources/2023_04/shop.rb +7 -3
  387. data/lib/shopify_api/rest/resources/2023_04/smart_collection.rb +7 -3
  388. data/lib/shopify_api/rest/resources/2023_04/storefront_access_token.rb +7 -3
  389. data/lib/shopify_api/rest/resources/2023_04/tender_transaction.rb +7 -3
  390. data/lib/shopify_api/rest/resources/2023_04/theme.rb +7 -3
  391. data/lib/shopify_api/rest/resources/2023_04/transaction.rb +7 -3
  392. data/lib/shopify_api/rest/resources/2023_04/usage_charge.rb +7 -3
  393. data/lib/shopify_api/rest/resources/2023_04/user.rb +7 -3
  394. data/lib/shopify_api/rest/resources/2023_04/variant.rb +7 -3
  395. data/lib/shopify_api/rest/resources/2023_04/webhook.rb +7 -3
  396. data/lib/shopify_api/rest/resources/2023_07/abandoned_checkout.rb +7 -3
  397. data/lib/shopify_api/rest/resources/2023_07/access_scope.rb +7 -3
  398. data/lib/shopify_api/rest/resources/2023_07/apple_pay_certificate.rb +7 -3
  399. data/lib/shopify_api/rest/resources/2023_07/application_charge.rb +7 -3
  400. data/lib/shopify_api/rest/resources/2023_07/application_credit.rb +7 -3
  401. data/lib/shopify_api/rest/resources/2023_07/article.rb +7 -3
  402. data/lib/shopify_api/rest/resources/2023_07/asset.rb +7 -3
  403. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +7 -3
  404. data/lib/shopify_api/rest/resources/2023_07/balance.rb +7 -3
  405. data/lib/shopify_api/rest/resources/2023_07/blog.rb +7 -3
  406. data/lib/shopify_api/rest/resources/2023_07/cancellation_request.rb +7 -3
  407. data/lib/shopify_api/rest/resources/2023_07/carrier_service.rb +7 -3
  408. data/lib/shopify_api/rest/resources/2023_07/checkout.rb +7 -3
  409. data/lib/shopify_api/rest/resources/2023_07/collect.rb +7 -3
  410. data/lib/shopify_api/rest/resources/2023_07/collection.rb +7 -3
  411. data/lib/shopify_api/rest/resources/2023_07/collection_listing.rb +7 -3
  412. data/lib/shopify_api/rest/resources/2023_07/comment.rb +7 -3
  413. data/lib/shopify_api/rest/resources/2023_07/country.rb +7 -3
  414. data/lib/shopify_api/rest/resources/2023_07/currency.rb +7 -3
  415. data/lib/shopify_api/rest/resources/2023_07/custom_collection.rb +7 -3
  416. data/lib/shopify_api/rest/resources/2023_07/customer.rb +7 -3
  417. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +7 -3
  418. data/lib/shopify_api/rest/resources/2023_07/customer_saved_search.rb +7 -3
  419. data/lib/shopify_api/rest/resources/2023_07/deprecated_api_call.rb +7 -3
  420. data/lib/shopify_api/rest/resources/2023_07/discount_code.rb +7 -3
  421. data/lib/shopify_api/rest/resources/2023_07/dispute.rb +7 -3
  422. data/lib/shopify_api/rest/resources/2023_07/dispute_evidence.rb +7 -3
  423. data/lib/shopify_api/rest/resources/2023_07/dispute_file_upload.rb +7 -3
  424. data/lib/shopify_api/rest/resources/2023_07/draft_order.rb +7 -3
  425. data/lib/shopify_api/rest/resources/2023_07/event.rb +7 -3
  426. data/lib/shopify_api/rest/resources/2023_07/fulfillment.rb +7 -3
  427. data/lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb +7 -3
  428. data/lib/shopify_api/rest/resources/2023_07/fulfillment_order.rb +12 -6
  429. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +7 -3
  430. data/lib/shopify_api/rest/resources/2023_07/fulfillment_service.rb +7 -3
  431. data/lib/shopify_api/rest/resources/2023_07/gift_card.rb +7 -3
  432. data/lib/shopify_api/rest/resources/2023_07/gift_card_adjustment.rb +7 -3
  433. data/lib/shopify_api/rest/resources/2023_07/image.rb +7 -3
  434. data/lib/shopify_api/rest/resources/2023_07/inventory_item.rb +7 -3
  435. data/lib/shopify_api/rest/resources/2023_07/inventory_level.rb +7 -3
  436. data/lib/shopify_api/rest/resources/2023_07/location.rb +7 -3
  437. data/lib/shopify_api/rest/resources/2023_07/locations_for_move.rb +7 -3
  438. data/lib/shopify_api/rest/resources/2023_07/marketing_event.rb +7 -3
  439. data/lib/shopify_api/rest/resources/2023_07/metafield.rb +7 -3
  440. data/lib/shopify_api/rest/resources/2023_07/mobile_platform_application.rb +7 -3
  441. data/lib/shopify_api/rest/resources/2023_07/order.rb +7 -9
  442. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +7 -3
  443. data/lib/shopify_api/rest/resources/2023_07/page.rb +7 -3
  444. data/lib/shopify_api/rest/resources/2023_07/payment.rb +7 -3
  445. data/lib/shopify_api/rest/resources/2023_07/payment_gateway.rb +7 -3
  446. data/lib/shopify_api/rest/resources/2023_07/payment_transaction.rb +12 -5
  447. data/lib/shopify_api/rest/resources/2023_07/payout.rb +7 -3
  448. data/lib/shopify_api/rest/resources/2023_07/policy.rb +7 -3
  449. data/lib/shopify_api/rest/resources/2023_07/price_rule.rb +7 -3
  450. data/lib/shopify_api/rest/resources/2023_07/product.rb +7 -3
  451. data/lib/shopify_api/rest/resources/2023_07/product_listing.rb +7 -3
  452. data/lib/shopify_api/rest/resources/2023_07/product_resource_feedback.rb +7 -3
  453. data/lib/shopify_api/rest/resources/2023_07/province.rb +7 -3
  454. data/lib/shopify_api/rest/resources/2023_07/recurring_application_charge.rb +7 -3
  455. data/lib/shopify_api/rest/resources/2023_07/redirect.rb +7 -3
  456. data/lib/shopify_api/rest/resources/2023_07/refund.rb +7 -3
  457. data/lib/shopify_api/rest/resources/2023_07/report.rb +7 -3
  458. data/lib/shopify_api/rest/resources/2023_07/resource_feedback.rb +7 -3
  459. data/lib/shopify_api/rest/resources/2023_07/script_tag.rb +7 -3
  460. data/lib/shopify_api/rest/resources/2023_07/shipping_zone.rb +7 -3
  461. data/lib/shopify_api/rest/resources/2023_07/shop.rb +7 -3
  462. data/lib/shopify_api/rest/resources/2023_07/smart_collection.rb +7 -3
  463. data/lib/shopify_api/rest/resources/2023_07/storefront_access_token.rb +7 -3
  464. data/lib/shopify_api/rest/resources/2023_07/tender_transaction.rb +7 -3
  465. data/lib/shopify_api/rest/resources/2023_07/theme.rb +7 -3
  466. data/lib/shopify_api/rest/resources/2023_07/transaction.rb +7 -3
  467. data/lib/shopify_api/rest/resources/2023_07/usage_charge.rb +7 -3
  468. data/lib/shopify_api/rest/resources/2023_07/user.rb +7 -3
  469. data/lib/shopify_api/rest/resources/2023_07/variant.rb +7 -3
  470. data/lib/shopify_api/rest/resources/2023_07/webhook.rb +7 -3
  471. data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +7 -3
  472. data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +7 -3
  473. data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +7 -3
  474. data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +7 -3
  475. data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +7 -3
  476. data/lib/shopify_api/rest/resources/2023_10/article.rb +7 -3
  477. data/lib/shopify_api/rest/resources/2023_10/asset.rb +7 -3
  478. data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +7 -3
  479. data/lib/shopify_api/rest/resources/2023_10/balance.rb +7 -3
  480. data/lib/shopify_api/rest/resources/2023_10/blog.rb +7 -3
  481. data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +7 -3
  482. data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +7 -3
  483. data/lib/shopify_api/rest/resources/2023_10/checkout.rb +7 -3
  484. data/lib/shopify_api/rest/resources/2023_10/collect.rb +7 -3
  485. data/lib/shopify_api/rest/resources/2023_10/collection.rb +7 -3
  486. data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +7 -3
  487. data/lib/shopify_api/rest/resources/2023_10/comment.rb +7 -3
  488. data/lib/shopify_api/rest/resources/2023_10/country.rb +7 -3
  489. data/lib/shopify_api/rest/resources/2023_10/currency.rb +7 -3
  490. data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +7 -3
  491. data/lib/shopify_api/rest/resources/2023_10/customer.rb +7 -3
  492. data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +7 -3
  493. data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +7 -3
  494. data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +7 -3
  495. data/lib/shopify_api/rest/resources/2023_10/dispute.rb +7 -3
  496. data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +7 -3
  497. data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +7 -3
  498. data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +7 -3
  499. data/lib/shopify_api/rest/resources/2023_10/event.rb +7 -3
  500. data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +7 -3
  501. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +7 -3
  502. data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +12 -6
  503. data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +7 -3
  504. data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +7 -3
  505. data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +7 -3
  506. data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +7 -3
  507. data/lib/shopify_api/rest/resources/2023_10/image.rb +7 -3
  508. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +7 -3
  509. data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +7 -3
  510. data/lib/shopify_api/rest/resources/2023_10/location.rb +7 -3
  511. data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +7 -3
  512. data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +7 -3
  513. data/lib/shopify_api/rest/resources/2023_10/metafield.rb +7 -3
  514. data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +7 -3
  515. data/lib/shopify_api/rest/resources/2023_10/order.rb +7 -9
  516. data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +7 -3
  517. data/lib/shopify_api/rest/resources/2023_10/page.rb +7 -3
  518. data/lib/shopify_api/rest/resources/2023_10/payment.rb +7 -3
  519. data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +7 -3
  520. data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +12 -5
  521. data/lib/shopify_api/rest/resources/2023_10/payout.rb +7 -3
  522. data/lib/shopify_api/rest/resources/2023_10/policy.rb +7 -3
  523. data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +7 -3
  524. data/lib/shopify_api/rest/resources/2023_10/product.rb +7 -3
  525. data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +7 -3
  526. data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +7 -3
  527. data/lib/shopify_api/rest/resources/2023_10/province.rb +7 -3
  528. data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +7 -3
  529. data/lib/shopify_api/rest/resources/2023_10/redirect.rb +7 -3
  530. data/lib/shopify_api/rest/resources/2023_10/refund.rb +7 -3
  531. data/lib/shopify_api/rest/resources/2023_10/report.rb +7 -3
  532. data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +7 -3
  533. data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +7 -3
  534. data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +7 -3
  535. data/lib/shopify_api/rest/resources/2023_10/shop.rb +7 -3
  536. data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +7 -3
  537. data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +7 -3
  538. data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +7 -3
  539. data/lib/shopify_api/rest/resources/2023_10/theme.rb +7 -3
  540. data/lib/shopify_api/rest/resources/2023_10/transaction.rb +7 -3
  541. data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +7 -3
  542. data/lib/shopify_api/rest/resources/2023_10/user.rb +7 -3
  543. data/lib/shopify_api/rest/resources/2023_10/variant.rb +7 -3
  544. data/lib/shopify_api/rest/resources/2023_10/webhook.rb +7 -3
  545. data/lib/shopify_api/rest/resources/2024_01/abandoned_checkout.rb +194 -0
  546. data/lib/shopify_api/rest/resources/2024_01/access_scope.rb +62 -0
  547. data/lib/shopify_api/rest/resources/2024_01/apple_pay_certificate.rb +109 -0
  548. data/lib/shopify_api/rest/resources/2024_01/application_charge.rb +113 -0
  549. data/lib/shopify_api/rest/resources/2024_01/application_credit.rb +95 -0
  550. data/lib/shopify_api/rest/resources/2024_01/article.rb +269 -0
  551. data/lib/shopify_api/rest/resources/2024_01/asset.rb +122 -0
  552. data/lib/shopify_api/rest/resources/2024_01/assigned_fulfillment_order.rb +92 -0
  553. data/lib/shopify_api/rest/resources/2024_01/balance.rb +58 -0
  554. data/lib/shopify_api/rest/resources/2024_01/blog.rb +166 -0
  555. data/lib/shopify_api/rest/resources/2024_01/cancellation_request.rb +87 -0
  556. data/lib/shopify_api/rest/resources/2024_01/carrier_service.rb +120 -0
  557. data/lib/shopify_api/rest/resources/2024_01/checkout.rb +213 -0
  558. data/lib/shopify_api/rest/resources/{2022_07/customer_saved_search.rb → 2024_01/collect.rb} +29 -52
  559. data/lib/shopify_api/rest/resources/2024_01/collection.rb +114 -0
  560. data/lib/shopify_api/rest/resources/2024_01/collection_listing.rb +159 -0
  561. data/lib/shopify_api/rest/resources/2024_01/comment.rb +287 -0
  562. data/lib/shopify_api/rest/resources/2024_01/country.rb +141 -0
  563. data/lib/shopify_api/rest/resources/2024_01/currency.rb +61 -0
  564. data/lib/shopify_api/rest/resources/2024_01/custom_collection.rb +191 -0
  565. data/lib/shopify_api/rest/resources/2024_01/customer.rb +333 -0
  566. data/lib/shopify_api/rest/resources/2024_01/customer_address.rb +215 -0
  567. data/lib/shopify_api/rest/resources/2024_01/deprecated_api_call.rb +61 -0
  568. data/lib/shopify_api/rest/resources/2024_01/discount_code.rb +226 -0
  569. data/lib/shopify_api/rest/resources/2024_01/dispute.rb +115 -0
  570. data/lib/shopify_api/rest/resources/2024_01/dispute_evidence.rb +121 -0
  571. data/lib/shopify_api/rest/resources/2024_01/dispute_file_upload.rb +85 -0
  572. data/lib/shopify_api/rest/resources/2024_01/draft_order.rb +279 -0
  573. data/lib/shopify_api/rest/resources/2024_01/event.rb +152 -0
  574. data/lib/shopify_api/rest/resources/2024_01/fulfillment.rb +235 -0
  575. data/lib/shopify_api/rest/resources/2024_01/fulfillment_event.rb +170 -0
  576. data/lib/shopify_api/rest/resources/2024_01/fulfillment_order.rb +326 -0
  577. data/lib/shopify_api/rest/resources/2024_01/fulfillment_request.rb +101 -0
  578. data/lib/shopify_api/rest/resources/2024_01/fulfillment_service.rb +134 -0
  579. data/lib/shopify_api/rest/resources/2024_01/gift_card.rb +222 -0
  580. data/lib/shopify_api/rest/resources/2024_01/gift_card_adjustment.rb +122 -0
  581. data/lib/shopify_api/rest/resources/2024_01/image.rb +161 -0
  582. data/lib/shopify_api/rest/resources/2024_01/inventory_item.rb +112 -0
  583. data/lib/shopify_api/rest/resources/2024_01/inventory_level.rb +183 -0
  584. data/lib/shopify_api/rest/resources/2024_01/location.rb +171 -0
  585. data/lib/shopify_api/rest/resources/2024_01/locations_for_move.rb +60 -0
  586. data/lib/shopify_api/rest/resources/2024_01/marketing_event.rb +213 -0
  587. data/lib/shopify_api/rest/resources/2024_01/metafield.rb +348 -0
  588. data/lib/shopify_api/rest/resources/2024_01/mobile_platform_application.rb +114 -0
  589. data/lib/shopify_api/rest/resources/2024_01/order.rb +489 -0
  590. data/lib/shopify_api/rest/resources/2024_01/order_risk.rb +148 -0
  591. data/lib/shopify_api/rest/resources/2024_01/page.rb +198 -0
  592. data/lib/shopify_api/rest/resources/2024_01/payment.rb +144 -0
  593. data/lib/shopify_api/rest/resources/2024_01/payment_gateway.rb +147 -0
  594. data/lib/shopify_api/rest/resources/2024_01/payment_transaction.rb +114 -0
  595. data/lib/shopify_api/rest/resources/2024_01/payout.rb +101 -0
  596. data/lib/shopify_api/rest/resources/2024_01/policy.rb +73 -0
  597. data/lib/shopify_api/rest/resources/2024_01/price_rule.rb +227 -0
  598. data/lib/shopify_api/rest/resources/2024_01/product.rb +227 -0
  599. data/lib/shopify_api/rest/resources/2024_01/product_listing.rb +200 -0
  600. data/lib/shopify_api/rest/resources/2024_01/product_resource_feedback.rb +92 -0
  601. data/lib/shopify_api/rest/resources/2024_01/province.rb +136 -0
  602. data/lib/shopify_api/rest/resources/2024_01/recurring_application_charge.rb +176 -0
  603. data/lib/shopify_api/rest/resources/2024_01/redirect.rb +143 -0
  604. data/lib/shopify_api/rest/resources/2024_01/refund.rb +155 -0
  605. data/lib/shopify_api/rest/resources/2024_01/report.rb +125 -0
  606. data/lib/shopify_api/rest/resources/2024_01/resource_feedback.rb +77 -0
  607. data/lib/shopify_api/rest/resources/{2022_10/customer_saved_search.rb → 2024_01/script_tag.rb} +44 -54
  608. data/lib/shopify_api/rest/resources/2024_01/shipping_zone.rb +87 -0
  609. data/lib/shopify_api/rest/resources/2024_01/shop.rb +222 -0
  610. data/lib/shopify_api/rest/resources/2024_01/smart_collection.rb +220 -0
  611. data/lib/shopify_api/rest/resources/2024_01/storefront_access_token.rb +91 -0
  612. data/lib/shopify_api/rest/resources/2024_01/tender_transaction.rb +97 -0
  613. data/lib/shopify_api/rest/resources/2024_01/theme.rb +127 -0
  614. data/lib/shopify_api/rest/resources/2024_01/transaction.rb +188 -0
  615. data/lib/shopify_api/rest/resources/2024_01/usage_charge.rb +106 -0
  616. data/lib/shopify_api/rest/resources/2024_01/user.rb +142 -0
  617. data/lib/shopify_api/rest/resources/2024_01/variant.rb +212 -0
  618. data/lib/shopify_api/rest/resources/2024_01/webhook.rb +172 -0
  619. data/lib/shopify_api/utils/attributes_comparator.rb +85 -0
  620. data/lib/shopify_api/utils/hmac_validator.rb +1 -1
  621. data/lib/shopify_api/version.rb +1 -1
  622. data/lib/shopify_api/webhooks/handler.rb +24 -1
  623. data/lib/shopify_api/webhooks/registration.rb +2 -2
  624. data/lib/shopify_api/webhooks/registry.rb +13 -2
  625. data/lib/shopify_api/webhooks/request.rb +10 -0
  626. data/shopify_api.gemspec +1 -1
  627. metadata +82 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b06b6f5bbea4f3ec2bfc6362e689d9323dff226bce6e89df9ad3678b07f5ccd1
4
- data.tar.gz: 4aa27ed36ac0734941ad377a814ea13c9015ab44f7644bcfae61b69dabd749b3
3
+ metadata.gz: d335207bd3fc2cf7798f48f3b7a0ff9ea05c05969e189423a9cd89a06c9d155b
4
+ data.tar.gz: 873f2d725e8e1b84e4d8fc617e1b9aa6d3ddec6a9791646a76fb2f946d39ac9b
5
5
  SHA512:
6
- metadata.gz: aa6dde76b4b48dfefa13708a232354dfa8877befee6d9c83f6dc7e55dc9c7f9c3da0109e3a91b3aeb9b5bca954bc19d46b01e8f77c0c630e7eb140edf15b1c9e
7
- data.tar.gz: 10527f74a2c026c49875e6c0a7caafd6c53e1137b8ee655a00b2524067e83439abebc47ac1f640cd6d74cd195c08dd8884243cebefdb270f1bced10e92ee100d
6
+ metadata.gz: 994fa799e6f84043aeec3ffd7c49789588299cf55d40de6bfe091b1b3d935fa99312666d78addb4238532345d6cae97d65f3785ef4fc38a576dfdc9eaa127ca9
7
+ data.tar.gz: 2ff189f2ecb5bb7a9ead4852162857c6e13a29f5fa2229e15378b1ba05ff92cd9c0a3e663161f4f17285a843a88882b53a358c1070ca881e49ba185be98184e7
@@ -11,7 +11,6 @@ jobs:
11
11
  strategy:
12
12
  matrix:
13
13
  version:
14
- - 2.7
15
14
  - 3.0
16
15
  - 3.1
17
16
  steps:
data/.rubocop.yml CHANGED
@@ -57,6 +57,8 @@ Layout/EmptyLineAfterGuardClause:
57
57
  Enabled: true
58
58
  Style/GlobalStdStream:
59
59
  Enabled: true
60
+ Style/OpenStructUse:
61
+ Enabled: false
60
62
  Layout/LineLength:
61
63
  Exclude:
62
64
  - "test/clients/*"
data/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 14.0.0
8
+ - [#1274](https://github.com/Shopify/shopify-api-ruby/pull/1274) ⚠️ [Breaking] Update sorbet and rbi dependencies. Remove support for ruby 2.7. Minimum required Ruby version is 3.0
9
+ - [#1282](https://github.com/Shopify/shopify-api-ruby/pull/1282) Fixes a bug where diffing attributes to update not take into account of Array changes and required ids.
10
+ - [#1254](https://github.com/Shopify/shopify-api-ruby/pull/1254) Introduce token exchange API for fetching access tokens. This feature is currently unstable and cannot be used yet.
11
+ - [#1268](https://github.com/Shopify/shopify-api-ruby/pull/1268) Add [new webhook handler interface](https://github.com/Shopify/shopify-api-ruby/blob/main/docs/usage/webhooks.md#create-a-webhook-handler) to provide `webhook_id ` and `api_version` information to webhook handlers.
12
+ - [#1275](https://github.com/Shopify/shopify-api-ruby/pull/1275) Allow adding custom headers in REST Resource HTTP calls.
13
+
14
+ ## 13.4.0
15
+ - [#1210](https://github.com/Shopify/shopify-api-ruby/pull/1246) Add context option `response_as_struct` to allow GraphQL API responses to be accessed via dot notation.
16
+ - [#1257](https://github.com/Shopify/shopify-api-ruby/pull/1257) Add `api_call_limit` and `retry_request_after` to REST resources to expose rate limit information.
17
+ - [#1257](https://github.com/Shopify/shopify-api-ruby/pull/1257) Added support for the 2024-01 API version. This also includes a fix for the `for_hash` option when creating resources.
18
+
7
19
  ## 13.3.1
8
20
 
9
21
  - [#1244](https://github.com/Shopify/shopify-api-ruby/pull/1244) Add `expired?` to `ShopifyAPI::Auth::Session` to check if the session is expired (mainly for user sessions)
@@ -0,0 +1,46 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all
5
+ people who contribute through reporting issues, posting feature
6
+ requests, updating documentation, submitting pull requests or patches,
7
+ and other activities.
8
+
9
+ We are committed to making participation in this project a
10
+ harassment-free experience for everyone, regardless of level of
11
+ experience, gender, gender identity and expression, sexual orientation,
12
+ disability, personal appearance, body size, race, ethnicity, age,
13
+ religion, or nationality.
14
+
15
+ Examples of unacceptable behavior by participants include:
16
+
17
+ - The use of sexualized language or imagery
18
+ - Personal attacks
19
+ - Trolling or insulting/derogatory comments
20
+ - Public or private harassment
21
+ - Publishing other's private information, such as physical or electronic
22
+ addresses, without explicit permission
23
+ - Other unethical or unprofessional conduct
24
+
25
+ Project maintainers have the right and responsibility to remove, edit,
26
+ or reject comments, commits, code, wiki edits, issues, and other
27
+ contributions that are not aligned to this Code of Conduct, or to ban
28
+ temporarily or permanently any contributor for other behaviors that they
29
+ deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ By adopting this Code of Conduct, project maintainers commit themselves
32
+ to fairly and consistently applying these principles to every aspect of
33
+ managing this project. Project maintainers who do not follow or enforce
34
+ the Code of Conduct may be permanently removed from the project team.
35
+
36
+ This Code of Conduct applies both within project spaces and in public
37
+ spaces when an individual is representing the project or its community.
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may
40
+ be reported by contacting a project maintainer at <opensource@shopify.com>.
41
+ All complaints will be reviewed and investigated and will result in a response
42
+ that is deemed necessary and appropriate to the circumstances. Maintainers are
43
+ obligated to maintain confidentiality with regard to the reporter of an incident.
44
+
45
+ This Code of Conduct is adapted from the Contributor Covenant, version
46
+ 1.3.0, available from http://contributor-covenant.org/version/1/3/0/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify_api (13.3.1)
4
+ shopify_api (14.0.0)
5
5
  activesupport
6
6
  concurrent-ruby
7
7
  hash_diff
@@ -16,7 +16,7 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- activesupport (7.1.2)
19
+ activesupport (7.1.3)
20
20
  base64
21
21
  bigdecimal
22
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -30,16 +30,16 @@ GEM
30
30
  public_suffix (>= 2.0.2, < 5.0)
31
31
  ast (2.4.2)
32
32
  base64 (0.2.0)
33
- bigdecimal (3.1.4)
33
+ bigdecimal (3.1.6)
34
34
  byebug (11.1.3)
35
35
  coderay (1.1.3)
36
- concurrent-ruby (1.2.2)
36
+ concurrent-ruby (1.2.3)
37
37
  connection_pool (2.4.1)
38
38
  crack (0.4.5)
39
39
  rexml
40
- diff-lcs (1.5.0)
41
40
  drb (2.2.0)
42
41
  ruby2_keywords
42
+ erubi (1.12.0)
43
43
  fakefs (1.4.1)
44
44
  hash_diff (1.1.1)
45
45
  hashdiff (1.0.1)
@@ -57,27 +57,28 @@ GEM
57
57
  multi_xml (0.6.0)
58
58
  mutex_m (0.2.0)
59
59
  netrc (0.11.0)
60
- oj (3.16.1)
60
+ oj (3.16.3)
61
+ bigdecimal (>= 3.0)
61
62
  openssl (3.2.0)
62
- parallel (1.22.1)
63
- parser (3.2.2.4)
63
+ parallel (1.24.0)
64
+ parser (3.3.0.5)
64
65
  ast (~> 2.4.1)
65
66
  racc
66
- pry (0.14.1)
67
+ prettier_print (1.2.1)
68
+ prism (0.21.0)
69
+ pry (0.14.2)
67
70
  coderay (~> 1.1)
68
71
  method_source (~> 1.0)
69
72
  pry-byebug (3.10.1)
70
73
  byebug (~> 11.0)
71
74
  pry (>= 0.13, < 0.15)
72
75
  public_suffix (4.0.6)
73
- racc (1.7.1)
76
+ racc (1.7.3)
74
77
  rainbow (3.1.1)
75
78
  rake (13.0.6)
76
- rbi (0.0.15)
77
- ast
78
- parser (>= 2.6.4.0)
79
+ rbi (0.1.8)
80
+ prism (>= 0.18.0, < 0.22)
79
81
  sorbet-runtime (>= 0.5.9204)
80
- unparser
81
82
  regexp_parser (2.5.0)
82
83
  rexml (3.2.5)
83
84
  rubocop (1.36.0)
@@ -98,48 +99,44 @@ GEM
98
99
  rubocop (>= 0.90.0)
99
100
  ruby-progressbar (1.11.0)
100
101
  ruby2_keywords (0.0.5)
101
- securerandom (0.3.0)
102
- sorbet (0.5.10438)
103
- sorbet-static (= 0.5.10438)
104
- sorbet-runtime (0.5.10438)
105
- sorbet-static (0.5.10438-universal-darwin-21)
106
- sorbet-static (0.5.10438-universal-darwin-22)
107
- sorbet-static (0.5.10438-x86_64-linux)
108
- sorbet-static-and-runtime (0.5.10438)
109
- sorbet (= 0.5.10438)
110
- sorbet-runtime (= 0.5.10438)
111
- spoom (1.1.11)
112
- sorbet (>= 0.5.9204)
113
- sorbet-runtime (>= 0.5.9204)
102
+ securerandom (0.3.1)
103
+ sorbet (0.5.11230)
104
+ sorbet-static (= 0.5.11230)
105
+ sorbet-runtime (0.5.11230)
106
+ sorbet-static (0.5.11230-universal-darwin)
107
+ sorbet-static (0.5.11230-x86_64-linux)
108
+ sorbet-static-and-runtime (0.5.11230)
109
+ sorbet (= 0.5.11230)
110
+ sorbet-runtime (= 0.5.11230)
111
+ spoom (1.2.4)
112
+ erubi (>= 1.10.0)
113
+ sorbet-static-and-runtime (>= 0.5.10187)
114
+ syntax_tree (>= 6.1.1)
114
115
  thor (>= 0.19.2)
115
- tapioca (0.10.2)
116
- bundler (>= 1.17.3)
116
+ syntax_tree (6.2.0)
117
+ prettier_print (>= 1.2.0)
118
+ tapioca (0.12.0)
119
+ bundler (>= 2.2.25)
117
120
  netrc (>= 0.11.0)
118
121
  parallel (>= 1.21.0)
119
- pry (>= 0.12.2)
120
- rbi (~> 0.0.0, >= 0.0.14)
121
- sorbet-static-and-runtime (>= 0.5.9204)
122
- spoom (~> 1.1.0, >= 1.1.11)
122
+ rbi (>= 0.1.4, < 0.2)
123
+ sorbet-static-and-runtime (>= 0.5.10820)
124
+ spoom (~> 1.2.0, >= 1.2.0)
123
125
  thor (>= 1.2.0)
124
126
  yard-sorbet
125
- thor (1.2.1)
127
+ thor (1.3.0)
126
128
  tzinfo (2.0.6)
127
129
  concurrent-ruby (~> 1.0)
128
130
  unicode-display_width (2.3.0)
129
- unparser (0.6.5)
130
- diff-lcs (~> 1.3)
131
- parser (>= 3.1.0)
132
131
  webmock (3.14.0)
133
132
  addressable (>= 2.8.0)
134
133
  crack (>= 0.3.2)
135
134
  hashdiff (>= 0.4.0, < 2.0.0)
136
- webrick (1.7.0)
137
- yard (0.9.28)
138
- webrick (~> 1.7.0)
139
- yard-sorbet (0.7.0)
135
+ yard (0.9.34)
136
+ yard-sorbet (0.8.1)
140
137
  sorbet-runtime (>= 0.5)
141
138
  yard (>= 0.9)
142
- zeitwerk (2.6.12)
139
+ zeitwerk (2.6.13)
143
140
 
144
141
  PLATFORMS
145
142
  arm64-darwin-21
data/dev.yml CHANGED
@@ -3,8 +3,9 @@ name: shopify-api
3
3
  type: ruby
4
4
 
5
5
  up:
6
- - ruby: 3.0.3
7
- - bundler
6
+ - ruby: 3.0.6
7
+ - bundler:
8
+ gemfile: Gemfile
8
9
 
9
10
  commands:
10
11
  console:
@@ -117,7 +117,7 @@ response = client.query(query: query, variables: variables)
117
117
 
118
118
  ### Output
119
119
  #### Success
120
- If the request is successful these methods will all return a [`ShopifyAPI::Clients::HttpResponse`](https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/clients/http_response.rb) object, which has the following methods:
120
+ If the request is successful these methods will all return a [`ShopifyAPI::Clients::HttpResponse`](https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/clients/http_response.rb) object, which has the following methods:
121
121
  | Methods | Type | Notes |
122
122
  |---------|------|-------|
123
123
  | `code` |`Integer`| HTTP Response code, e.g. `200`|
@@ -137,6 +137,35 @@ This library also supports cursor-based pagination for GraphQL Admin API request
137
137
 
138
138
  After making a request, the `next_page_info` and `prev_page_info` can be found on the response object and be used in the query param in other requests.
139
139
 
140
+ ## Response as Struct
141
+ By default the response body is returned as a `Hash{String, Untyped}`. If you would like to return the response body as a `Struct`, you can pass `response_as_struct: true` to the `ShopifyAPI::Context.setup` method.
142
+ Then you can access the object with both dot and hash notation.
143
+
144
+ ```ruby
145
+ ShopifyAPI::Context.setup(
146
+ api_key: ShopifyApp.configuration.api_key,
147
+ api_secret_key: ShopifyApp.configuration.secret,
148
+ ...
149
+ response_as_struct: true
150
+ )
151
+
152
+ # Make a graphql query
153
+ response = client.query(
154
+ query: CREATE_PRODUCTS_MUTATION,
155
+ variables: {
156
+ input: {
157
+ title: random_title,
158
+ variants: [{ price: random_price }],
159
+ },
160
+ },
161
+ )
162
+ # Access result with dot notation
163
+ created_product2 = response.body.data.productCreate.product
164
+ # Access result with hash notation
165
+ created_product = response.body["data"]["productCreate"]["product"]
166
+
167
+ ```
168
+
140
169
  ## Proxy a GraphQL Query
141
170
 
142
171
  If you would like to give your front end the ability to make authenticated graphql queries to the Shopify Admin API, the `shopify_api` gem makes proxy-ing a graphql request easy! The gem provides a utility function which will accept the raw request body (a GraphQL query), the headers, and the cookies (optional). It will add authentication to the request, proxy it to the Shopify Admin API, and return a `ShopifyAPI::Clients::HttpResponse`. An example utilization of this in Rails is shown below:
data/docs/usage/rest.md CHANGED
@@ -69,18 +69,18 @@ Typical methods provided for each resources are:
69
69
  Full list of methods can be found on each of the resource class.
70
70
  - Path:
71
71
  - https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/rest/resources/#{version}/#{resource}.rb
72
- - Example for `Order` resource on `2023-04` version:
73
- - https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/rest/resources/2023_04/order.rb
72
+ - Example for `Order` resource on `2024-01` version:
73
+ - https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/rest/resources/2024_01/order.rb
74
74
 
75
- ### Usage Examples
76
- ⚠️ Reference documentation on [shopify.dev](https://shopify.dev/docs/api/admin-rest) contains more examples on how to use each REST Resources.
75
+ ### The `save` method
77
76
 
78
- ```Ruby
79
- # Find and update a customer email
80
- customer = ShopifyAPI::Customer.find(id: customer_id)
81
- customer.email = "steve-lastnameson@example.com"
82
- customer.save!
77
+ The `save` or `save!` method on a resource allows you to `create` or `update` that resource.
83
78
 
79
+ #### Create a new resource
80
+
81
+ To create a new resource using the `save` or `save!` method, you can initialize the resource with a hash of values or simply assigning them manually. For example:
82
+
83
+ ```Ruby
84
84
  # Create a new product from hash
85
85
  product_properties = {
86
86
  title: "My awesome product"
@@ -88,10 +88,63 @@ product_properties = {
88
88
  product = ShopifyAPI::Product.new(from_hash: product_properties)
89
89
  product.save!
90
90
 
91
- # Create a product manually
91
+ # Create a new product manually
92
92
  product = ShopifyAPI::Product.new
93
93
  product.title = "Another one"
94
94
  product.save!
95
+ ```
96
+
97
+ #### Update an existing resource
98
+
99
+ To update an existing resource using the `save` or `save!` method, you'll need to fetch the resource from Shopify first. Then, you can manually assign new values to the resource before calling `save` or `save!`. For example:
100
+
101
+ ```Ruby
102
+ # Update a product's title
103
+ product = ShopifyAPI::Product.find(id: product_id)
104
+ product.title = "My new title"
105
+ product.save!
106
+
107
+ # Remove a line item from a draft order
108
+ draft_order = ShopifyAPI::DraftOrder.find(id: draft_order_id)
109
+
110
+ new_line_items = draft_order.line_items.reject { |line_item| line_item["id"] == 12345 }
111
+ draft_order.line_items = new_line_items
112
+
113
+ draft_order.save!
114
+ ```
115
+
116
+ > [!IMPORTANT]
117
+ > If you need to unset an existing value,
118
+ > please explicitly set that attribute to `nil` or empty values such as `[]` or `{}`. For example:
119
+ >
120
+ > ```Ruby
121
+ > # Removes shipping address from draft_order
122
+ > draft_order.shipping_address = {}
123
+ > draft_order.save!
124
+ > ```
125
+ >
126
+ > This is because only modified values are sent to the API, so if `shipping_address` is not "modified" to `{}`. It won't be part of the PUT request payload
127
+
128
+ When updating a resource, only the modified attributes, the resource's primary key, and required parameters are sent to the API. The primary key is usually the `id` attribute of the resource, but it can vary if the `primary_key` method is overwritten in the resource's class. The required parameters are identified using the path parameters of the `PUT` endpoint of the resource.
129
+
130
+ ### Headers
131
+ You can add custom headers to the HTTP calls made by methods like `find`, `delete`, `all`, `count`
132
+ by setting the `headers` attribute on the `ShopifyAPI::Rest::Base` class in an initializer, like so:
133
+
134
+ ```ruby
135
+ ShopifyAPI::Rest::Base.headers = { "X-Custom-Header" => "Custom Value" }
136
+ # `find` will call the API endpoint with the custom header
137
+ ShopifyAPI::Customer.find(id: customer_id)
138
+ ```
139
+
140
+ ### Usage Examples
141
+ ⚠️ The [API reference documentation](https://shopify.dev/docs/api/admin-rest) contains more examples on how to use each REST Resources.
142
+
143
+ ```Ruby
144
+ # Find and update a customer email
145
+ customer = ShopifyAPI::Customer.find(id: customer_id)
146
+ customer.email = "steve-lastnameson@example.com"
147
+ customer.save!
95
148
 
96
149
  # Get all orders
97
150
  orders = ShopifyAPI::Orders.all
@@ -122,7 +175,7 @@ Create an instance of [`ShopifyAPI::Clients::Rest::Admin`](https://github.com/Sh
122
175
 
123
176
  Examples:
124
177
  ```ruby
125
- # Create a default client with `ShopifyAPI::Context.api_version`
178
+ # Create a default client with `ShopifyAPI::Context.api_version`
126
179
  # and the active session from `ShopifyAPI::Context.active_session`
127
180
  client = ShopifyAPI::Clients::Rest::Admin.new
128
181
 
@@ -147,7 +200,7 @@ The `ShopifyAPI::Clients::Rest::Admin` client offers the 4 core request methods:
147
200
 
148
201
  #### Input Parameters
149
202
 
150
- Each method can take the parameters outlined in the table below.
203
+ Each method can take the parameters outlined in the table below.
151
204
 
152
205
  | Parameter | Type | Required in Methods | Default Value | Notes |
153
206
  | -------------- | -------------------------------------------------------- | :-----------------: | :-----------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -161,7 +214,7 @@ Each method can take the parameters outlined in the table below.
161
214
 
162
215
  #### Output
163
216
  ##### Success
164
- If the request is successful these methods will all return a [`ShopifyAPI::Clients::HttpResponse`](https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/clients/http_response.rb) object, which has the following methods:
217
+ If the request is successful these methods will all return a [`ShopifyAPI::Clients::HttpResponse`](https://github.com/Shopify/shopify-api-ruby/blob/main/lib/shopify_api/clients/http_response.rb) object, which has the following methods:
165
218
  | Methods | Type | Notes |
166
219
  |---------|------|-------|
167
220
  | `code` |`Integer`| HTTP Response code, e.g. `200`|
@@ -247,6 +300,21 @@ _For more information on the `products` endpoint, [check out our API reference g
247
300
 
248
301
  _For more information on the `products` endpoint, [check out our API reference guide](https://shopify.dev/docs/api/admin-rest/latest/resources/product)._
249
302
 
303
+ #### Accessing Rate Limit information
304
+
305
+ The REST resources have `api_call_limit` and `retry_after` can be found on the Resource class. These values correspond to the `X-Shopify-Shop-Api-Call-Limit` and `Retry-After` [headers](https://shopify.dev/docs/api/usage/rate-limits#rest-admin-api-rate-limits) respectively.
306
+
307
+ ```ruby
308
+ product = ShopifyAPI::Product.find(session: session, id: 12345)
309
+
310
+ # X-Shopify-Shop-Api-Call-Limit: 32/40
311
+ request_count = ShopifyAPI::Product.api_call_limit[:request_count] # 32
312
+ bucket_size = ShopifyAPI::Product.api_call_limit[:bucket_size] # 40
313
+
314
+ retry_after = ShopifyAPI::Product.retry_request_after
315
+
316
+ ```
317
+
250
318
  ### Pagination
251
319
 
252
320
  This library also supports cursor-based pagination for REST Admin API requests. [Learn more about REST request pagination](https://shopify.dev/docs/api/usage/pagination-rest).
@@ -7,10 +7,37 @@ If using in the Rails framework, we highly recommend you use the [shopify_app](h
7
7
 
8
8
  ## Create a Webhook Handler
9
9
 
10
- If you want to register for an http webhook you need to implement a webhook handler which the `shopify_api` gem can use to determine how to process your webhook. You can make multiple implementations (one per topic) or you can make one implementation capable of handling all the topics you want to subscribe to. To do this simply make a module or class that includes or extends `ShopifyAPI::Webhooks::WebhookHandler` and implement the handle method which accepts the following named parameters: topic: `String`, shop: `String`, and body: `Hash[String, untyped]`. An example implementation is shown below:
10
+ If you want to register for an http webhook you need to implement a webhook handler which the `shopify_api` gem can use to determine how to process your webhook. You can make multiple implementations (one per topic) or you can make one implementation capable of handling all the topics you want to subscribe to. To do this simply make a module or class that includes or extends `ShopifyAPI::Webhooks::WebhookHandler` and implement the `handle` method which accepts the following named parameters: data: `WebhookMetadata`. An example implementation is shown below:
11
+
12
+ `data` will have the following keys
13
+ - `topic`, `String` - The topic of the webhook
14
+ - `shop`, `String` - The shop domain of the webhook
15
+ - `body`, `T::Hash[String, T.untyped]`- The body of the webhook
16
+ - `webhook_id`, `String` - The id of the webhook event to [avoid duplicates](https://shopify.dev/docs/apps/webhooks/best-practices#ignore-duplicates)
17
+ - `api_version`, `String` - The api version of the webhook
11
18
 
12
19
  ```ruby
13
- module WebhookHandler
20
+ module WebhookHandler
21
+ extend ShopifyAPI::Webhooks::Handler
22
+
23
+ class << self
24
+ def handle_webhook(data)
25
+ puts "Received webhook! topic: #{data.topic} shop: #{data.shop} body: #{data.body} webhook_id: #{data.webhook_id} api_version: #{data.api_version"
26
+ end
27
+ end
28
+ end
29
+ ```
30
+
31
+ **Note:** As of version 13.5.0 the `ShopifyAPI::Webhooks::Handler` class is still available to be used but will be removed in a future version of the gem.
32
+
33
+ ### Best Practices
34
+ It is recommended that in order to respond quickly to the Shopify webhook request that the handler not do any heavy logic or network calls, rather it should simply enqueue the work in some job queue in order to be executed later.
35
+
36
+ ### Webhook Handler for versions 13.4.0 and prior
37
+ If you want to register for an http webhook you need to implement a webhook handler which the `shopify_api` gem can use to determine how to process your webhook. You can make multiple implementations (one per topic) or you can make one implementation capable of handling all the topics you want to subscribe to. To do this simply make a module or class that includes or extends `ShopifyAPI::Webhooks::Handler` and implement the handle method which accepts the following named parameters: topic: `String`, shop: `String`, and body: `Hash[String, untyped]`. An example implementation is shown below:
38
+
39
+ ```ruby
40
+ module WebhookHandler
14
41
  extend ShopifyAPI::Webhooks::Handler
15
42
 
16
43
  class << self
@@ -21,25 +48,23 @@ module WebhookHandler
21
48
  end
22
49
  ```
23
50
 
24
- **Note:** It is recommended that in order to respond quickly to the Shopify webhook request that the handler not do any heavy logic or network calls, rather it should simply enqueue the work in some job queue in order to be executed later.
25
-
26
51
  ## Add to Webhook Registry
27
52
 
28
53
  The next step is to add all the webhooks you would like to subscribe to for any shop to the webhook registry. To do this you can call `ShopifyAPI::Webhooks::Registry.add_registration` for each webhook you would like to handle. `add_registration` accepts a topic string, a delivery_method symbol (currently supporting `:http`, `:event_bridge`, and `:pub_sub`), a webhook path (the relative path for an http webhook) and a handler. This only needs to be done once when the app is started and we recommend doing this at the same time that you setup `ShopifyAPI::Context`. An example is shown below to register an http webhook:
29
54
 
30
55
  ```ruby
31
- registration = ShopifyAPI::Webhooks::Registry.add_registration(topic: "orders/create",
56
+ registration = ShopifyAPI::Webhooks::Registry.add_registration(topic: "orders/create",
32
57
  delivery_method: :http,
33
58
  handler: WebhookHandler,
34
- path: 'callback/orders/create')
59
+ path: 'callback/orders/create')
35
60
  ```
36
61
  If you are only interested in particular fields, you can optionally filter the data sent by Shopify by specifying the `fields` parameter. Note that you will still receive a webhook request from Shopify every time the resource is updated, but only the specified fields will be sent:
37
62
 
38
63
  ```ruby
39
64
  registration = ShopifyAPI::Webhooks::Registry.add_registration(
40
- topic: "orders/create",
41
- delivery_method: :http,
42
- handler: WebhookHandler,
65
+ topic: "orders/create",
66
+ delivery_method: :http,
67
+ handler: WebhookHandler,
43
68
  path: 'callback/orders/create',
44
69
  fields: ["number","note"] # this can also be a single comma separated string
45
70
  )
@@ -5,6 +5,7 @@ module ShopifyAPI
5
5
  module AdminVersions
6
6
  SUPPORTED_ADMIN_VERSIONS = T.let([
7
7
  "unstable",
8
+ "2024-01",
8
9
  "2023-10",
9
10
  "2023-07",
10
11
  "2023-04",
@@ -15,7 +16,7 @@ module ShopifyAPI
15
16
  "2022-01",
16
17
  ], T::Array[String])
17
18
 
18
- LATEST_SUPPORTED_ADMIN_VERSION = T.let("2023-10", String)
19
+ LATEST_SUPPORTED_ADMIN_VERSION = T.let("2024-01", String)
19
20
  end
20
21
 
21
22
  SUPPORTED_ADMIN_VERSIONS = ShopifyAPI::AdminVersions::SUPPORTED_ADMIN_VERSIONS
@@ -0,0 +1,37 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module ShopifyAPI
5
+ module Auth
6
+ module Oauth
7
+ class AccessTokenResponse < T::Struct
8
+ extend T::Sig
9
+
10
+ const :access_token, String
11
+ const :scope, String
12
+ const :session, T.nilable(String)
13
+ const :expires_in, T.nilable(Integer)
14
+ const :associated_user, T.nilable(AssociatedUser)
15
+ const :associated_user_scope, T.nilable(String)
16
+
17
+ sig { returns(T::Boolean) }
18
+ def online_token?
19
+ !associated_user.nil?
20
+ end
21
+
22
+ alias_method :eql?, :==
23
+ sig { params(other: T.nilable(AccessTokenResponse)).returns(T::Boolean) }
24
+ def ==(other)
25
+ return false unless other
26
+
27
+ access_token == other.access_token &&
28
+ scope == other.scope &&
29
+ session == other.session &&
30
+ expires_in == other.expires_in &&
31
+ associated_user == other.associated_user &&
32
+ associated_user_scope == other.associated_user_scope
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
@@ -89,7 +89,8 @@ module ShopifyAPI
89
89
  end
90
90
 
91
91
  session_params = T.cast(response.body, T::Hash[String, T.untyped]).to_h
92
- session = create_new_session(session_params, auth_query.shop)
92
+ session = Session.from(shop: auth_query.shop,
93
+ access_token_response: Oauth::AccessTokenResponse.from_hash(session_params))
93
94
 
94
95
  cookie = if Context.embedded?
95
96
  SessionCookie.new(
@@ -105,38 +106,6 @@ module ShopifyAPI
105
106
 
106
107
  { session: session, cookie: cookie }
107
108
  end
108
-
109
- private
110
-
111
- sig { params(session_params: T::Hash[String, T.untyped], shop: String).returns(Session) }
112
- def create_new_session(session_params, shop)
113
- session_params = session_params.to_h { |k, v| [k.to_sym, v] }
114
-
115
- scope = session_params[:scope]
116
-
117
- is_online = !session_params[:associated_user].nil?
118
-
119
- if is_online
120
- associated_user = AssociatedUser.new(session_params[:associated_user].to_h { |k, v| [k.to_sym, v] })
121
- expires = Time.now + session_params[:expires_in].to_i
122
- associated_user_scope = session_params[:associated_user_scope]
123
- id = "#{shop}_#{associated_user.id}"
124
- else
125
- id = "offline_#{shop}"
126
- end
127
-
128
- Session.new(
129
- id: id,
130
- shop: shop,
131
- access_token: session_params[:access_token],
132
- scope: scope,
133
- is_online: is_online,
134
- associated_user_scope: associated_user_scope,
135
- associated_user: associated_user,
136
- expires: expires,
137
- shopify_session_id: session_params[:session],
138
- )
139
- end
140
109
  end
141
110
  end
142
111
  end
@@ -89,6 +89,32 @@ module ShopifyAPI
89
89
  end
90
90
  end
91
91
 
92
+ sig { params(shop: String, access_token_response: Oauth::AccessTokenResponse).returns(Session) }
93
+ def from(shop:, access_token_response:)
94
+ is_online = access_token_response.online_token?
95
+
96
+ if is_online
97
+ associated_user = T.must(access_token_response.associated_user)
98
+ expires = Time.now + access_token_response.expires_in.to_i
99
+ associated_user_scope = access_token_response.associated_user_scope
100
+ id = "#{shop}_#{associated_user.id}"
101
+ else
102
+ id = "offline_#{shop}"
103
+ end
104
+
105
+ new(
106
+ id: id,
107
+ shop: shop,
108
+ access_token: access_token_response.access_token,
109
+ scope: access_token_response.scope,
110
+ is_online: is_online,
111
+ associated_user_scope: associated_user_scope,
112
+ associated_user: associated_user,
113
+ expires: expires,
114
+ shopify_session_id: access_token_response.session,
115
+ )
116
+ end
117
+
92
118
  sig { params(str: String).returns(Session) }
93
119
  def deserialize(str)
94
120
  Oj.load(str)