@medusajs/js-sdk 1.0.0-rc-20241016093905 → 2.0.0-preview-20241022094107

Sign up to get free protection for your applications and to get access to all the features.
Files changed (349) hide show
  1. package/dist/admin/api-key.d.ts +6 -0
  2. package/dist/admin/api-key.d.ts.map +1 -1
  3. package/dist/admin/api-key.js +3 -0
  4. package/dist/admin/api-key.js.map +1 -1
  5. package/dist/admin/campaign.d.ts +6 -0
  6. package/dist/admin/campaign.d.ts.map +1 -1
  7. package/dist/admin/campaign.js +3 -0
  8. package/dist/admin/campaign.js.map +1 -1
  9. package/dist/admin/claim.d.ts +6 -1
  10. package/dist/admin/claim.d.ts.map +1 -1
  11. package/dist/admin/claim.js +3 -7
  12. package/dist/admin/claim.js.map +1 -1
  13. package/dist/admin/currency.d.ts +6 -0
  14. package/dist/admin/currency.d.ts.map +1 -1
  15. package/dist/admin/currency.js +3 -0
  16. package/dist/admin/currency.js.map +1 -1
  17. package/dist/admin/customer-group.d.ts +6 -0
  18. package/dist/admin/customer-group.d.ts.map +1 -1
  19. package/dist/admin/customer-group.js +3 -0
  20. package/dist/admin/customer-group.js.map +1 -1
  21. package/dist/admin/customer.d.ts +6 -0
  22. package/dist/admin/customer.d.ts.map +1 -1
  23. package/dist/admin/customer.js +3 -0
  24. package/dist/admin/customer.js.map +1 -1
  25. package/dist/admin/exchange.d.ts +6 -4
  26. package/dist/admin/exchange.d.ts.map +1 -1
  27. package/dist/admin/exchange.js +3 -30
  28. package/dist/admin/exchange.js.map +1 -1
  29. package/dist/admin/fulfillment-provider.d.ts +6 -0
  30. package/dist/admin/fulfillment-provider.d.ts.map +1 -1
  31. package/dist/admin/fulfillment-provider.js +3 -0
  32. package/dist/admin/fulfillment-provider.js.map +1 -1
  33. package/dist/admin/fulfillment-set.d.ts +6 -0
  34. package/dist/admin/fulfillment-set.d.ts.map +1 -1
  35. package/dist/admin/fulfillment-set.js +3 -0
  36. package/dist/admin/fulfillment-set.js.map +1 -1
  37. package/dist/admin/fulfillment.d.ts +6 -0
  38. package/dist/admin/fulfillment.d.ts.map +1 -1
  39. package/dist/admin/fulfillment.js +3 -0
  40. package/dist/admin/fulfillment.js.map +1 -1
  41. package/dist/admin/inventory-item.d.ts +6 -0
  42. package/dist/admin/inventory-item.d.ts.map +1 -1
  43. package/dist/admin/inventory-item.js +3 -0
  44. package/dist/admin/inventory-item.js.map +1 -1
  45. package/dist/admin/invite.d.ts +6 -0
  46. package/dist/admin/invite.d.ts.map +1 -1
  47. package/dist/admin/invite.js +3 -0
  48. package/dist/admin/invite.js.map +1 -1
  49. package/dist/admin/notification.d.ts +6 -0
  50. package/dist/admin/notification.d.ts.map +1 -1
  51. package/dist/admin/notification.js +3 -0
  52. package/dist/admin/notification.js.map +1 -1
  53. package/dist/admin/order-edit.d.ts +6 -0
  54. package/dist/admin/order-edit.d.ts.map +1 -1
  55. package/dist/admin/order-edit.js +3 -0
  56. package/dist/admin/order-edit.js.map +1 -1
  57. package/dist/admin/order.d.ts +7 -0
  58. package/dist/admin/order.d.ts.map +1 -1
  59. package/dist/admin/order.js +9 -0
  60. package/dist/admin/order.js.map +1 -1
  61. package/dist/admin/payment-collection.d.ts +6 -0
  62. package/dist/admin/payment-collection.d.ts.map +1 -1
  63. package/dist/admin/payment-collection.js +3 -0
  64. package/dist/admin/payment-collection.js.map +1 -1
  65. package/dist/admin/payment.d.ts +6 -0
  66. package/dist/admin/payment.d.ts.map +1 -1
  67. package/dist/admin/payment.js +3 -0
  68. package/dist/admin/payment.js.map +1 -1
  69. package/dist/admin/price-list.d.ts +6 -0
  70. package/dist/admin/price-list.d.ts.map +1 -1
  71. package/dist/admin/price-list.js +3 -0
  72. package/dist/admin/price-list.js.map +1 -1
  73. package/dist/admin/price-preference.d.ts +6 -0
  74. package/dist/admin/price-preference.d.ts.map +1 -1
  75. package/dist/admin/price-preference.js +3 -0
  76. package/dist/admin/price-preference.js.map +1 -1
  77. package/dist/admin/product-category.d.ts +6 -0
  78. package/dist/admin/product-category.d.ts.map +1 -1
  79. package/dist/admin/product-category.js +3 -0
  80. package/dist/admin/product-category.js.map +1 -1
  81. package/dist/admin/product-collection.d.ts +6 -0
  82. package/dist/admin/product-collection.d.ts.map +1 -1
  83. package/dist/admin/product-collection.js +3 -0
  84. package/dist/admin/product-collection.js.map +1 -1
  85. package/dist/admin/product-tag.d.ts +6 -0
  86. package/dist/admin/product-tag.d.ts.map +1 -1
  87. package/dist/admin/product-tag.js +3 -0
  88. package/dist/admin/product-tag.js.map +1 -1
  89. package/dist/admin/product-type.d.ts +6 -0
  90. package/dist/admin/product-type.d.ts.map +1 -1
  91. package/dist/admin/product-type.js +3 -0
  92. package/dist/admin/product-type.js.map +1 -1
  93. package/dist/admin/product-variant.d.ts +6 -0
  94. package/dist/admin/product-variant.d.ts.map +1 -1
  95. package/dist/admin/product-variant.js +3 -0
  96. package/dist/admin/product-variant.js.map +1 -1
  97. package/dist/admin/product.d.ts +6 -0
  98. package/dist/admin/product.d.ts.map +1 -1
  99. package/dist/admin/product.js +3 -0
  100. package/dist/admin/product.js.map +1 -1
  101. package/dist/admin/promotion.d.ts +6 -0
  102. package/dist/admin/promotion.d.ts.map +1 -1
  103. package/dist/admin/promotion.js +3 -0
  104. package/dist/admin/promotion.js.map +1 -1
  105. package/dist/admin/refund-reasons.d.ts +6 -0
  106. package/dist/admin/refund-reasons.d.ts.map +1 -1
  107. package/dist/admin/refund-reasons.js +3 -0
  108. package/dist/admin/refund-reasons.js.map +1 -1
  109. package/dist/admin/region.d.ts +6 -0
  110. package/dist/admin/region.d.ts.map +1 -1
  111. package/dist/admin/region.js +3 -0
  112. package/dist/admin/region.js.map +1 -1
  113. package/dist/admin/reservation.d.ts +6 -0
  114. package/dist/admin/reservation.d.ts.map +1 -1
  115. package/dist/admin/reservation.js +3 -0
  116. package/dist/admin/reservation.js.map +1 -1
  117. package/dist/admin/return-reason.d.ts +6 -0
  118. package/dist/admin/return-reason.d.ts.map +1 -1
  119. package/dist/admin/return-reason.js +3 -0
  120. package/dist/admin/return-reason.js.map +1 -1
  121. package/dist/admin/return.d.ts +6 -0
  122. package/dist/admin/return.d.ts.map +1 -1
  123. package/dist/admin/return.js +3 -0
  124. package/dist/admin/return.js.map +1 -1
  125. package/dist/admin/sales-channel.d.ts +6 -0
  126. package/dist/admin/sales-channel.d.ts.map +1 -1
  127. package/dist/admin/sales-channel.js +3 -0
  128. package/dist/admin/sales-channel.js.map +1 -1
  129. package/dist/admin/shipping-option.d.ts +6 -0
  130. package/dist/admin/shipping-option.d.ts.map +1 -1
  131. package/dist/admin/shipping-option.js +3 -0
  132. package/dist/admin/shipping-option.js.map +1 -1
  133. package/dist/admin/shipping-profile.d.ts +6 -0
  134. package/dist/admin/shipping-profile.d.ts.map +1 -1
  135. package/dist/admin/shipping-profile.js +3 -0
  136. package/dist/admin/shipping-profile.js.map +1 -1
  137. package/dist/admin/stock-location.d.ts +6 -0
  138. package/dist/admin/stock-location.d.ts.map +1 -1
  139. package/dist/admin/stock-location.js +3 -0
  140. package/dist/admin/stock-location.js.map +1 -1
  141. package/dist/admin/store.d.ts +6 -0
  142. package/dist/admin/store.d.ts.map +1 -1
  143. package/dist/admin/store.js +3 -0
  144. package/dist/admin/store.js.map +1 -1
  145. package/dist/admin/tax-rate.d.ts +6 -0
  146. package/dist/admin/tax-rate.d.ts.map +1 -1
  147. package/dist/admin/tax-rate.js +3 -0
  148. package/dist/admin/tax-rate.js.map +1 -1
  149. package/dist/admin/tax-region.d.ts +6 -0
  150. package/dist/admin/tax-region.d.ts.map +1 -1
  151. package/dist/admin/tax-region.js +3 -0
  152. package/dist/admin/tax-region.js.map +1 -1
  153. package/dist/admin/upload.d.ts +6 -0
  154. package/dist/admin/upload.d.ts.map +1 -1
  155. package/dist/admin/upload.js +3 -0
  156. package/dist/admin/upload.js.map +1 -1
  157. package/dist/admin/user.d.ts +6 -0
  158. package/dist/admin/user.d.ts.map +1 -1
  159. package/dist/admin/user.js +3 -0
  160. package/dist/admin/user.js.map +1 -1
  161. package/dist/admin/workflow-execution.d.ts +6 -0
  162. package/dist/admin/workflow-execution.d.ts.map +1 -1
  163. package/dist/admin/workflow-execution.js +3 -0
  164. package/dist/admin/workflow-execution.js.map +1 -1
  165. package/dist/auth/index.d.ts +156 -0
  166. package/dist/auth/index.d.ts.map +1 -1
  167. package/dist/auth/index.js +152 -1
  168. package/dist/auth/index.js.map +1 -1
  169. package/dist/esm/admin/api-key.d.ts +6 -0
  170. package/dist/esm/admin/api-key.d.ts.map +1 -1
  171. package/dist/esm/admin/api-key.js +3 -0
  172. package/dist/esm/admin/api-key.js.map +1 -1
  173. package/dist/esm/admin/campaign.d.ts +6 -0
  174. package/dist/esm/admin/campaign.d.ts.map +1 -1
  175. package/dist/esm/admin/campaign.js +3 -0
  176. package/dist/esm/admin/campaign.js.map +1 -1
  177. package/dist/esm/admin/claim.d.ts +6 -1
  178. package/dist/esm/admin/claim.d.ts.map +1 -1
  179. package/dist/esm/admin/claim.js +3 -9
  180. package/dist/esm/admin/claim.js.map +1 -1
  181. package/dist/esm/admin/currency.d.ts +6 -0
  182. package/dist/esm/admin/currency.d.ts.map +1 -1
  183. package/dist/esm/admin/currency.js +3 -0
  184. package/dist/esm/admin/currency.js.map +1 -1
  185. package/dist/esm/admin/customer-group.d.ts +6 -0
  186. package/dist/esm/admin/customer-group.d.ts.map +1 -1
  187. package/dist/esm/admin/customer-group.js +3 -0
  188. package/dist/esm/admin/customer-group.js.map +1 -1
  189. package/dist/esm/admin/customer.d.ts +6 -0
  190. package/dist/esm/admin/customer.d.ts.map +1 -1
  191. package/dist/esm/admin/customer.js +3 -0
  192. package/dist/esm/admin/customer.js.map +1 -1
  193. package/dist/esm/admin/exchange.d.ts +6 -4
  194. package/dist/esm/admin/exchange.d.ts.map +1 -1
  195. package/dist/esm/admin/exchange.js +3 -38
  196. package/dist/esm/admin/exchange.js.map +1 -1
  197. package/dist/esm/admin/fulfillment-provider.d.ts +6 -0
  198. package/dist/esm/admin/fulfillment-provider.d.ts.map +1 -1
  199. package/dist/esm/admin/fulfillment-provider.js +3 -0
  200. package/dist/esm/admin/fulfillment-provider.js.map +1 -1
  201. package/dist/esm/admin/fulfillment-set.d.ts +6 -0
  202. package/dist/esm/admin/fulfillment-set.d.ts.map +1 -1
  203. package/dist/esm/admin/fulfillment-set.js +3 -0
  204. package/dist/esm/admin/fulfillment-set.js.map +1 -1
  205. package/dist/esm/admin/fulfillment.d.ts +6 -0
  206. package/dist/esm/admin/fulfillment.d.ts.map +1 -1
  207. package/dist/esm/admin/fulfillment.js +3 -0
  208. package/dist/esm/admin/fulfillment.js.map +1 -1
  209. package/dist/esm/admin/inventory-item.d.ts +6 -0
  210. package/dist/esm/admin/inventory-item.d.ts.map +1 -1
  211. package/dist/esm/admin/inventory-item.js +3 -0
  212. package/dist/esm/admin/inventory-item.js.map +1 -1
  213. package/dist/esm/admin/invite.d.ts +6 -0
  214. package/dist/esm/admin/invite.d.ts.map +1 -1
  215. package/dist/esm/admin/invite.js +3 -0
  216. package/dist/esm/admin/invite.js.map +1 -1
  217. package/dist/esm/admin/notification.d.ts +6 -0
  218. package/dist/esm/admin/notification.d.ts.map +1 -1
  219. package/dist/esm/admin/notification.js +3 -0
  220. package/dist/esm/admin/notification.js.map +1 -1
  221. package/dist/esm/admin/order-edit.d.ts +6 -0
  222. package/dist/esm/admin/order-edit.d.ts.map +1 -1
  223. package/dist/esm/admin/order-edit.js +3 -0
  224. package/dist/esm/admin/order-edit.js.map +1 -1
  225. package/dist/esm/admin/order.d.ts +7 -0
  226. package/dist/esm/admin/order.d.ts.map +1 -1
  227. package/dist/esm/admin/order.js +11 -0
  228. package/dist/esm/admin/order.js.map +1 -1
  229. package/dist/esm/admin/payment-collection.d.ts +6 -0
  230. package/dist/esm/admin/payment-collection.d.ts.map +1 -1
  231. package/dist/esm/admin/payment-collection.js +3 -0
  232. package/dist/esm/admin/payment-collection.js.map +1 -1
  233. package/dist/esm/admin/payment.d.ts +6 -0
  234. package/dist/esm/admin/payment.d.ts.map +1 -1
  235. package/dist/esm/admin/payment.js +3 -0
  236. package/dist/esm/admin/payment.js.map +1 -1
  237. package/dist/esm/admin/price-list.d.ts +6 -0
  238. package/dist/esm/admin/price-list.d.ts.map +1 -1
  239. package/dist/esm/admin/price-list.js +3 -0
  240. package/dist/esm/admin/price-list.js.map +1 -1
  241. package/dist/esm/admin/price-preference.d.ts +6 -0
  242. package/dist/esm/admin/price-preference.d.ts.map +1 -1
  243. package/dist/esm/admin/price-preference.js +3 -0
  244. package/dist/esm/admin/price-preference.js.map +1 -1
  245. package/dist/esm/admin/product-category.d.ts +6 -0
  246. package/dist/esm/admin/product-category.d.ts.map +1 -1
  247. package/dist/esm/admin/product-category.js +3 -0
  248. package/dist/esm/admin/product-category.js.map +1 -1
  249. package/dist/esm/admin/product-collection.d.ts +6 -0
  250. package/dist/esm/admin/product-collection.d.ts.map +1 -1
  251. package/dist/esm/admin/product-collection.js +3 -0
  252. package/dist/esm/admin/product-collection.js.map +1 -1
  253. package/dist/esm/admin/product-tag.d.ts +6 -0
  254. package/dist/esm/admin/product-tag.d.ts.map +1 -1
  255. package/dist/esm/admin/product-tag.js +3 -0
  256. package/dist/esm/admin/product-tag.js.map +1 -1
  257. package/dist/esm/admin/product-type.d.ts +6 -0
  258. package/dist/esm/admin/product-type.d.ts.map +1 -1
  259. package/dist/esm/admin/product-type.js +3 -0
  260. package/dist/esm/admin/product-type.js.map +1 -1
  261. package/dist/esm/admin/product-variant.d.ts +6 -0
  262. package/dist/esm/admin/product-variant.d.ts.map +1 -1
  263. package/dist/esm/admin/product-variant.js +3 -0
  264. package/dist/esm/admin/product-variant.js.map +1 -1
  265. package/dist/esm/admin/product.d.ts +6 -0
  266. package/dist/esm/admin/product.d.ts.map +1 -1
  267. package/dist/esm/admin/product.js +3 -0
  268. package/dist/esm/admin/product.js.map +1 -1
  269. package/dist/esm/admin/promotion.d.ts +6 -0
  270. package/dist/esm/admin/promotion.d.ts.map +1 -1
  271. package/dist/esm/admin/promotion.js +3 -0
  272. package/dist/esm/admin/promotion.js.map +1 -1
  273. package/dist/esm/admin/refund-reasons.d.ts +6 -0
  274. package/dist/esm/admin/refund-reasons.d.ts.map +1 -1
  275. package/dist/esm/admin/refund-reasons.js +3 -0
  276. package/dist/esm/admin/refund-reasons.js.map +1 -1
  277. package/dist/esm/admin/region.d.ts +6 -0
  278. package/dist/esm/admin/region.d.ts.map +1 -1
  279. package/dist/esm/admin/region.js +3 -0
  280. package/dist/esm/admin/region.js.map +1 -1
  281. package/dist/esm/admin/reservation.d.ts +6 -0
  282. package/dist/esm/admin/reservation.d.ts.map +1 -1
  283. package/dist/esm/admin/reservation.js +3 -0
  284. package/dist/esm/admin/reservation.js.map +1 -1
  285. package/dist/esm/admin/return-reason.d.ts +6 -0
  286. package/dist/esm/admin/return-reason.d.ts.map +1 -1
  287. package/dist/esm/admin/return-reason.js +3 -0
  288. package/dist/esm/admin/return-reason.js.map +1 -1
  289. package/dist/esm/admin/return.d.ts +6 -0
  290. package/dist/esm/admin/return.d.ts.map +1 -1
  291. package/dist/esm/admin/return.js +3 -0
  292. package/dist/esm/admin/return.js.map +1 -1
  293. package/dist/esm/admin/sales-channel.d.ts +6 -0
  294. package/dist/esm/admin/sales-channel.d.ts.map +1 -1
  295. package/dist/esm/admin/sales-channel.js +3 -0
  296. package/dist/esm/admin/sales-channel.js.map +1 -1
  297. package/dist/esm/admin/shipping-option.d.ts +6 -0
  298. package/dist/esm/admin/shipping-option.d.ts.map +1 -1
  299. package/dist/esm/admin/shipping-option.js +3 -0
  300. package/dist/esm/admin/shipping-option.js.map +1 -1
  301. package/dist/esm/admin/shipping-profile.d.ts +6 -0
  302. package/dist/esm/admin/shipping-profile.d.ts.map +1 -1
  303. package/dist/esm/admin/shipping-profile.js +3 -0
  304. package/dist/esm/admin/shipping-profile.js.map +1 -1
  305. package/dist/esm/admin/stock-location.d.ts +6 -0
  306. package/dist/esm/admin/stock-location.d.ts.map +1 -1
  307. package/dist/esm/admin/stock-location.js +3 -0
  308. package/dist/esm/admin/stock-location.js.map +1 -1
  309. package/dist/esm/admin/store.d.ts +6 -0
  310. package/dist/esm/admin/store.d.ts.map +1 -1
  311. package/dist/esm/admin/store.js +3 -0
  312. package/dist/esm/admin/store.js.map +1 -1
  313. package/dist/esm/admin/tax-rate.d.ts +6 -0
  314. package/dist/esm/admin/tax-rate.d.ts.map +1 -1
  315. package/dist/esm/admin/tax-rate.js +3 -0
  316. package/dist/esm/admin/tax-rate.js.map +1 -1
  317. package/dist/esm/admin/tax-region.d.ts +6 -0
  318. package/dist/esm/admin/tax-region.d.ts.map +1 -1
  319. package/dist/esm/admin/tax-region.js +3 -0
  320. package/dist/esm/admin/tax-region.js.map +1 -1
  321. package/dist/esm/admin/upload.d.ts +6 -0
  322. package/dist/esm/admin/upload.d.ts.map +1 -1
  323. package/dist/esm/admin/upload.js +3 -0
  324. package/dist/esm/admin/upload.js.map +1 -1
  325. package/dist/esm/admin/user.d.ts +6 -0
  326. package/dist/esm/admin/user.d.ts.map +1 -1
  327. package/dist/esm/admin/user.js +3 -0
  328. package/dist/esm/admin/user.js.map +1 -1
  329. package/dist/esm/admin/workflow-execution.d.ts +6 -0
  330. package/dist/esm/admin/workflow-execution.d.ts.map +1 -1
  331. package/dist/esm/admin/workflow-execution.js +3 -0
  332. package/dist/esm/admin/workflow-execution.js.map +1 -1
  333. package/dist/esm/auth/index.d.ts +156 -0
  334. package/dist/esm/auth/index.d.ts.map +1 -1
  335. package/dist/esm/auth/index.js +152 -1
  336. package/dist/esm/auth/index.js.map +1 -1
  337. package/dist/esm/store/index.d.ts +973 -83
  338. package/dist/esm/store/index.d.ts.map +1 -1
  339. package/dist/esm/store/index.js +946 -0
  340. package/dist/esm/store/index.js.map +1 -1
  341. package/dist/esm/types.d.ts +5 -0
  342. package/dist/esm/types.d.ts.map +1 -1
  343. package/dist/store/index.d.ts +973 -83
  344. package/dist/store/index.d.ts.map +1 -1
  345. package/dist/store/index.js +946 -0
  346. package/dist/store/index.js.map +1 -1
  347. package/dist/types.d.ts +5 -0
  348. package/dist/types.d.ts.map +1 -1
  349. package/package.json +2 -2
