@mercurjs/docs 2.2.1 → 2.3.0-canary.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/content/home.mdx +107 -0
  2. package/content/learn/architecture.mdx +168 -83
  3. package/content/learn/introduction.mdx +161 -56
  4. package/content/learn/migration-to-2-0.mdx +187 -0
  5. package/content/learn/why-mercur.mdx +91 -0
  6. package/content/platform/attribute/concepts/attribute-types.mdx +59 -0
  7. package/content/platform/attribute/concepts/global-vs-inline.mdx +50 -0
  8. package/content/platform/attribute/concepts/variant-axes.mdx +61 -0
  9. package/content/platform/attribute/guides/attach-attributes-to-a-product.mdx +69 -0
  10. package/content/platform/attribute/guides/create-a-variant-axis.mdx +83 -0
  11. package/content/platform/attribute/guides/create-an-attribute.mdx +81 -0
  12. package/content/platform/attribute/overview.mdx +87 -0
  13. package/content/platform/attribute/reference/data-models.mdx +56 -0
  14. package/content/platform/attribute/reference/events.mdx +41 -0
  15. package/content/platform/attribute/reference/links.mdx +45 -0
  16. package/content/platform/attribute/reference/service.mdx +49 -0
  17. package/content/platform/attribute/reference/workflows.mdx +45 -0
  18. package/content/platform/catalog/concepts/master-products.mdx +54 -0
  19. package/content/platform/catalog/concepts/product-seller-allowlist.mdx +48 -0
  20. package/content/platform/catalog/concepts/status-lifecycle.mdx +58 -0
  21. package/content/platform/catalog/concepts/variants-categories-collections.mdx +49 -0
  22. package/content/platform/catalog/guides/allowlist-stores.mdx +59 -0
  23. package/content/platform/catalog/guides/create-a-master-product.mdx +70 -0
  24. package/content/platform/catalog/guides/publish-or-reject-a-product.mdx +79 -0
  25. package/content/platform/catalog/overview.mdx +90 -0
  26. package/content/platform/catalog/reference/data-models.mdx +66 -0
  27. package/content/platform/catalog/reference/events.mdx +41 -0
  28. package/content/platform/catalog/reference/links.mdx +44 -0
  29. package/content/platform/catalog/reference/service.mdx +52 -0
  30. package/content/platform/catalog/reference/workflows.mdx +40 -0
  31. package/content/platform/commission/concepts/order-commission-lines.mdx +65 -0
  32. package/content/platform/commission/concepts/rule-matching.mdx +86 -0
  33. package/content/platform/commission/concepts/rules-and-rates.mdx +84 -0
  34. package/content/platform/commission/guides/batch-update-rules.mdx +58 -0
  35. package/content/platform/commission/guides/create-a-rate.mdx +72 -0
  36. package/content/platform/commission/guides/refresh-order-commission-lines.mdx +55 -0
  37. package/content/platform/commission/overview.mdx +86 -0
  38. package/content/platform/commission/reference/data-models.mdx +75 -0
  39. package/content/platform/commission/reference/events.mdx +58 -0
  40. package/content/platform/commission/reference/links.mdx +45 -0
  41. package/content/platform/commission/reference/service.mdx +51 -0
  42. package/content/platform/commission/reference/workflows.mdx +40 -0
  43. package/content/platform/offer/concepts/pricing-and-inventory.mdx +72 -0
  44. package/content/platform/offer/concepts/shipping.mdx +48 -0
  45. package/content/platform/offer/concepts/what-is-an-offer.mdx +65 -0
  46. package/content/platform/offer/guides/bulk-create-offers.mdx +84 -0
  47. package/content/platform/offer/guides/create-an-offer.mdx +83 -0
  48. package/content/platform/offer/guides/manage-offer-inventory.mdx +53 -0
  49. package/content/platform/offer/overview.mdx +84 -0
  50. package/content/platform/offer/reference/data-models.mdx +56 -0
  51. package/content/platform/offer/reference/events.mdx +39 -0
  52. package/content/platform/offer/reference/links.mdx +60 -0
  53. package/content/platform/offer/reference/service.mdx +53 -0
  54. package/content/platform/offer/reference/workflows.mdx +38 -0
  55. package/content/platform/order-group/concepts/computed-totals.mdx +59 -0
  56. package/content/platform/order-group/concepts/order-splitting.mdx +61 -0
  57. package/content/platform/order-group/concepts/the-order-group.mdx +64 -0
  58. package/content/platform/order-group/guides/list-order-groups.mdx +67 -0
  59. package/content/platform/order-group/guides/retrieve-an-order-group.mdx +63 -0
  60. package/content/platform/order-group/guides/split-a-cart.mdx +58 -0
  61. package/content/platform/order-group/overview.mdx +83 -0
  62. package/content/platform/order-group/reference/data-models.mdx +40 -0
  63. package/content/platform/order-group/reference/events.mdx +37 -0
  64. package/content/platform/order-group/reference/links.mdx +45 -0
  65. package/content/platform/order-group/reference/service.mdx +50 -0
  66. package/content/platform/order-group/reference/workflows.mdx +39 -0
  67. package/content/platform/payout/concepts/account-lifecycle.mdx +75 -0
  68. package/content/platform/payout/concepts/accounts-and-onboarding.mdx +70 -0
  69. package/content/platform/payout/concepts/payout-pipeline.mdx +99 -0
  70. package/content/platform/payout/guides/create-a-payout-account.mdx +59 -0
  71. package/content/platform/payout/guides/process-a-provider-webhook.mdx +74 -0
  72. package/content/platform/payout/guides/start-provider-onboarding.mdx +50 -0
  73. package/content/platform/payout/overview.mdx +86 -0
  74. package/content/platform/payout/reference/data-models.mdx +61 -0
  75. package/content/platform/payout/reference/events.mdx +48 -0
  76. package/content/platform/payout/reference/links.mdx +36 -0
  77. package/content/platform/payout/reference/service.mdx +53 -0
  78. package/content/platform/payout/reference/workflows.mdx +32 -0
  79. package/content/platform/product-edit/concepts/change-actions.mdx +66 -0
  80. package/content/platform/product-edit/concepts/change-pipeline.mdx +69 -0
  81. package/content/platform/product-edit/concepts/status-and-auto-confirm.mdx +66 -0
  82. package/content/platform/product-edit/guides/confirm-or-decline-a-change.mdx +76 -0
  83. package/content/platform/product-edit/guides/edit-a-product.mdx +74 -0
  84. package/content/platform/product-edit/guides/request-a-revision.mdx +54 -0
  85. package/content/platform/product-edit/overview.mdx +85 -0
  86. package/content/platform/product-edit/reference/data-models.mdx +65 -0
  87. package/content/platform/product-edit/reference/events.mdx +47 -0
  88. package/content/platform/product-edit/reference/links.mdx +39 -0
  89. package/content/platform/product-edit/reference/service.mdx +43 -0
  90. package/content/platform/product-edit/reference/workflows.mdx +49 -0
  91. package/content/platform/review/concepts/product-vs-seller-reviews.mdx +63 -0
  92. package/content/platform/review/concepts/ratings-and-moderation.mdx +64 -0
  93. package/content/platform/review/concepts/the-review-model.mdx +56 -0
  94. package/content/platform/review/guides/compute-aggregate-ratings.mdx +57 -0
  95. package/content/platform/review/guides/create-a-review.mdx +55 -0
  96. package/content/platform/review/guides/moderate-a-review.mdx +58 -0
  97. package/content/platform/review/guides/respond-to-a-review.mdx +61 -0
  98. package/content/platform/review/overview.mdx +87 -0
  99. package/content/platform/review/reference/data-models.mdx +36 -0
  100. package/content/platform/review/reference/events.mdx +61 -0
  101. package/content/platform/review/reference/links.mdx +43 -0
  102. package/content/platform/review/reference/service.mdx +54 -0
  103. package/content/platform/review/reference/workflows.mdx +31 -0
  104. package/content/platform/store/concepts/lifecycle.mdx +62 -0
  105. package/content/platform/store/concepts/store-entity.mdx +53 -0
  106. package/content/platform/store/concepts/team.mdx +50 -0
  107. package/content/platform/store/guides/create-a-store.mdx +55 -0
  108. package/content/platform/store/guides/manage-the-team.mdx +55 -0
  109. package/content/platform/store/guides/moderate-a-store.mdx +59 -0
  110. package/content/platform/store/overview.mdx +86 -0
  111. package/content/platform/store/reference/data-models.mdx +89 -0
  112. package/content/platform/store/reference/events.mdx +43 -0
  113. package/content/platform/store/reference/links.mdx +71 -0
  114. package/content/platform/store/reference/service.mdx +51 -0
  115. package/content/platform/store/reference/workflows.mdx +35 -0
  116. package/content/references/api/admin/commission-rates/create-commission-rate.mdx +1 -1
  117. package/content/references/api/admin/commission-rates/list-commission-rates.mdx +2 -2
  118. package/content/references/api/admin/commission-rates/update-commission-rate.mdx +1 -1
  119. package/content/references/api/admin/offers/batch-create-offers.mdx +3 -3
  120. package/content/references/api/admin/order-groups/list-order-groups.mdx +1 -1
  121. package/content/references/api/admin/product-attributes/create-attribute-value.mdx +2 -2
  122. package/content/references/api/admin/product-attributes/create-product-attribute.mdx +1 -1
  123. package/content/references/api/admin/product-attributes/update-product-attribute.mdx +1 -1
  124. package/content/references/api/admin/product-changes/confirm-product-change.mdx +1 -1
  125. package/content/references/api/admin/products/batch-product-attributes.mdx +1 -1
  126. package/content/references/api/admin/products/create-product.mdx +1 -1
  127. package/content/references/api/admin/products/preview-product.mdx +1 -1
  128. package/content/references/api/admin.mdx +4 -5
  129. package/content/references/api/conventions.mdx +9 -7
  130. package/content/references/api/store/carts/add-line-item.mdx +1 -1
  131. package/content/references/api/store/offers/list-offers.mdx +1 -1
  132. package/content/references/api/store/order-groups/list-order-groups.mdx +1 -1
  133. package/content/references/api/store.mdx +4 -13
  134. package/content/references/api/vendor/members/accept-member-invite.mdx +1 -1
  135. package/content/references/api/vendor/offers/batch-create-offers.mdx +4 -0
  136. package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +2 -0
  137. package/content/references/api/vendor/offers/create-offer.mdx +13 -1
  138. package/content/references/api/vendor/offers/list-offers.mdx +4 -0
  139. package/content/references/api/vendor/offers/retrieve-offer.mdx +4 -0
  140. package/content/references/api/vendor/offers/update-offer.mdx +12 -0
  141. package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +1 -1
  142. package/content/references/api/vendor/products/batch-product-attributes.mdx +1 -1
  143. package/content/references/api/vendor/products/create-product-variant.mdx +1 -1
  144. package/content/references/api/vendor/products/create-product.mdx +1 -1
  145. package/content/references/api/vendor/products/delete-product.mdx +1 -1
  146. package/content/references/api/vendor/products/update-product.mdx +1 -1
  147. package/content/references/api/vendor/sellers/create-seller.mdx +2 -2
  148. package/content/references/api/vendor/sellers/list-sellers.mdx +1 -1
  149. package/content/references/api/vendor.mdx +6 -5
  150. package/content/references/configuration.mdx +16 -33
  151. package/content/references/overview.mdx +34 -52
  152. package/content/references/panel-extensions/create-page.mdx +194 -0
  153. package/content/references/panel-extensions/custom-fields.mdx +256 -0
  154. package/content/references/panel-extensions/overview.mdx +102 -0
  155. package/content/references/panel-extensions/widgets.mdx +212 -0
  156. package/content/resources/ai/mcp.mdx +2 -2
  157. package/content/resources/ai/overview.mdx +21 -16
  158. package/content/resources/ai/skills.mdx +67 -0
  159. package/content/resources/best-practices/api-routes.mdx +55 -43
  160. package/content/resources/best-practices/custom-fields.mdx +116 -92
  161. package/content/resources/best-practices/frontend.mdx +62 -50
  162. package/content/resources/best-practices/module-links.mdx +48 -34
  163. package/content/resources/best-practices/modules.mdx +53 -27
  164. package/content/resources/best-practices/overview.mdx +45 -17
  165. package/content/resources/best-practices/subscribers-and-jobs.mdx +37 -24
  166. package/content/resources/best-practices/types.mdx +38 -23
  167. package/content/resources/best-practices/workflows.mdx +33 -21
  168. package/content/resources/customization/custom-fields.mdx +15 -15
  169. package/content/resources/customization/extend-a-workflow.mdx +7 -4
  170. package/content/resources/customization/extending-panels.mdx +55 -52
  171. package/content/resources/deployment/medusa-cloud.mdx +21 -20
  172. package/content/resources/deployment/self-host.mdx +123 -0
  173. package/content/resources/integrations/overview.mdx +38 -0
  174. package/content/resources/integrations/stripe-connect.mdx +39 -38
  175. package/content/resources/tutorials/add-a-block.mdx +25 -18
  176. package/content/resources/tutorials/add-a-widget.mdx +32 -23
  177. package/content/resources/tutorials/add-order-detail-button.mdx +33 -20
  178. package/content/resources/tutorials/attributes-and-variant-axes.mdx +28 -27
  179. package/content/resources/tutorials/build-a-block.mdx +26 -15
  180. package/content/resources/tutorials/custom-api-route.mdx +32 -20
  181. package/content/resources/tutorials/custom-panel-page.mdx +21 -12
  182. package/content/resources/tutorials/customize-navigation.mdx +30 -23
  183. package/content/resources/tutorials/extend-forms-and-tables.mdx +36 -28
  184. package/content/resources/tutorials/extend-onboarding.mdx +38 -35
  185. package/content/resources/tutorials/master-products-and-offers.mdx +28 -23
  186. package/content/telemetry.mdx +3 -3
  187. package/content/user-guide/admin/attributes/how-tos/create-an-attribute.mdx +64 -0
  188. package/content/user-guide/admin/attributes/how-tos/manage-possible-values.mdx +40 -0
  189. package/content/user-guide/admin/attributes/overview.mdx +22 -0
  190. package/content/user-guide/admin/commissions/how-tos/create-a-commission-rule.mdx +63 -0
  191. package/content/user-guide/admin/commissions/how-tos/edit-the-global-commission.mdx +48 -0
  192. package/content/user-guide/admin/commissions/how-tos/manage-a-commission-rule.mdx +45 -0
  193. package/content/user-guide/admin/commissions/overview.mdx +25 -0
  194. package/content/user-guide/admin/overview.mdx +20 -12
  195. package/content/user-guide/admin/product-requests/how-tos/review-a-new-product.mdx +58 -0
  196. package/content/user-guide/admin/product-requests/how-tos/review-a-product-edit.mdx +48 -0
  197. package/content/user-guide/admin/product-requests/overview.mdx +25 -0
  198. package/content/user-guide/vendor/offers/how-tos/create-an-offer.mdx +59 -0
  199. package/content/user-guide/vendor/offers/how-tos/update-prices-and-stock.mdx +40 -0
  200. package/content/user-guide/vendor/offers/overview.mdx +22 -0
  201. package/content/user-guide/vendor/onboarding.mdx +79 -0
  202. package/content/user-guide/vendor/orders/how-tos/fulfill-an-order.mdx +49 -0
  203. package/content/user-guide/vendor/orders/how-tos/mark-an-order-as-delivered.mdx +33 -0
  204. package/content/user-guide/vendor/orders/how-tos/process-a-return.mdx +42 -0
  205. package/content/user-guide/vendor/orders/how-tos/refund-an-order.mdx +38 -0
  206. package/content/user-guide/vendor/orders/how-tos/ship-an-order.mdx +40 -0
  207. package/content/user-guide/vendor/orders/overview.mdx +31 -0
  208. package/content/user-guide/vendor/overview.mdx +23 -12
  209. package/content/user-guide/vendor/products/how-tos/edit-a-product.mdx +44 -0
  210. package/content/user-guide/vendor/products/how-tos/submit-a-product.mdx +63 -0
  211. package/content/user-guide/vendor/products/overview.mdx +22 -0
  212. package/llms.txt +176 -142
  213. package/package.json +1 -1
  214. package/content/learn/concepts.mdx +0 -84
  215. package/content/learn/installation.mdx +0 -117
  216. package/content/learn/mirakl-alternative.mdx +0 -86
  217. package/content/migration/from-1-x-to-2-0.mdx +0 -152
  218. package/content/migration/from-2-0-to-2-1.mdx +0 -105
  219. package/content/migration/overview.mdx +0 -58
  220. package/content/references/api/store/search/search.mdx +0 -136
  221. package/content/references/modules/commission.mdx +0 -106
  222. package/content/references/modules/custom-fields.mdx +0 -45
  223. package/content/references/modules/media.mdx +0 -55
  224. package/content/references/modules/offer.mdx +0 -64
  225. package/content/references/modules/payout.mdx +0 -121
  226. package/content/references/modules/product-attribute.mdx +0 -111
  227. package/content/references/modules/product-edit.mdx +0 -80
  228. package/content/references/modules/search.mdx +0 -112
  229. package/content/references/modules/seller.mdx +0 -175
  230. package/content/references/panel-extension-api.mdx +0 -337
  231. package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +0 -48
  232. package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +0 -36
  233. package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +0 -39
  234. package/content/references/workflows/cart/update-cart-seller-promotions.mdx +0 -42
  235. package/content/references/workflows/commission/batch-commission-rules.mdx +0 -49
  236. package/content/references/workflows/commission/create-commission-rates.mdx +0 -41
  237. package/content/references/workflows/commission/delete-commission-rates.mdx +0 -34
  238. package/content/references/workflows/commission/refresh-order-commission-lines.mdx +0 -30
  239. package/content/references/workflows/commission/update-commission-rates.mdx +0 -35
  240. package/content/references/workflows/media/set-category-images.mdx +0 -41
  241. package/content/references/workflows/media/set-collection-images.mdx +0 -41
  242. package/content/references/workflows/member/accept-member-invite.mdx +0 -33
  243. package/content/references/workflows/member/add-seller-member.mdx +0 -30
  244. package/content/references/workflows/member/create-member-invites.mdx +0 -34
  245. package/content/references/workflows/member/delete-member-invite.mdx +0 -24
  246. package/content/references/workflows/member/remove-seller-member.mdx +0 -28
  247. package/content/references/workflows/member/resend-member-invite.mdx +0 -28
  248. package/content/references/workflows/member/update-member-role.mdx +0 -28
  249. package/content/references/workflows/member/update-member.mdx +0 -35
  250. package/content/references/workflows/offer/batch-offer-inventory-items.mdx +0 -62
  251. package/content/references/workflows/offer/create-offers.mdx +0 -65
  252. package/content/references/workflows/offer/delete-offers.mdx +0 -35
  253. package/content/references/workflows/offer/update-offers.mdx +0 -53
  254. package/content/references/workflows/order/cancel-order-fulfillment.mdx +0 -34
  255. package/content/references/workflows/order/confirm-claim-request.mdx +0 -25
  256. package/content/references/workflows/order/confirm-exchange-request.mdx +0 -25
  257. package/content/references/workflows/order/confirm-order-edit-request.mdx +0 -25
  258. package/content/references/workflows/order/confirm-return-receive.mdx +0 -25
  259. package/content/references/workflows/order/create-order-fulfillment.mdx +0 -45
  260. package/content/references/workflows/order-group/get-order-group-detail.mdx +0 -29
  261. package/content/references/workflows/order-group/get-order-groups-list.mdx +0 -38
  262. package/content/references/workflows/overview.mdx +0 -72
  263. package/content/references/workflows/payout/create-onboarding.mdx +0 -36
  264. package/content/references/workflows/payout/create-payout-account.mdx +0 -33
  265. package/content/references/workflows/payout/create-payout.mdx +0 -30
  266. package/content/references/workflows/payout/process-payout-for-webhook.mdx +0 -34
  267. package/content/references/workflows/product/confirm-products.mdx +0 -48
  268. package/content/references/workflows/product/create-products.mdx +0 -63
  269. package/content/references/workflows/product/link-sellers-to-product-category.mdx +0 -40
  270. package/content/references/workflows/product/link-sellers-to-product.mdx +0 -40
  271. package/content/references/workflows/product/reject-product.mdx +0 -48
  272. package/content/references/workflows/product/request-product-change.mdx +0 -48
  273. package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +0 -49
  274. package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +0 -46
  275. package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +0 -43
  276. package/content/references/workflows/product-attribute/create-product-attributes.mdx +0 -56
  277. package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +0 -30
  278. package/content/references/workflows/product-attribute/delete-product-attributes.mdx +0 -30
  279. package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +0 -29
  280. package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +0 -44
  281. package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +0 -41
  282. package/content/references/workflows/product-attribute/update-product-attributes.mdx +0 -48
  283. package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +0 -43
  284. package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +0 -39
  285. package/content/references/workflows/product-edit/cancel-product-change.mdx +0 -49
  286. package/content/references/workflows/product-edit/confirm-product-change.mdx +0 -57
  287. package/content/references/workflows/product-edit/create-product-change.mdx +0 -72
  288. package/content/references/workflows/product-edit/reject-product-change.mdx +0 -54
  289. package/content/references/workflows/product-edit/stage-product-change.mdx +0 -75
  290. package/content/references/workflows/seller/approve-seller.mdx +0 -36
  291. package/content/references/workflows/seller/create-seller-account.mdx +0 -59
  292. package/content/references/workflows/seller/create-seller-defaults.mdx +0 -22
  293. package/content/references/workflows/seller/create-sellers.mdx +0 -65
  294. package/content/references/workflows/seller/delete-seller-professional-details.mdx +0 -37
  295. package/content/references/workflows/seller/delete-sellers.mdx +0 -24
  296. package/content/references/workflows/seller/invite-seller.mdx +0 -28
  297. package/content/references/workflows/seller/suspend-seller.mdx +0 -37
  298. package/content/references/workflows/seller/terminate-seller.mdx +0 -37
  299. package/content/references/workflows/seller/unsuspend-seller.mdx +0 -36
  300. package/content/references/workflows/seller/unterminate-seller.mdx +0 -36
  301. package/content/references/workflows/seller/update-seller-address.mdx +0 -55
  302. package/content/references/workflows/seller/update-seller-payment-details.mdx +0 -52
  303. package/content/references/workflows/seller/update-seller-professional-details.mdx +0 -48
  304. package/content/references/workflows/seller/update-sellers.mdx +0 -57
  305. package/content/resources/ai/llms.mdx +0 -74
  306. package/content/resources/integrations/notifications.mdx +0 -39
  307. package/content/resources/integrations/search.mdx +0 -122
  308. package/content/resources/tutorials/configure-commissions.mdx +0 -127
  309. package/content/resources/tutorials/first-marketplace.mdx +0 -45
  310. package/content/resources/tutorials/handle-product-requests.mdx +0 -80
  311. package/content/resources/tutorials/import-export-products.mdx +0 -96
  312. package/content/resources/tutorials/seller-payouts-stripe.mdx +0 -89
  313. package/content/resources/tutorials/store-setup-checklist.mdx +0 -214
  314. package/content/tools/api-client.mdx +0 -155
  315. package/content/tools/cli.mdx +0 -196
  316. package/content/tools/dashboard-sdk.mdx +0 -35