@@ -2,114 +2,1004 @@ import { FindParams, HttpTypes, SelectParams } from "@medusajs/types";
2
2
  import { Client } from "../client";
3
3
  import { ClientHeaders } from "../types";
4
4
  export declare class Store {
5
+ /**
6
+ * @ignore
7
+ */
5
8
  private client;
9
+ /**
10
+ * @ignore
11
+ */
6
12
  constructor(client: Client);
7
13
  region: {
8
- list: (query?: FindParams & HttpTypes.StoreRegionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
9
- regions: HttpTypes.StoreRegion[];
10
- }>>;
11
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
12
- region: HttpTypes.StoreRegion;
13
- }>;
14
+ /**
15
+ * This method retrieves the paginated list of regions in the store. It sends a request to the
16
+ * [List Regions API route](https://docs.medusajs.com/v2/api/store#regions_getregions).
17
+ *
18
+ * Related guide: [How to list regions in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/regions/list).
19
+ *
20
+ * @param query - Filters and pagination configurations.
21
+ * @param headers - Headers to pass in the request
22
+ * @returns The paginated list of regions.
23
+ *
24
+ * @example
25
+ * To retrieve the list of regions:
26
+ *
27
+ * ```ts
28
+ * sdk.store.region.list()
29
+ * .then(({ regions, count, limit, offset }) => {
30
+ * console.log(regions)
31
+ * })
32
+ * ```
33
+ *
34
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
35
+ *
36
+ * For example, to retrieve only 10 items and skip 10 items:
37
+ *
38
+ * ```ts
39
+ * sdk.store.region.list({
40
+ * limit: 10,
41
+ * offset: 10
42
+ * })
43
+ * .then(({ regions, count, limit, offset }) => {
44
+ * console.log(regions)
45
+ * })
46
+ * ```
47
+ *
48
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
49
+ * in each region:
50
+ *
51
+ * ```ts
52
+ * sdk.store.region.list({
53
+ * fields: "id,*countries"
54
+ * })
55
+ * .then(({ regions, count, limit, offset }) => {
56
+ * console.log(regions)
57
+ * })
58
+ * ```
59
+ *
60
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
61
+ */
62
+ list: (query?: FindParams & HttpTypes.StoreRegionFilters, headers?: ClientHeaders) => Promise<HttpTypes.StoreRegionListResponse>;
63
+ /**
64
+ * This method retrieves a region by its ID. It sends a request to the [Get Region](https://docs.medusajs.com/v2/api/store#regions_getregionsid)
65
+ * API route.
66
+ *
67
+ * Related guide: [Store and retrieve regions in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/regions/store-retrieve-region).
68
+ *
69
+ * @param id - The region's ID.
70
+ * @param query - Configure the fields to retrieve in the region.
71
+ * @param headers - Headers to pass in the request
72
+ * @returns The region.
73
+ *
74
+ * @example
75
+ * To retrieve a region by its ID:
76
+ *
77
+ * ```ts
78
+ * sdk.store.region.retrieve("reg_123")
79
+ * .then(({ region }) => {
80
+ * console.log(region)
81
+ * })
82
+ * ```
83
+ *
84
+ * To specify the fields and relations to retrieve:
85
+ *
86
+ * ```ts
87
+ * sdk.store.region.retrieve(
88
+ * "reg_123",
89
+ * {
90
+ * fields: "id,*countries"
91
+ * }
92
+ * )
93
+ * .then(({ region }) => {
94
+ * console.log(region)
95
+ * })
96
+ * ```
97
+ *
98
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
99
+ */
100
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreRegionResponse>;
14
101
  };
15
102
  collection: {
16
- list: (query?: FindParams & HttpTypes.StoreCollectionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
17
- collections: HttpTypes.StoreCollection[];
18
- }>>;
19
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
20
- collection: HttpTypes.StoreCollection;
21
- }>;
103
+ /**
104
+ * This method retrieves a paginated list of product collections. It sends a request to the
105
+ * [List Collections](https://docs.medusajs.com/v2/api/store#collections_getcollections) API route.
106
+ *
107
+ * Related guide: [How to retrieve collections in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/collections/list).
108
+ *
109
+ * @param query - Filters and pagination configurations.
110
+ * @param headers - Headers to pass in the request
111
+ * @returns The paginated list of collections.
112
+ *
113
+ * @example
114
+ * To retrieve the list of collections:
115
+ *
116
+ * ```ts
117
+ * sdk.store.collection.list()
118
+ * .then(({ collections, count, limit, offset }) => {
119
+ * console.log(collections)
120
+ * })
121
+ * ```
122
+ *
123
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
124
+ *
125
+ * For example, to retrieve only 10 items and skip 10 items:
126
+ *
127
+ * ```ts
128
+ * sdk.store.collection.list({
129
+ * limit: 10,
130
+ * offset: 10
131
+ * })
132
+ * .then(({ collections, count, limit, offset }) => {
133
+ * console.log(collections)
134
+ * })
135
+ * ```
136
+ *
137
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
138
+ * in each collection:
139
+ *
140
+ * ```ts
141
+ * sdk.store.collection.list({
142
+ * fields: "id,handle"
143
+ * })
144
+ * .then(({ collections, count, limit, offset }) => {
145
+ * console.log(collections)
146
+ * })
147
+ * ```
148
+ *
149
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
150
+ */
151
+ list: (query?: FindParams & HttpTypes.StoreCollectionFilters, headers?: ClientHeaders) => Promise<HttpTypes.StoreCollectionListResponse>;
152
+ /**
153
+ * This method retrieves a collection by its ID. It sends a request to the [Get Collection](https://docs.medusajs.com/v2/api/store#collections_getcollectionsid)
154
+ * API route.
155
+ *
156
+ * Related guide: [How to retrieve a collection in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/collections/retrieve).
157
+ *
158
+ * @param id - The ID of the collection to retrieve.
159
+ * @param query - Configure the fields to retrieve in the collection.
160
+ * @param headers - Headers to pass in the request
161
+ * @returns The collection.
162
+ *
163
+ * @example
164
+ * To retrieve a collection by its ID:
165
+ *
166
+ * ```ts
167
+ * sdk.store.collection.retrieve("pcol_123")
168
+ * .then(({ collection }) => {
169
+ * console.log(collection)
170
+ * })
171
+ * ```
172
+ *
173
+ * To specify the fields and relations to retrieve:
174
+ *
175
+ * ```ts
176
+ * sdk.store.collection.retrieve("pcol_123", {
177
+ * fields: "id,handle"
178
+ * })
179
+ * .then(({ collection }) => {
180
+ * console.log(collection)
181
+ * })
182
+ * ```
183
+ *
184
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
185
+ */
186
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCollectionResponse>;
22
187
  };