@@ -0,0 +1,57 @@
1
+ ---
2
+ title: "Compute aggregate ratings"
3
+ sidebarTitle: "Aggregate ratings"
4
+ description: "Compute average ratings for products and sellers from server code."
5
+ ---
6
+
7
+ In this guide, you'll learn how to compute average ratings for products and
8
+ sellers from your own server code. This is useful when surfacing a rating on a
9
+ storefront page or in a custom API route.
10
+
11
+ The Review module service computes averages on demand instead of storing a
12
+ denormalized column, so the numbers always reflect the current set of reviews.
13
+ Resolve the service from the container to use its rating helpers.
14
+
15
+ ## Average for one target
16
+
17
+ `getAvgRating` returns the average rating for a single product or seller:
18
+
19
+ ```ts title="src/api/custom/route.ts"
20
+ import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
21
+ import { MercurModules } from "@mercurjs/types"
22
+
23
+ export async function GET(req: MedusaRequest, res: MedusaResponse) {
24
+ const reviewModuleService = req.scope.resolve(MercurModules.REVIEW)
25
+
26
+ const rating = await reviewModuleService.getAvgRating("seller", "sel_123")
27
+
28
+ res.json({ rating })
29
+ }
30
+ ```
31
+
32
+ The first argument is the target type (`"product"` or `"seller"`), the second is
33
+ its id. The method returns `null` when the target has no reviews yet.
34
+
35
+ ## Ratings for a list
36
+
37
+ For list views, `getProductsWithRating` and `getSellersWithRating` return records
38
+ with their average rating joined in, so you don't fan out a call per row:
39
+
40
+ ```ts
41
+ const reviewModuleService = container.resolve(MercurModules.REVIEW)
42
+
43
+ const sellers = await reviewModuleService.getSellersWithRating([
44
+ "id",
45
+ "name",
46
+ ])
47
+ // => [{ id, name, rating }, ...]
48
+ ```
49
+
50
+ Pass the fields you want selected from the target table; each returned record
51
+ gains a `rating` field with the average.
52
+
53
+ <Tip>
54
+ These helpers average across a target's linked reviews. Combine them with your
55
+ own `status` filter if you only want `published` reviews to count toward the
56
+ public number.
57
+ </Tip>
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: "Create a review"
3
+ sidebarTitle: "Create a review"
4
+ description: "Create a review programmatically with createReviewWorkflow."
5
+ ---
6
+
7
+ In this guide, you'll learn how to create a review from your own server code. This
8
+ is useful in a custom storefront route, an import script, or a seed.
9
+
10
+ Mercur exposes a `createReviewWorkflow` that validates the submission, creates the
11
+ `Review` record, and links it to its target, order, and customer in one step. Run
12
+ it from any place that has access to the Medusa container.
13
+
14
+ ## Run the workflow
15
+
16
+ ```ts title="src/api/custom/route.ts"
17
+ import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
18
+ import { createReviewWorkflow } from "@mercurjs/core/workflows"
19
+
20
+ export async function POST(req: MedusaRequest, res: MedusaResponse) {
21
+ const { result } = await createReviewWorkflow(req.scope).run({
22
+ input: {
23
+ order_id: "order_123",
24
+ reference: "product",
25
+ reference_id: "prod_123",
26
+ rating: 5,
27
+ customer_note: "Exactly as described.",
28
+ customer_id: "cus_123",
29
+ },
30
+ })
31
+
32
+ res.status(201).json({ review: result })
33
+ }
34
+ ```
35
+
36
+ The `reference` field selects the target: pass `"product"` with a product id, or
37
+ `"seller"` with a seller id, in `reference_id`.
38
+
39
+ <Note>
40
+ The workflow validates that the `order_id` belongs to `customer_id` and that
41
+ the customer hasn't already reviewed the same target on that order. Either
42
+ check failing raises an error and no review is created.
43
+ </Note>
44
+
45
+ ## Statuses on creation
46
+
47
+ A new review is created as `pending` and stays hidden until it's moderated. See
48
+ [Moderate a review](/platform/review/guides/moderate-a-review) to publish or
49
+ reject it.
50
+
51
+ <Tip>
52
+ A single order can back several reviews, one per distinct target. Create the
53
+ product review and the seller review as two separate calls with different
54
+ `reference` / `reference_id` values.
55
+ </Tip>
@@ -0,0 +1,58 @@
1
+ ---
2
+ title: "Moderate a review"
3
+ sidebarTitle: "Moderate a review"
4
+ description: "Publish, reject, and delete reviews from server code."
5
+ ---
6
+
7
+ In this guide, you'll learn how to moderate reviews from your own server code.
8
+ Moderation is a change to the review's `status`; removal is a soft delete that
9
+ can be undone.
10
+
11
+ ## Publish or reject
12
+
13
+ Move a `pending` review to `published` or `rejected` with `updateReviewWorkflow`,
14
+ setting the `status` field:
15
+
16
+ ```ts title="src/api/custom/moderate/route.ts"
17
+ import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
18
+ import { updateReviewWorkflow } from "@mercurjs/core/workflows"
19
+
20
+ export async function POST(req: MedusaRequest, res: MedusaResponse) {
21
+ await updateReviewWorkflow(req.scope).run({
22
+ input: {
23
+ id: req.params.id,
24
+ status: "published",
25
+ },
26
+ })
27
+
28
+ res.sendStatus(200)
29
+ }
30
+ ```
31
+
32
+ `updateReviewWorkflow` also accepts `rating`, `customer_note`, and `seller_note`,
33
+ so the same workflow is used for any correction to a review. It captures the
34
+ previous values for compensation, so a failure downstream rolls the record back.
35
+
36
+ ## Delete a review
37
+
38
+ Remove a review with `deleteReviewWorkflow`. This is a **soft delete**. The row
39
+ is retained and restored automatically if the workflow is rolled back:
40
+
41
+ ```ts
42
+ import { deleteReviewWorkflow } from "@mercurjs/core/workflows"
43
+
44
+ await deleteReviewWorkflow(container).run({ input: "rev_123" })
45
+ ```
46
+
47
+ <Warning>
48
+ A soft-deleted review stops counting toward aggregate ratings, but its row (and
49
+ its links) are kept. Use a hard delete through the service only if you need the
50
+ record gone permanently.
51
+ </Warning>
52
+
53
+ ## React to moderation
54
+
55
+ To run your own side effects when a review is published or rejected, wrap
56
+ `updateReviewWorkflow` in a route that also runs your follow-up logic, or add a
57
+ hook. See the [Events reference](/platform/review/reference/events) for the
58
+ current state of review-domain events.
@@ -0,0 +1,61 @@
1
+ ---
2
+ title: "Respond to a review"
3
+ sidebarTitle: "Respond to a review"
4
+ description: "Attach a store's public response with respondReviewWorkflow."
5
+ ---
6
+
7
+ In this guide, you'll learn how to attach a store's response to a review from your
8
+ own server code. A response is a single public note the store adds to a review it
9
+ received.
10
+
11
+ ## Run the workflow
12
+
13
+ `respondReviewWorkflow` writes the `seller_note` on an existing review:
14
+
15
+ ```ts title="src/api/custom/respond/route.ts"
16
+ import type { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
17
+ import { respondReviewWorkflow } from "@mercurjs/core/workflows"
18
+
19
+ export async function POST(req: MedusaRequest, res: MedusaResponse) {
20
+ await respondReviewWorkflow(req.scope).run({
21
+ input: {
22
+ id: req.params.id,
23
+ seller_note: "Thanks for the feedback, glad it arrived quickly!",
24
+ },
25
+ })
26
+
27
+ res.sendStatus(200)
28
+ }
29
+ ```
30
+
31
+ <Note>
32
+ A store can respond **once**. The workflow throws if the review already has a
33
+ `seller_note`, and it throws `NOT_FOUND` if the review id doesn't exist. It
34
+ captures the previous value so a rollback clears the response again.
35
+ </Note>
36
+
37
+ ## Clearing a response
38
+
39
+ The respond flow won't overwrite an existing note. To replace a response, first
40
+ clear it with `updateReviewWorkflow`, then respond again:
41
+
42
+ ```ts
43
+ import {
44
+ updateReviewWorkflow,
45
+ respondReviewWorkflow,
46
+ } from "@mercurjs/core/workflows"
47
+
48
+ await updateReviewWorkflow(container).run({
49
+ input: { id: "rev_123", seller_note: null },
50
+ })
51
+
52
+ await respondReviewWorkflow(container).run({
53
+ input: { id: "rev_123", seller_note: "Updated response." },
54
+ })
55
+ ```
56
+
57
+ <Tip>
58
+ Responding never changes the review's `status`. A store can respond to a
59
+ `pending` review, but the response only becomes public once the review is
60
+ [published](/platform/review/guides/moderate-a-review).
61
+ </Tip>
@@ -0,0 +1,87 @@
1
+ ---
2
+ title: "Review"
3
+ sidebarTitle: "Overview"
4
+ description: "Collect, moderate, and surface customer ratings for products and sellers."
5
+ ---
6
+
7
+ Use Mercur to let customers rate the products they bought and the stores they
8
+ bought from.
9
+
10
+ The Review domain captures a single rating model that points at either a product
11
+ or a seller. It ties each review back to the order that earned it, and it moves
12
+ through a moderation lifecycle before it goes public. Stores can respond to their
13
+ reviews, and aggregate ratings roll up onto public seller and product pages. All
14
+ of it is exposed directly through the Admin, Vendor, and Store APIs.
15
+
16
+ <Note>
17
+ **One model, two targets.** A single `Review` entity (id prefix `rev`) covers
18
+ both product and seller reviews. A `reference` discriminator decides which one
19
+ a given review is about. There is no separate product-review or seller-review
20
+ table.
21
+ </Note>
22
+
23
+ ## Key features
24
+
25
+ - **Product & seller reviews:** one rating model, discriminated by a `reference` field.
26
+ - **Order-backed:** every review is linked to the order that earned it, with one review per target per order.
27
+ - **Moderation lifecycle:** reviews start `pending` and are moderated to `published` or `rejected`.
28
+ - **Store responses:** a store can attach a single public response to each of its reviews.
29
+ - **Aggregate ratings:** average ratings computed per product and per seller for storefront display.
30
+ - **Customer notes:** an optional free-text note alongside the numeric rating.
31
+
32
+ ## Get started
33
+
34
+ Learn how the domain fits together.
35
+
36
+ <CardGroup cols={2}>
37
+ <Card title="The review model" icon="star" href="/platform/review/concepts/the-review-model">
38
+ The single review entity, its rating, notes, and status.
39
+ </Card>
40
+ <Card title="Product vs seller reviews" icon="tags" href="/platform/review/concepts/product-vs-seller-reviews">
41
+ The reference discriminator and the links that anchor each review.
42
+ </Card>
43
+ <Card title="Ratings & moderation" icon="gauge" href="/platform/review/concepts/ratings-and-moderation">
44
+ The status lifecycle, store responses, and aggregate ratings.
45
+ </Card>
46
+ </CardGroup>
47
+
48
+ ## Examples
49
+
50
+ Build against the Review domain in your own code.
51
+
52
+ <CardGroup cols={2}>
53
+ <Card title="Create a review" icon="plus" href="/platform/review/guides/create-a-review">
54
+ Run `createReviewWorkflow` from a route or script.
55
+ </Card>
56
+ <Card title="Moderate a review" icon="gavel" href="/platform/review/guides/moderate-a-review">
57
+ Publish, reject, and delete reviews in code.
58
+ </Card>
59
+ <Card title="Respond to a review" icon="reply" href="/platform/review/guides/respond-to-a-review">
60
+ Attach a store's response with `respondReviewWorkflow`.
61
+ </Card>
62
+ <Card title="Aggregate ratings" icon="calculator" href="/platform/review/guides/compute-aggregate-ratings">
63
+ Compute average ratings for products and sellers.
64
+ </Card>
65
+ </CardGroup>
66
+
67
+ ## Resources
68
+
69
+ Data models, links, workflows, service methods, and events for the Review domain.
70
+
71
+ <CardGroup cols={2}>
72
+ <Card title="Data models" icon="table" href="/platform/review/reference/data-models">
73
+ The `Review` entity and its fields.
74
+ </Card>
75
+ <Card title="Links" icon="link" href="/platform/review/reference/links">
76
+ How reviews link to products, sellers, orders, and customers.
77
+ </Card>
78
+ <Card title="Workflows" icon="diagram-project" href="/platform/review/reference/workflows">
79
+ Create, update, respond, and delete workflows.
80
+ </Card>
81
+ <Card title="Service" icon="gear" href="/platform/review/reference/service">
82
+ Module service methods, including aggregate-rating helpers.
83
+ </Card>
84
+ <Card title="Events" icon="bell" href="/platform/review/reference/events">
85
+ Running side effects as reviews change.
86
+ </Card>
87
+ </CardGroup>
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: "Data models"
3
+ sidebarTitle: "Data models"
4
+ description: "The data models owned by the Review domain."
5
+ ---
6
+
7
+ The Review domain is owned by the **Review module**. This reference lists its
8
+ data model and fields.
9
+
10
+ ## Review
11
+
12
+ Table `review`, id prefix `rev`. A customer's rating of a single product or
13
+ seller.
14
+
15
+ | Field | Type | Notes |
16
+ | --- | --- | --- |
17
+ | `id` | text | Primary key |
18
+ | `display_id` | serial | Human-readable auto-incrementing number |
19
+ | `reference` | enum | `product` or `seller`, the review's target type |
20
+ | `rating` | integer | The numeric score |
21
+ | `customer_note` | text | Nullable, searchable. The customer's note |
22
+ | `seller_note` | text | Nullable, searchable. The store's single response |
23
+ | `status` | enum | `pending`, `published`, or `rejected`; default `pending` |
24
+ | `created_at` | dateTime | Set on creation |
25
+ | `updated_at` | dateTime | Updated on change |
26
+ | `deleted_at` | dateTime | Nullable; set by soft delete |
27
+
28
+ The target record itself is not a column on this model. It's resolved through a
29
+ module link chosen by the `reference` value. See the
30
+ [Links reference](/platform/review/reference/links).
31
+
32
+ <Note>
33
+ The `review` table is indexed on `deleted_at` for soft-delete filtering.
34
+ Deleting a review through the workflow is a soft delete. The row is retained
35
+ and can be restored.
36
+ </Note>
@@ -0,0 +1,61 @@
1
+ ---
2
+ title: "Event reference"
3
+ sidebarTitle: "Events"
4
+ description: "Running side effects as reviews are created, moderated, and answered."
5
+ ---
6
+
7
+ The Review workflows handle validation, links, moderation, and compensation. They
8
+ do **not** currently emit their own domain events. There is no `review.created`
9
+ or `review.published` event to subscribe to today.
10
+
11
+ To run side effects when a review changes, wrap the review workflows in your own
12
+ route or workflow and run the follow-up logic there, or emit your own event and
13
+ subscribe to it.
14
+
15
+ ## Emit your own event
16
+
17
+ Emit an event alongside the workflow, then handle it in a subscriber:
18
+
19
+ ```ts title="src/api/custom/route.ts"
20
+ import { Modules } from "@medusajs/framework/utils"
21
+ import { createReviewWorkflow } from "@mercurjs/core/workflows"
22
+
23
+ export async function POST(req, res) {
24
+ const { result } = await createReviewWorkflow(req.scope).run({
25
+ input: req.body,
26
+ })
27
+
28
+ const eventBus = req.scope.resolve(Modules.EVENT_BUS)
29
+ await eventBus.emit({ name: "review.created", data: { id: result.id } })
30
+
31
+ res.status(201).json({ review: result })
32
+ }
33
+ ```
34
+
35
+ ```ts title="src/subscribers/review-created.ts"
36
+ import type { SubscriberArgs, SubscriberConfig } from "@medusajs/framework"
37
+
38
+ export default async function reviewCreatedHandler({
39
+ event,
40
+ container,
41
+ }: SubscriberArgs<{ id: string }>) {
42
+ const reviewId = event.data.id
43
+ // ...notify the store, update a search index, etc.
44
+ }
45
+
46
+ export const config: SubscriberConfig = {
47
+ event: "review.created",
48
+ }
49
+ ```
50
+
51
+ <Note>
52
+ Because the module ships no events of its own, the event name in the example
53
+ above is one **you** define. Keep it consistent across the emit site and the
54
+ subscriber.
55
+ </Note>
56
+
57
+ ## React without an event
58
+
59
+ For side effects that must run transactionally with the review change, add a step
60
+ to your own workflow that wraps the review workflow, rather than relying on an
61
+ event. Events are handled asynchronously and outside the workflow's compensation.
@@ -0,0 +1,43 @@
1
+ ---
2
+ title: "Links to other modules"
3
+ sidebarTitle: "Links"
4
+ description: "How the Review domain links to products, sellers, orders, and customers."
5
+ ---
6
+
7
+ Modules in Mercur never reference each other directly. They connect through
8
+ **module links**. A review carries no foreign keys to its target on the model
9
+ itself. Instead, four links anchor each review to the rest of the marketplace.
10
+ Once a link is defined, you retrieve related records with `query.graph` using the
11
+ link alias.
12
+
13
+ ```ts
14
+ const { data: reviews } = await query.graph({
15
+ entity: "review",
16
+ fields: ["id", "rating", "product.*", "seller.*"],
17
+ })
18
+ ```
19
+
20
+ ## Targets
21
+
22
+ | Linked module | Relationship |
23
+ | --- | --- |
24
+ | **Product** | A product has many reviews (`product_product_review_review`). Written when `reference` is `product`. |
25
+ | **Seller** | A seller has many reviews (`seller_seller_review_review`). Written when `reference` is `seller`. |
26
+
27
+ A review is linked to **either** a product or a seller, never both. The
28
+ `reference` field on the review decides which link is created.
29
+
30
+ ## Provenance
31
+
32
+ | Linked module | Relationship |
33
+ | --- | --- |
34
+ | **Order** | Each review is linked to the order that earned it (`order_order_review_review`). |
35
+ | **Customer** | Each review is linked to the customer who wrote it (`customer_customer_review_review`). |
36
+
37
+ These two links are written for every review and back the validation that a
38
+ customer can review a target only once per order.
39
+
40
+ <Note>
41
+ All four links are list links (`isList: true`) on the owning side. A product,
42
+ seller, order, or customer has many reviews.
43
+ </Note>
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: "Service reference"
3
+ sidebarTitle: "Service"
4
+ description: "The Review module service: CRUD methods and aggregate-rating helpers."
5
+ ---
6
+
7
+ The Review module exposes a service you can resolve from the Medusa container to
8
+ read and write records directly, without going through a workflow. Use it inside
9
+ custom services, subscribers, scheduled jobs, or route handlers.
10
+
11
+ ```ts
12
+ import { MercurModules } from "@mercurjs/types"
13
+
14
+ const reviewModuleService = container.resolve(MercurModules.REVIEW)
15
+
16
+ const [reviews, count] = await reviewModuleService.listAndCountReviews({
17
+ status: "published",
18
+ })
19
+ ```
20
+
21
+ ## Generated methods
22
+
23
+ The `Review` model gets a standard set of auto-generated methods:
24
+
25
+ | Method | Description |
26
+ | --- | --- |
27
+ | `createReviews(data)` | Create one or more reviews |
28
+ | `retrieveReview(id, config?)` | Retrieve a review by id |
29
+ | `listReviews(filters?, config?)` | List reviews matching filters |
30
+ | `listAndCountReviews(filters?, config?)` | List reviews with a total count |
31
+ | `updateReviews(data)` | Update one or more reviews |
32
+ | `deleteReviews(ids)` | Delete one or more reviews |
33
+ | `softDeleteReviews(ids)` | Soft-delete reviews (restorable) |
34
+ | `restoreReviews(ids)` | Restore soft-deleted reviews |
35
+
36
+ ## Aggregate-rating methods
37
+
38
+ The service adds three helpers that compute average ratings on demand:
39
+
40
+ | Method | Description |
41
+ | --- | --- |
42
+ | `getAvgRating(type, id)` | Average rating for one `"product"` or `"seller"`; `null` when it has no reviews |
43
+ | `getProductsWithRating(fields)` | Product records with an average `rating` joined in |
44
+ | `getSellersWithRating(fields)` | Seller records with an average `rating` joined in |
45
+
46
+ See [Compute aggregate ratings](/platform/review/guides/compute-aggregate-ratings)
47
+ for usage.
48
+
49
+ <Warning>
50
+ Prefer [workflows](/platform/review/reference/workflows) for anything with side
51
+ effects (creation with its validation and links, responses, moderation). The
52
+ service writes records directly and does **not** run the create-flow validation
53
+ or manage the target/order/customer links.
54
+ </Warning>
@@ -0,0 +1,31 @@
1
+ ---
2
+ title: "Workflows"
3
+ sidebarTitle: "Workflows"
4
+ description: "Review workflows for creating, moderating, responding, and deleting."
5
+ ---
6
+
7
+ This reference lists the workflows for the Review domain. Import them from
8
+ `@mercurjs/core/workflows` and run them against the Medusa container.
9
+
10
+ ## Review workflows
11
+
12
+ | Workflow | Input | Purpose |
13
+ | --- | --- | --- |
14
+ | `createReviewWorkflow` | `{ order_id, reference, reference_id, rating, customer_note?, customer_id }` | Validate and create a review, linking it to its target, order, and customer |
15
+ | `updateReviewWorkflow` | `{ id, rating?, customer_note?, seller_note?, status? }` | Update a review, including moderating its `status` |
16
+ | `respondReviewWorkflow` | `{ id, seller_note }` | Attach a store's single response to a review |
17
+ | `deleteReviewWorkflow` | `id` | Soft-delete a review (restorable on rollback) |
18
+
19
+ Each workflow supports compensation: `createReviewWorkflow` deletes the review it
20
+ created on failure, `updateReviewWorkflow` and `respondReviewWorkflow` restore the
21
+ previous values, and `deleteReviewWorkflow` restores the soft-deleted row.
22
+
23
+ <Note>
24
+ `createReviewWorkflow` validates that the order belongs to the customer and
25
+ that the target hasn't already been reviewed on that order. `respondReviewWorkflow`
26
+ refuses to overwrite an existing response.
27
+ </Note>
28
+
29
+ To work with records directly instead of through a workflow, see the
30
+ [Service reference](/platform/review/reference/service). To run side effects when
31
+ a review changes, see the [Event reference](/platform/review/reference/events).
@@ -0,0 +1,62 @@
1
+ ---
2
+ title: "Lifecycle"
3
+ sidebarTitle: "Lifecycle"
4
+ description: "Store statuses, transitions, scheduled closures, and premium."
5
+ ---
6
+
7
+ This page covers the store account lifecycle and the states a store moves through.
8
+
9
+ ## Status
10
+
11
+ A store's state lives in the `status` field of the `Seller` model, typed by the
12
+ `SellerStatus` enum. A store moves through four statuses.
13
+
14
+ ```
15
+ ┌───────────────────┐
16
+ │ pending_approval │
17
+ └─────────┬─────────┘
18
+ │ approve
19
+
20
+ ┌───────────┐ ┌────────┐
21
+ │ suspended │◄───►│ open │
22
+ └───────────┘ └───┬────┘
23
+ │ terminate
24
+
25
+ ┌────────────┐
26
+ │ terminated │
27
+ └────────────┘
28
+ ```
29
+
30
+ | Status | Meaning |
31
+ | --- | --- |
32
+ | `pending_approval` | Registered, waiting for operator review. |
33
+ | `open` | Active. Can list offers, take orders, and collect payouts. |
34
+ | `suspended` | Temporarily frozen. Offers stay listed but cannot be purchased. |
35
+ | `terminated` | Permanently closed. This status is irreversible. |
36
+
37
+ Only the operator can change a store's status. Each transition runs through a
38
+ dedicated workflow: `approveSellerWorkflow`, `suspendSellerWorkflow`,
39
+ `unsuspendSellerWorkflow`, and `terminateSellerWorkflow`.
40
+
41
+ <Note>
42
+ Termination is irreversible. All orders and payouts must be resolved before a
43
+ store can be terminated.
44
+ </Note>
45
+
46
+ ## Scheduled closures
47
+
48
+ A store can schedule a temporary closure with the `closed_from` and `closed_to`
49
+ fields without changing its status. During the window, the storefront shows as
50
+ unavailable and no new orders are accepted. The account stays `open` and resumes
51
+ on its own once `closed_to` passes.
52
+
53
+ <Tip>
54
+ A closure overlays the current status. It is not a status of its own, and it
55
+ does not affect the transition rules.
56
+ </Tip>
57
+
58
+ ## Premium
59
+
60
+ The `is_premium` boolean is set only by the operator. Stores cannot designate
61
+ themselves as premium. The storefront uses the flag for featured placement,
62
+ badges, and curation priority.
@@ -0,0 +1,53 @@
1
+ ---
2
+ title: "The store entity"
3
+ sidebarTitle: "The store"
4
+ description: "The seller record, its business identity, and its satellite data."
5
+ ---
6
+
7
+ This page covers the store record and the data models that make up its business
8
+ identity.
9
+
10
+ ## Store
11
+
12
+ A store is the marketplace vendor. It owns offers, orders, and payouts, and it
13
+ holds the profile shown to customers on the storefront. A store is represented by
14
+ the `Seller` data model (table `seller`, id prefix `sel`).
15
+
16
+ ```ts
17
+ const { result } = await createSellersWorkflow(container).run({
18
+ input: {
19
+ sellers: [
20
+ {
21
+ name: "Acme Supplies",
22
+ email: "team@acme.com",
23
+ currency_code: "usd",
24
+ },
25
+ ],
26
+ },
27
+ })
28
+ ```
29
+
30
+ <Tip>
31
+ A store settles in exactly one currency, set by `currency_code`. A seller who
32
+ needs to trade in several currencies creates a separate store for each one, and
33
+ each store operates independently.
34
+ </Tip>
35
+
36
+ ## Professional details
37
+
38
+ A store can carry professional details: a corporate name, a registration number,
39
+ and a tax id. These are represented by the `ProfessionalDetails` data model. When
40
+ this record is present, the store is a registered business. When it is absent,
41
+ the store is an individual seller.
42
+
43
+ ## Addresses and payment details
44
+
45
+ A store keeps its addresses as `SellerAddress` records, one each for a warehouse,
46
+ return, or business address. The bank details used to settle payouts live on a
47
+ `PaymentDetails` record. Both are satellite records of the store, and fulfillment
48
+ and payout settlement read from them.
49
+
50
+ <Note>
51
+ `ProfessionalDetails`, `SellerAddress`, and `PaymentDetails` are one-to-one with
52
+ the store and are deleted along with it.
53
+ </Note>