23
188
  category: {
24
- list: (query?: HttpTypes.StoreProductCategoryParams, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
25
- product_categories: HttpTypes.StoreProductCategory[];
26
- }>>;
27
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
28
- product_category: HttpTypes.StoreProductCategory;
29
- }>;
189
+ /**
190
+ * This method retrieves a paginated list of product categories. It sends a request to the
191
+ * [List Categories](https://docs.medusajs.com/v2/api/store#product-categories_getproductcategories) API route.
192
+ *
193
+ * Related guide: [How to retrieve list of categories in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/categories/list).
194
+ *
195
+ * @param query - Filters and pagination configurations.
196
+ * @param headers - Headers to pass in the request.
197
+ * @returns The paginated list of categoreis.
198
+ *
199
+ * @example
200
+ * To retrieve the list of categoreis:
201
+ *
202
+ * ```ts
203
+ * sdk.store.category.list()
204
+ * .then(({ product_categories, count, offset, limit }) => {
205
+ * console.log(product_categories)
206
+ * })
207
+ * ```
208
+ *
209
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
210
+ *
211
+ * For example, to retrieve only 10 items and skip 10 items:
212
+ *
213
+ * ```ts
214
+ * sdk.store.category.list({
215
+ * limit: 10,
216
+ * offset: 10
217
+ * })
218
+ * .then(({ product_categories, count, offset, limit }) => {
219
+ * console.log(product_categories)
220
+ * })
221
+ * ```
222
+ *
223
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
224
+ * in each category:
225
+ *
226
+ * ```ts
227
+ * sdk.store.category.list({
228
+ * fields: "id,*parent_category"
229
+ * })
230
+ * .then(({ product_categories, count, offset, limit }) => {
231
+ * console.log(product_categories)
232
+ * })
233
+ * ```
234
+ *
235
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
236
+ */
237
+ list: (query?: FindParams & HttpTypes.StoreProductCategoryListParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreProductCategoryListResponse>;
238
+ /**
239
+ * This method retrieves a category by its ID. It sends a request to the
240
+ * [Retrieve Product Category](https://docs.medusajs.com/v2/api/store#product-categories_getproductcategoriesid).
241
+ *
242
+ * Related guide: [How to retrieve a category in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/categories/retrieve).
243
+ *
244
+ * @param id - The ID of the category to retrieve.
245
+ * @param query - Configure the fields to retrieve in the category.
246
+ * @param headers - Headers to pass in the request
247
+ * @returns The category.
248
+ *
249
+ * @example
250
+ * To retrieve a category by its ID:
251
+ *
252
+ * ```ts
253
+ * sdk.store.category.retrieve("pcat_123")
254
+ * .then(({ product_category }) => {
255
+ * console.log(product_category)
256
+ * })
257
+ * ```
258
+ *
259
+ * To specify the fields and relations to retrieve:
260
+ *
261
+ * ```ts
262
+ * sdk.store.category.retrieve("pcat_123", {
263
+ * fields: "id,*parent_category"
264
+ * })
265
+ * .then(({ product_category }) => {
266
+ * console.log(product_category)
267
+ * })
268
+ * ```
269
+ *
270
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
271
+ */
272
+ retrieve: (id: string, query?: HttpTypes.StoreProductCategoryParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreProductCategoryResponse>;
30
273
  };
31
274
  product: {
275
+ /**
276
+ * This method retrieves a list of products. It sends a request to the
277
+ * [List Products API route](https://docs.medusajs.com/v2/api/store#products_getproducts).
278
+ *
279
+ * Related guides:
280
+ *
281
+ * - [How to list products in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/list).
282
+ * - [How to retrieve a product variant's prices in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/price)
283
+ *
284
+ * @param query - Filters and pagination configurations.
285
+ * @param headers - Headers to pass in the request.
286
+ * @returns The paginated list of products.
287
+ *
288
+ * @example
289
+ * To retrieve the list of products:
290
+ *
291
+ * ```ts
292
+ * sdk.store.product.list()
293
+ * .then(({ products, count, offset, limit }) => {
294
+ * console.log(products)
295
+ * })
296
+ * ```
297
+ *
298
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
299
+ *
300
+ * For example, to retrieve only 10 items and skip 10 items:
301
+ *
302
+ * ```ts
303
+ * sdk.store.product.list({
304
+ * limit: 10,
305
+ * offset: 10
306
+ * })
307
+ * .then(({ products, count, offset, limit }) => {
308
+ * console.log(products)
309
+ * })
310
+ * ```
311
+ *
312
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
313
+ * in each product:
314
+ *
315
+ * ```ts
316
+ * sdk.store.product.list({
317
+ * fields: "id,*collection"
318
+ * })
319
+ * .then(({ products, count, offset, limit }) => {
320
+ * console.log(products)
321
+ * })
322
+ * ```
323
+ *
324
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
325
+ */
32
326
  list: (query?: HttpTypes.StoreProductParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreProductListResponse>;
327
+ /**
328
+ * This method is used to retrieve a product by its ID. It sends a request to the
329
+ * [Get Product](https://docs.medusajs.com/v2/api/store#products_getproductsid) API route.
330
+ *
331
+ * Related guides:
332
+ *
333
+ * - [How to retrieve a product in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/retrieve).
334
+ * - [How to retrieve a product variant's prices in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/products/price)
335
+ *
336
+ * @param id - The product's ID.
337
+ * @param query - Configure the fields to retrieve in the product.
338
+ * @param headers - Headers to pass in the request
339
+ * @returns The product.
340
+ *
341
+ * @example
342
+ * To retrieve a product by its ID:
343
+ *
344
+ * ```ts
345
+ * sdk.store.product.retrieve("prod_123")
346
+ * .then(({ product }) => {
347
+ * console.log(product)
348
+ * })
349
+ * ```
350
+ *
351
+ * To specify the fields and relations to retrieve:
352
+ *
353
+ * ```ts
354
+ * sdk.store.product.retrieve("prod_123", {
355
+ * fields: "id,*collection"
356
+ * })
357
+ * .then(({ product }) => {
358
+ * console.log(product)
359
+ * })
360
+ * ```
361
+ *
362
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
363
+ */
33
364
  retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreProductResponse>;
34
365
  };
366
+ /**
367
+ * Related guides: [How to implement carts in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart).
368
+ */
35
369
  cart: {
36
- create: (body: HttpTypes.StoreCreateCart, query?: SelectParams, headers?: ClientHeaders) => Promise<{
37
- cart: HttpTypes.StoreCart;
38
- }>;
39
- update: (id: string, body: HttpTypes.StoreUpdateCart, query?: SelectParams, headers?: ClientHeaders) => Promise<{
40
- cart: HttpTypes.StoreCart;
41
- }>;
42
- retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
43
- cart: HttpTypes.StoreCart;
44
- }>;
45
- createLineItem: (cartId: string, body: HttpTypes.StoreAddCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<{
46
- cart: HttpTypes.StoreCart;
47
- }>;
48
- updateLineItem: (cartId: string, lineItemId: string, body: HttpTypes.StoreUpdateCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<{
49
- cart: HttpTypes.StoreCart;
50
- }>;
370
+ /**
371
+ * This method creates a cart. It sends a request to the [Create Cart](https://docs.medusajs.com/v2/api/store#carts_postcarts)
372
+ * API route.
373
+ *
374
+ * Related guide: [How to create a cart in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart/create).
375
+ *
376
+ * @param body - The details of the cart to create.
377
+ * @param query - Configure the fields to retrieve in the cart.
378
+ * @param headers - Headers to pass in the request.
379
+ * @returns The created cart.
380
+ *
381
+ * @example
382
+ * sdk.store.cart.create({
383
+ * region_id: "reg_123"
384
+ * })
385
+ * .then(({ cart }) => {
386
+ * console.log(cart)
387
+ * })
388
+ */
389
+ create: (body: HttpTypes.StoreCreateCart, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCartResponse>;
390
+ /**
391
+ * This method updates a cart. It sends a request to the
392
+ * [Update Cart](https://docs.medusajs.com/v2/api/store#carts_postcartsid) API route.
393
+ *
394
+ * Related guide: [How to update a cart in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart/update).
395
+ *
396
+ * @param id - The cart's ID.
397
+ * @param body - The data to update in the cart.
398
+ * @param query - Configure the fields to retrieve in the cart.
399
+ * @param headers - Headers to pass in the request.
400
+ * @returns The updated cart.
401
+ *
402
+ * @example
403
+ * sdk.store.cart.update("cart_123", {
404
+ * region_id: "reg_123"
405
+ * })
406
+ * .then(({ cart }) => {
407
+ * console.log(cart)
408
+ * })
409
+ */
410
+ update: (id: string, body: HttpTypes.StoreUpdateCart, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCartResponse>;
411
+ /**
412
+ * This method retrieves a cart by its ID. It sends a request to the
413
+ * [Get Cart](https://docs.medusajs.com/v2/api/store#carts_getcartsid) API route.
414
+ *
415
+ * Related guide: [How to retrieve a cart in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart/retrieve).
416
+ *
417
+ * @param id - The cart's ID.
418
+ * @param query - Configure the fields to retrieve in the cart.
419
+ * @param headers - Headers to pass in the request.
420
+ * @returns The cart's details.
421
+ *
422
+ * @example
423
+ * To retrieve a cart by its ID:
424
+ *
425
+ * ```ts
426
+ * sdk.store.cart.retrieve("cart_123")
427
+ * .then(({ cart }) => {
428
+ * console.log(cart)
429
+ * })
430
+ * ```
431
+ *
432
+ * To specify the fields and relations to retrieve:
433
+ *
434
+ * ```ts
435
+ * sdk.store.cart.retrieve("cart_123", {
436
+ * fields: "id,*items"
437
+ * })
438
+ * .then(({ cart }) => {
439
+ * console.log(cart)
440
+ * })
441
+ * ```
442
+ *
443
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
444
+ */
445
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCartResponse>;
446
+ /**
447
+ * This methods adds a product variant to the cart as a line item. It sends a request to the
448
+ * [Add Line Item](https://docs.medusajs.com/v2/api/store#carts_postcartsidlineitems) API route.
449
+ *
450
+ * Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart/manage-items).
451
+ *
452
+ * @param cartId - The cart's ID.
453
+ * @param body - The details of the item to add.
454
+ * @param query - Configure the fields to retrieve in the cart.
455
+ * @param headers - Headers to pass in the request.
456
+ * @returns The cart's details.
457
+ *
458
+ * @example
459
+ * sdk.store.cart.createLineItem("cart_123", {
460
+ * variant_id: "variant_123",
461
+ * quantity: 1
462
+ * })
463
+ * .then(({ cart }) => {
464
+ * console.log(cart)
465
+ * })
466
+ */
467
+ createLineItem: (cartId: string, body: HttpTypes.StoreAddCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCartResponse>;
468
+ /**
469
+ * This method updates a line item in a cart. It sends a request to the
470
+ * [Update Line Item](https://docs.medusajs.com/v2/api/store#carts_postcartsidlineitemsline_id) API route.
471
+ *
472
+ * Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart/manage-items).
473
+ *
474
+ * @param cartId - The cart's ID.
475
+ * @param lineItemId - The line item's ID.
476
+ * @param body - The data to update.
477
+ * @param query - Configure the fields to retrieve in the cart.
478
+ * @param headers - Headers to pass in the request.
479
+ * @returns The cart's details.
480
+ *
481
+ * @example
482
+ * sdk.store.cart.updateLineItem(
483
+ * "cart_123",
484
+ * "li_123",
485
+ * {
486
+ * quantity: 1
487
+ * }
488
+ * )
489
+ * .then(({ cart }) => {
490
+ * console.log(cart)
491
+ * })
492
+ */
493
+ updateLineItem: (cartId: string, lineItemId: string, body: HttpTypes.StoreUpdateCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCartResponse>;
494
+ /**
495
+ * This method deletes a line item from a cart. It sends a request to the
496
+ * [Remove Line Item](https://docs.medusajs.com/v2/api/store#carts_deletecartsidlineitemsline_id) API route.
497
+ *
498
+ * Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/cart/manage-items).
499
+ *
500
+ * @param cartId - The cart's ID.
501
+ * @param lineItemId - The item's ID.
502
+ * @param headers - Headers to pass in the request.
503
+ * @returns The deletion's details.
504
+ *
505
+ * @example
506
+ * sdk.store.cart.deleteLineItem(
507
+ * "cart_123",
508
+ * "li_123"
509
+ * )
510
+ * .then(({ deleted, parent: cart }) => {
511
+ * console.log(deleted, cart)
512
+ * })
513
+ */
51
514
  deleteLineItem: (cartId: string, lineItemId: string, headers?: ClientHeaders) => Promise<HttpTypes.StoreLineItemDeleteResponse>;
52
- addShippingMethod: (cartId: string, body: HttpTypes.StoreAddCartShippingMethods, query?: SelectParams, headers?: ClientHeaders) => Promise<{
53
- cart: HttpTypes.StoreCart;
54
- }>;
55
- complete: (cartId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
56
- type: "order";
57
- order: HttpTypes.StoreOrder;
58
- } | {
59
- type: "cart";
60
- cart: HttpTypes.StoreCart;
61
- error: {
62
- message: string;
63
- name: string;
64
- type: string;
65
- };
66
- }>;
515
+ /**
516
+ * This method adds a shipping method to a cart. It sends a request to
517
+ * the [Add Shipping Method](https://docs.medusajs.com/v2/api/store#carts_postcartsidshippingmethods) API routes.
518
+ *
519
+ * Related guide: [Implement shipping step during checkout](https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping).
520
+ *
521
+ * @param cartId - The cart's ID.
522
+ * @param body - The shipping method's details.
523
+ * @param query - Configure the fields to retrieve in the cart.
524
+ * @param headers - Headers to pass in the request.
525
+ * @returns The cart's details.
526
+ *
527
+ * @example
528
+ * sdk.store.cart.addShippingMethod("cart_123", {
529
+ * option_id: "so_123",
530
+ * data: {
531
+ * // custom data for fulfillment provider.
532
+ * }
533
+ * })
534
+ * .then(({ cart }) => {
535
+ * console.log(cart)
536
+ * })
537
+ */
538
+ addShippingMethod: (cartId: string, body: HttpTypes.StoreAddCartShippingMethods, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCartResponse>;
539
+ /**
540
+ * This method completes a cart and places the order. It's the last step of the checkout flow.
541
+ * The method sends a request to the [Complete Cart](https://docs.medusajs.com/v2/api/store#carts_postcartsidcomplete)
542
+ * API route.
543
+ *
544
+ * Related guide: [Learn how to complete cart in checkout flow](https://docs.medusajs.com/v2/resources/storefront-development/checkout/complete-cart).
545
+ *
546
+ * @param cartId - The cart's ID.
547
+ * @param query - Configure the fields to retrieve in the created order.
548
+ * @param headers - Headers to pass in the request.
549
+ * @returns The order's details, if it was placed successfully. Otherwise, the cart is returned with an error.
550
+ *
551
+ * @example
552
+ * sdk.store.cart.complete("cart_123")
553
+ * .then((data) => {
554
+ * if(data.type === "cart") {
555
+ * // an error occurred
556
+ * console.log(data.error, data.cart)
557
+ * } else {
558
+ * // order placed successfully
559
+ * console.log(data.order)
560
+ * }
561
+ * })
562
+ */
563
+ complete: (cartId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCompleteCartResponse>;
67
564
  };
68
565
  fulfillment: {
69
- listCartOptions: (query?: FindParams & {
70
- cart_id: string;
71
- }, headers?: ClientHeaders) => Promise<{
72
- shipping_options: HttpTypes.StoreCartShippingOption[];
73
- }>;
566
+ /**
567
+ * This method retrieves the list of shipping options for a cart. It sends a request to
568
+ * the [List Shipping Options](https://docs.medusajs.com/v2/api/store#shipping-options_getshippingoptions)
569
+ * API route.
570
+ *
571
+ * Related guide: [Implement shipping step during checkout](https://docs.medusajs.com/v2/resources/storefront-development/checkout/shipping).
572
+ *
573
+ * @param query - The cart's details along with configurations of the fields to retrieve in the options.
574
+ * @param headers - Headers to pass in the request.
575
+ * @returns The shipping options that can be used for the cart.
576
+ *
577
+ * @example
578
+ * sdk.store.fulfillment.listCartOptions({
579
+ * cart_id: "cart_123"
580
+ * })
581
+ * .then(({ shipping_options }) => {
582
+ * console.log(shipping_options)
583
+ * })
584
+ */
585
+ listCartOptions: (query?: HttpTypes.StoreGetShippingOptionList, headers?: ClientHeaders) => Promise<HttpTypes.StoreShippingOptionListResponse>;
74
586
  };
75
587
  payment: {
76
- listPaymentProviders: (query?: FindParams & HttpTypes.StorePaymentProviderFilters, headers?: ClientHeaders) => Promise<{
77
- payment_providers: HttpTypes.StorePaymentProvider[];
78
- }>;
79
- initiatePaymentSession: (cart: HttpTypes.StoreCart, body: Record<string, any>, query?: SelectParams, headers?: ClientHeaders) => Promise<{
80
- payment_collection: HttpTypes.StorePaymentCollection;
81
- }>;
588
+ /**
589
+ * This method retrieves the payment providers available in a region, which is useful during checkout.
590
+ * It sends a request to the [List Payment Providers](https://docs.medusajs.com/v2/api/store#payment-providers_getpaymentproviders)
591
+ * API route.
592
+ *
593
+ * Related guide: [Implement payment step during checkout](https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment).
594
+ *
595
+ * @param query - The filters to apply on the retrieved providers, along with configurations of the
596
+ * fields to retrieve in the options.
597
+ * @param headers - Headers to pass in the request.
598
+ * @returns The list of payment providers.
599
+ *
600
+ * @example
601
+ * To retrieve the list of payment providers for a region:
602
+ *
603
+ * ```ts
604
+ * sdk.store.payment.listPaymentProviders({
605
+ * region_id: "reg_123"
606
+ * })
607
+ * .then(({ payment_providers, count, offset, limit }) => {
608
+ * console.log(payment_providers)
609
+ * })
610
+ * ```
611
+ *
612
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
613
+ *
614
+ * For example, to retrieve only 10 items and skip 10 items:
615
+ *
616
+ * ```ts
617
+ * sdk.store.payment.listPaymentProviders({
618
+ * region_id: "reg_123",
619
+ * limit: 10,
620
+ * offset: 10
621
+ * })
622
+ * .then(({ payment_providers, count, offset, limit }) => {
623
+ * console.log(payment_providers)
624
+ * })
625
+ * ```
626
+ *
627
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
628
+ * in each provider:
629
+ *
630
+ * ```ts
631
+ * sdk.store.payment.listPaymentProviders({
632
+ * region_id: "reg_123",
633
+ * limit: 10,
634
+ * offset: 10,
635
+ * fields: "id"
636
+ * })
637
+ * .then(({ payment_providers, count, offset, limit }) => {
638
+ * console.log(payment_providers)
639
+ * })
640
+ * ```
641
+ *
642
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
643
+ */
644
+ listPaymentProviders: (query?: FindParams & HttpTypes.StorePaymentProviderFilters, headers?: ClientHeaders) => Promise<HttpTypes.StorePaymentProviderListResponse>;
645
+ /**
646
+ * This method creates a payment session of a cart's payment collection, selecting a payment provider.
647
+ * It sends a request to the [Initialize Payment Session](https://docs.medusajs.com/v2/api/store#payment-collections_postpaymentcollectionsidpaymentsessions)
648
+ * API route.
649
+ *
650
+ * If the cart doesn't have a payment collection, a payment collection is created for the cart by
651
+ * sending a request to the [Create Payment Collection](https://docs.medusajs.com/v2/api/store#payment-collections_postpaymentcollections)
652
+ * API route.
653
+ *
654
+ * Related guide: [Implement payment step during checkout](https://docs.medusajs.com/v2/resources/storefront-development/checkout/payment).
655
+ *
656
+ * @param cart - The cart's details.
657
+ * @param body - The payment session's details.
658
+ * @param query - Configure the fields to retrieve in the payment collection.
659
+ * @param headers - Headers to pass in the request.
660
+ * @returns The payment collection's details.
661
+ *
662
+ * @example
663
+ * sdk.store.payment.initiatePaymentSession(
664
+ * cart, // assuming you already have the cart object.
665
+ * {
666
+ * provider_id: "pp_stripe_stripe",
667
+ * data: {
668
+ * // any data relevant for the provider.
669
+ * }
670
+ * }
671
+ * )
672
+ * .then(({ payment_collection }) => {
673
+ * console.log(payment_collection)
674
+ * })
675
+ */
676
+ initiatePaymentSession: (cart: HttpTypes.StoreCart, body: HttpTypes.StoreInitializePaymentSession, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StorePaymentCollectionResponse>;
82
677
  };
83
678
  order: {
84
- list: (query?: FindParams & HttpTypes.StoreOrderFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
85
- orders: HttpTypes.StoreOrder[];
86
- }>>;
679
+ /**
680
+ * This method retrieves a paginated list of orders matching the specified filters. It
681
+ * sends a request to the [List Orders](https://docs.medusajs.com/v2/api/store#orders_getorders)
682
+ * API route.
683
+ *
684
+ * @param query - Configure the fields to retrieve in the orders.
685
+ * @param headers - Headers to pass in the request.
686
+ * @returns The paginated list of orders.
687
+ *
688
+ * @example
689
+ * To retrieve the list of orders:
690
+ *
691
+ * ```ts
692
+ * sdk.store.order.list()
693
+ * .then(({ orders, count, offset, limit }) => {
694
+ * console.log(orders)
695
+ * })
696
+ * ```
697
+ *
698
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
699
+ *
700
+ * For example, to retrieve only 10 items and skip 10 items:
701
+ *
702
+ * ```ts
703
+ * sdk.store.order.list({
704
+ * limit: 10,
705
+ * offset: 10
706
+ * })
707
+ * .then(({ orders, count, offset, limit }) => {
708
+ * console.log(orders)
709
+ * })
710
+ * ```
711
+ *
712
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
713
+ * in each order:
714
+ *
715
+ * ```ts
716
+ * sdk.store.order.list({
717
+ * fields: "id,*items"
718
+ * })
719
+ * .then(({ orders, count, offset, limit }) => {
720
+ * console.log(orders)
721
+ * })
722
+ * ```
723
+ *
724
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
725
+ */
726
+ list: (query?: HttpTypes.StoreOrderFilters, headers?: ClientHeaders) => Promise<HttpTypes.StoreOrderListResponse>;
727
+ /**
728
+ * This method retrieves an order by its ID. It sends a request to the
729
+ * [Get Order](https://docs.medusajs.com/v2/api/store#orders_getordersid) API route.
730
+ *
731
+ * @param id - The order's ID.
732
+ * @param query - Configure the fields to retrieve in the order.
733
+ * @param headers - Headers to pass in the request.
734
+ * @returns The order's details.
735
+ *
736
+ * @example
737
+ * To retrieve an order by its ID:
738
+ *
739
+ * ```ts
740
+ * sdk.store.order.retrieve("order_123")
741
+ * .then(({ order }) => {
742
+ * console.log(order)
743
+ * })
744
+ * ```
745
+ *
746
+ * To specify the fields and relations to retrieve:
747
+ *
748
+ * ```ts
749
+ * sdk.store.order.retrieve("order_123", {
750
+ * fields: "id,*items"
751
+ * })
752
+ * .then(({ order }) => {
753
+ * console.log(order)
754
+ * })
755
+ * ```
756
+ *
757
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
758
+ */
87
759
  retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
88
760
  order: HttpTypes.StoreOrder;
89
761
  }>;
90
762
  };
91
763
  customer: {
92
- create: (body: HttpTypes.StoreCreateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
93
- customer: HttpTypes.StoreCustomer;
94
- }>;
95
- update: (body: HttpTypes.StoreUpdateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
96
- customer: HttpTypes.StoreCustomer;
97
- }>;
98
- retrieve: (query?: SelectParams, headers?: ClientHeaders) => Promise<{
99
- customer: HttpTypes.StoreCustomer;
100
- }>;
101
- createAddress: (body: HttpTypes.StoreCreateCustomerAddress, query?: SelectParams, headers?: ClientHeaders) => Promise<{
102
- customer: HttpTypes.StoreCustomer;
103
- }>;
104
- updateAddress: (addressId: string, body: HttpTypes.StoreUpdateCustomerAddress, query?: SelectParams, headers?: ClientHeaders) => Promise<{
105
- customer: HttpTypes.StoreCustomer;
106
- }>;
107
- listAddress: (query?: FindParams & HttpTypes.StoreCustomerAddressFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
108
- addresses: HttpTypes.StoreCustomerAddress[];
109
- }>>;
110
- retrieveAddress: (addressId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
111
- address: HttpTypes.StoreCustomerAddress;
112
- }>;
764
+ /**
765
+ * This method registers a customer. It sends a request to the [Register Customer](https://docs.medusajs.com/v2/api/store#customers_postcustomers)
766
+ * API route.
767
+ *
768
+ * You must use the {@link Auth.register} method first to retrieve a registration token. Then, pass that
769
+ * registration token in the `headers` parameter of this method as an authorization bearer header.
770
+ *
771
+ * Related guide: [How to register customer in storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/register)
772
+ *
773
+ * @param body - The customer's details.
774
+ * @param query - Configure the fields to retrieve in the customer.
775
+ * @param headers - Headers to pass in the request. This is where you include the authorization JWT registration token.
776
+ * @returns The customer's details.
777
+ *
778
+ * @example
779
+ * const token = await sdk.auth.register("customer", "emailpass", {
780
+ * "email": "customer@gmail.com",
781
+ * "password": "supersecret"
782
+ * })
783
+ *
784
+ * sdk.store.customer.create(
785
+ * {
786
+ * "email": "customer@gmail.com"
787
+ * },
788
+ * {},
789
+ * {
790
+ * authorization: `Bearer ${token}`
791
+ * }
792
+ * )
793
+ * .then(({ customer }) => {
794
+ * console.log(customer)
795
+ * })
796
+ */
797
+ create: (body: HttpTypes.StoreCreateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerResponse>;
798
+ /**
799
+ * This method updates the logged-in customer's details. The customer must be logged in
800
+ * first with the {@link Auth.login} method.
801
+ *
802
+ * It sends a request to the
803
+ * [Update Customer](https://docs.medusajs.com/v2/api/store#customers_postcustomersme) API route.
804
+ *
805
+ * Related guide: [How to edit customer's profile in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/profile).
806
+ *
807
+ * @param body - The customer's details to update.
808
+ * @param query - Configure the fields to retrieve in the customer.
809
+ * @param headers - Headers to pass in the request.
810
+ * @returns The customer's details.
811
+ *
812
+ * @example
813
+ * sdk.store.customer.update({
814
+ * first_name: "John"
815
+ * })
816
+ * .then(({ customer }) => {
817
+ * console.log(customer)
818
+ * })
819
+ */
820
+ update: (body: HttpTypes.StoreUpdateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerResponse>;
821
+ /**
822
+ * This method retrieves the logged-in customer's details. The customer must be logged in
823
+ * first with the {@link Auth.login} method.
824
+ *
825
+ * It sends a request to the [Get Logged-In Customer](https://docs.medusajs.com/v2/api/store#customers_getcustomersme)
826
+ * API route.
827
+ *
828
+ * @param query - Configure the fields to retrieve in the customer.
829
+ * @param headers - Headers to pass in the request.
830
+ * @returns The customer's details.
831
+ *
832
+ * @example
833
+ * sdk.store.customer.retrieve()
834
+ * .then(({ customer }) => {
835
+ * console.log(customer)
836
+ * })
837
+ */
838
+ retrieve: (query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerResponse>;
839
+ /**
840
+ * This method creates an address for the logged-in customer. The customer must be logged in
841
+ * first with the {@link Auth.login} method.
842
+ *
843
+ * It sends a request to the [Create Address](https://docs.medusajs.com/v2/api/store#customers_postcustomersmeaddresses)
844
+ * API route.
845
+ *
846
+ * Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/addresses)
847
+ *
848
+ * @param body - The address's details.
849
+ * @param query - Configure the fields to retrieve in the customer.
850
+ * @param headers - Headers to pass in the request.
851
+ * @returns The customer's details.
852
+ *
853
+ * @example
854
+ * sdk.store.customer.createAddress({
855
+ * country_code: "us"
856
+ * })
857
+ * .then(({ customer }) => {
858
+ * console.log(customer)
859
+ * })
860
+ */
861
+ createAddress: (body: HttpTypes.StoreCreateCustomerAddress, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerResponse>;
862
+ /**
863
+ * This method updates the address of the logged-in customer. The customer must be logged in
864
+ * first with the {@link Auth.login} method.
865
+ *
866
+ * It sends a request to the [Update Address](https://docs.medusajs.com/v2/api/store#customers_postcustomersmeaddressesaddress_id)
867
+ * API route.
868
+ *
869
+ * Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/addresses)
870
+ *
871
+ * @param addressId - The ID of the address to update.
872
+ * @param body - The details to update in the address.
873
+ * @param query - Configure the fields to retrieve in the customer.
874
+ * @param headers - Headers to pass in the request.
875
+ * @returns The customer's details.
876
+ *
877
+ * @example
878
+ * sdk.store.customer.updateAddress(
879
+ * "caddr_123",
880
+ * {
881
+ * country_code: "us"
882
+ * }
883
+ * )
884
+ * .then(({ customer }) => {
885
+ * console.log(customer)
886
+ * })
887
+ */
888
+ updateAddress: (addressId: string, body: HttpTypes.StoreUpdateCustomerAddress, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerResponse>;
889
+ /**
890
+ * This method retrieves the logged-in customer's address. The customer must be logged in
891
+ * first with the {@link Auth.login} method.
892
+ *
893
+ * It sends a request to the [List Customer's Address](https://docs.medusajs.com/v2/api/store#customers_getcustomersmeaddresses)
894
+ * API route.
895
+ *
896
+ * Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/addresses)
897
+ *
898
+ * @param query - Configure the fields to retrieve in the addresses.
899
+ * @param headers - Headers to pass in the request.
900
+ * @returns The paginated list of addresses.
901
+ *
902
+ * @example
903
+ * To retrieve the list of addresses:
904
+ *
905
+ * ```ts
906
+ * sdk.store.customer.listAddress()
907
+ * .then(({ addresses, count, offset, limit }) => {
908
+ * console.log(addresses)
909
+ * })
910
+ * ```
911
+ *
912
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
913
+ *
914
+ * For example, to retrieve only 10 items and skip 10 items:
915
+ *
916
+ * ```ts
917
+ * sdk.store.customer.listAddress({
918
+ * limit: 10,
919
+ * offset: 10
920
+ * })
921
+ * .then(({ addresses, count, offset, limit }) => {
922
+ * console.log(addresses)
923
+ * })
924
+ * ```
925
+ *
926
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
927
+ * in each address:
928
+ *
929
+ * ```ts
930
+ * sdk.store.customer.listAddress({
931
+ * fields: "id,country_code"
932
+ * })
933
+ * .then(({ addresses, count, offset, limit }) => {
934
+ * console.log(addresses)
935
+ * })
936
+ * ```
937
+ *
938
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
939
+ */
940
+ listAddress: (query?: FindParams & HttpTypes.StoreCustomerAddressFilters, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerAddressListResponse>;
941
+ /**
942
+ * This method retrieves an address of the logged-in customer. The customer must be logged in
943
+ * first with the {@link Auth.login} method.
944
+ *
945
+ * It sends a request to the [Get Address](https://docs.medusajs.com/v2/api/store#customers_getcustomersmeaddressesaddress_id)
946
+ * API route.
947
+ *
948
+ * Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/addresses)
949
+ *
950
+ * @param addressId - The address's ID.
951
+ * @param query - Configure the fields to retrieve in the address.
952
+ * @param headers - Headers to pass in the request.
953
+ * @returns The address's details.
954
+ *
955
+ * @example
956
+ * To retrieve an address by its ID:
957
+ *
958
+ * ```ts
959
+ * sdk.store.customer.retrieveAddress(
960
+ * "caddr_123"
961
+ * )
962
+ * .then(({ address }) => {
963
+ * console.log(address)
964
+ * })
965
+ * ```
966
+ *
967
+ * To specify the fields and relations to retrieve:
968
+ *
969
+ * ```ts
970
+ * sdk.store.customer.retrieveAddress(
971
+ * "caddr_123",
972
+ * {
973
+ * fields: "id,country_code"
974
+ * }
975
+ * )
976
+ * .then(({ address }) => {
977
+ * console.log(address)
978
+ * })
979
+ * ```
980
+ *
981
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
982
+ */
983
+ retrieveAddress: (addressId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerAddressResponse>;
984
+ /**
985
+ * This method deletes an address of the logged-in customer. The customer must be logged in
986
+ * first with the {@link Auth.login} method.
987
+ *
988
+ * It sends a request to the [Remove Address](https://docs.medusajs.com/v2/api/store#customers_deletecustomersmeaddressesaddress_id)
989
+ * API route.
990
+ *
991
+ * Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/addresses)
992
+ *
993
+ * @param addressId - The address's ID.
994
+ * @param headers - Headers to pass in the request.
995
+ * @returns The deletion's details.
996
+ *
997
+ * @example
998
+ * sdk.store.customer.deleteAddress("caddr_123")
999
+ * .then(({ deleted, parent: customer }) => {
1000
+ * console.log(customer)
1001
+ * })
1002
+ */
113
1003
  deleteAddress: (addressId: string, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerAddressDeleteResponse>;
114
1004
  };
115
1005
  }