@mercurjs/docs 2.2.0-canary.40

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 (283) hide show
  1. package/README.md +24 -0
  2. package/content/blocks.mdx +209 -0
  3. package/content/learn/architecture.mdx +215 -0
  4. package/content/learn/attributes.mdx +89 -0
  5. package/content/learn/blocks.mdx +99 -0
  6. package/content/learn/commissions.mdx +175 -0
  7. package/content/learn/concepts.mdx +84 -0
  8. package/content/learn/installation.mdx +117 -0
  9. package/content/learn/introduction.mdx +71 -0
  10. package/content/learn/offers.mdx +78 -0
  11. package/content/learn/order-groups.mdx +114 -0
  12. package/content/learn/payouts.mdx +175 -0
  13. package/content/learn/product-requests.mdx +82 -0
  14. package/content/learn/products.mdx +79 -0
  15. package/content/learn/registry.mdx +155 -0
  16. package/content/learn/seller-members.mdx +62 -0
  17. package/content/learn/sellers.mdx +118 -0
  18. package/content/migration/from-1-x-to-2-0.mdx +152 -0
  19. package/content/migration/from-2-0-to-2-1.mdx +105 -0
  20. package/content/migration/overview.mdx +58 -0
  21. package/content/references/api/admin/commission-rates/batch-commission-rules.mdx +70 -0
  22. package/content/references/api/admin/commission-rates/create-commission-rate.mdx +95 -0
  23. package/content/references/api/admin/commission-rates/delete-commission-rate.mdx +40 -0
  24. package/content/references/api/admin/commission-rates/list-commission-rates.mdx +92 -0
  25. package/content/references/api/admin/commission-rates/retrieve-commission-rate.mdx +70 -0
  26. package/content/references/api/admin/commission-rates/update-commission-rate.mdx +84 -0
  27. package/content/references/api/admin/members/list-members.mdx +61 -0
  28. package/content/references/api/admin/offers/batch-create-offers.mdx +130 -0
  29. package/content/references/api/admin/offers/delete-offer.mdx +40 -0
  30. package/content/references/api/admin/offers/list-offers.mdx +106 -0
  31. package/content/references/api/admin/offers/retrieve-offer.mdx +82 -0
  32. package/content/references/api/admin/order-groups/list-order-groups.mdx +77 -0
  33. package/content/references/api/admin/order-groups/retrieve-order-group.mdx +56 -0
  34. package/content/references/api/admin/orders/get-order-commission-lines.mdx +65 -0
  35. package/content/references/api/admin/orders/get-order-order-group.mdx +56 -0
  36. package/content/references/api/admin/orders/list-orders.mdx +79 -0
  37. package/content/references/api/admin/payouts/list-payouts.mdx +75 -0
  38. package/content/references/api/admin/payouts/retrieve-payout.mdx +62 -0
  39. package/content/references/api/admin/product-attributes/create-attribute-value.mdx +76 -0
  40. package/content/references/api/admin/product-attributes/create-product-attribute.mdx +99 -0
  41. package/content/references/api/admin/product-attributes/delete-attribute-value.mdx +52 -0
  42. package/content/references/api/admin/product-attributes/delete-product-attribute.mdx +40 -0
  43. package/content/references/api/admin/product-attributes/list-product-attributes.mdx +91 -0
  44. package/content/references/api/admin/product-attributes/retrieve-product-attribute.mdx +81 -0
  45. package/content/references/api/admin/product-attributes/update-attribute-value.mdx +66 -0
  46. package/content/references/api/admin/product-attributes/update-product-attribute.mdx +76 -0
  47. package/content/references/api/admin/product-changes/cancel-product-change.mdx +68 -0
  48. package/content/references/api/admin/product-changes/confirm-product-change.mdx +47 -0
  49. package/content/references/api/admin/products/batch-product-attributes.mdx +96 -0
  50. package/content/references/api/admin/products/confirm-product.mdx +59 -0
  51. package/content/references/api/admin/products/create-product-variant.mdx +78 -0
  52. package/content/references/api/admin/products/create-product.mdx +169 -0
  53. package/content/references/api/admin/products/delete-product-variant.mdx +48 -0
  54. package/content/references/api/admin/products/delete-product.mdx +40 -0
  55. package/content/references/api/admin/products/list-product-variants.mdx +91 -0
  56. package/content/references/api/admin/products/list-products.mdx +109 -0
  57. package/content/references/api/admin/products/preview-product.mdx +78 -0
  58. package/content/references/api/admin/products/reject-product.mdx +59 -0
  59. package/content/references/api/admin/products/request-product-changes.mdx +59 -0
  60. package/content/references/api/admin/products/retrieve-product-variant.mdx +73 -0
  61. package/content/references/api/admin/products/retrieve-product.mdx +96 -0
  62. package/content/references/api/admin/products/set-product-sellers.mdx +47 -0
  63. package/content/references/api/admin/products/update-product-variant.mdx +89 -0
  64. package/content/references/api/admin/products/update-product.mdx +133 -0
  65. package/content/references/api/admin/sellers/add-seller-member.mdx +63 -0
  66. package/content/references/api/admin/sellers/approve-seller.mdx +54 -0
  67. package/content/references/api/admin/sellers/create-seller.mdx +100 -0
  68. package/content/references/api/admin/sellers/delete-member-invite.mdx +42 -0
  69. package/content/references/api/admin/sellers/delete-professional-details.mdx +52 -0
  70. package/content/references/api/admin/sellers/invite-seller-member.mdx +63 -0
  71. package/content/references/api/admin/sellers/list-member-invites.mdx +71 -0
  72. package/content/references/api/admin/sellers/list-seller-members.mdx +71 -0
  73. package/content/references/api/admin/sellers/list-seller-products.mdx +85 -0
  74. package/content/references/api/admin/sellers/list-sellers.mdx +96 -0
  75. package/content/references/api/admin/sellers/remove-seller-member.mdx +42 -0
  76. package/content/references/api/admin/sellers/resend-member-invite.mdx +55 -0
  77. package/content/references/api/admin/sellers/retrieve-seller.mdx +81 -0
  78. package/content/references/api/admin/sellers/suspend-seller.mdx +60 -0
  79. package/content/references/api/admin/sellers/terminate-seller.mdx +60 -0
  80. package/content/references/api/admin/sellers/unsuspend-seller.mdx +52 -0
  81. package/content/references/api/admin/sellers/unterminate-seller.mdx +52 -0
  82. package/content/references/api/admin/sellers/update-seller.mdx +83 -0
  83. package/content/references/api/admin/sellers/upsert-payment-details.mdx +88 -0
  84. package/content/references/api/admin/sellers/upsert-professional-details.mdx +78 -0
  85. package/content/references/api/admin/sellers/upsert-seller-address.mdx +91 -0
  86. package/content/references/api/admin.mdx +134 -0
  87. package/content/references/api/conventions.mdx +109 -0
  88. package/content/references/api/store/carts/add-line-item.mdx +115 -0
  89. package/content/references/api/store/carts/add-shipping-methods.mdx +84 -0
  90. package/content/references/api/store/carts/apply-promotions.mdx +83 -0
  91. package/content/references/api/store/carts/complete-cart.mdx +98 -0
  92. package/content/references/api/store/offers/list-offers.mdx +161 -0
  93. package/content/references/api/store/offers/retrieve-offer.mdx +112 -0
  94. package/content/references/api/store/order-groups/list-order-groups.mdx +105 -0
  95. package/content/references/api/store/order-groups/retrieve-order-group.mdx +78 -0
  96. package/content/references/api/store/product-attributes/list-product-attributes.mdx +134 -0
  97. package/content/references/api/store/product-attributes/retrieve-product-attribute.mdx +78 -0
  98. package/content/references/api/store/product-categories/list-product-categories.mdx +126 -0
  99. package/content/references/api/store/product-categories/retrieve-product-category.mdx +79 -0
  100. package/content/references/api/store/products/list-products.mdx +184 -0
  101. package/content/references/api/store/products/retrieve-product.mdx +107 -0
  102. package/content/references/api/store/search/search.mdx +136 -0
  103. package/content/references/api/store/sellers/list-sellers.mdx +105 -0
  104. package/content/references/api/store/sellers/retrieve-seller.mdx +62 -0
  105. package/content/references/api/store/shipping-options/list-shipping-options.mdx +74 -0
  106. package/content/references/api/store.mdx +67 -0
  107. package/content/references/api/vendor/members/accept-member-invite.mdx +65 -0
  108. package/content/references/api/vendor/members/retrieve-current-member.mdx +51 -0
  109. package/content/references/api/vendor/members/update-current-member.mdx +70 -0
  110. package/content/references/api/vendor/offers/batch-create-offers.mdx +123 -0
  111. package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +103 -0
  112. package/content/references/api/vendor/offers/create-offer.mdx +141 -0
  113. package/content/references/api/vendor/offers/delete-offer.mdx +51 -0
  114. package/content/references/api/vendor/offers/list-offers.mdx +125 -0
  115. package/content/references/api/vendor/offers/retrieve-offer.mdx +74 -0
  116. package/content/references/api/vendor/offers/update-offer.mdx +82 -0
  117. package/content/references/api/vendor/orders/cancel-fulfillment.mdx +63 -0
  118. package/content/references/api/vendor/orders/cancel-order.mdx +56 -0
  119. package/content/references/api/vendor/orders/complete-order.mdx +55 -0
  120. package/content/references/api/vendor/orders/create-fulfillment.mdx +76 -0
  121. package/content/references/api/vendor/orders/create-shipment.mdx +99 -0
  122. package/content/references/api/vendor/orders/get-order-commission-lines.mdx +66 -0
  123. package/content/references/api/vendor/orders/list-order-changes.mdx +75 -0
  124. package/content/references/api/vendor/orders/list-orders.mdx +103 -0
  125. package/content/references/api/vendor/orders/mark-fulfillment-delivered.mdx +62 -0
  126. package/content/references/api/vendor/orders/preview-order.mdx +65 -0
  127. package/content/references/api/vendor/orders/retrieve-order.mdx +84 -0
  128. package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +68 -0
  129. package/content/references/api/vendor/payout-accounts/create-payout-account.mdx +59 -0
  130. package/content/references/api/vendor/payout-accounts/retrieve-payout-account-by-id.mdx +60 -0
  131. package/content/references/api/vendor/payout-accounts/retrieve-payout-account.mdx +77 -0
  132. package/content/references/api/vendor/payouts/list-payouts.mdx +90 -0
  133. package/content/references/api/vendor/payouts/retrieve-payout.mdx +63 -0
  134. package/content/references/api/vendor/product-attributes/list-product-attributes.mdx +135 -0
  135. package/content/references/api/vendor/product-attributes/retrieve-product-attribute.mdx +71 -0
  136. package/content/references/api/vendor/product-variants/list-variants.mdx +136 -0
  137. package/content/references/api/vendor/products/batch-product-attributes.mdx +104 -0
  138. package/content/references/api/vendor/products/cancel-product-change.mdx +62 -0
  139. package/content/references/api/vendor/products/create-product-variant.mdx +92 -0
  140. package/content/references/api/vendor/products/create-product.mdx +197 -0
  141. package/content/references/api/vendor/products/delete-product-variant.mdx +68 -0
  142. package/content/references/api/vendor/products/delete-product.mdx +62 -0
  143. package/content/references/api/vendor/products/list-product-variants.mdx +114 -0
  144. package/content/references/api/vendor/products/list-products.mdx +163 -0
  145. package/content/references/api/vendor/products/preview-product.mdx +61 -0
  146. package/content/references/api/vendor/products/retrieve-product-variant.mdx +76 -0
  147. package/content/references/api/vendor/products/retrieve-product.mdx +69 -0
  148. package/content/references/api/vendor/products/update-product-variant.mdx +104 -0
  149. package/content/references/api/vendor/products/update-product.mdx +148 -0
  150. package/content/references/api/vendor/sellers/create-seller.mdx +150 -0
  151. package/content/references/api/vendor/sellers/delete-professional-details.mdx +54 -0
  152. package/content/references/api/vendor/sellers/invite-seller-member.mdx +67 -0
  153. package/content/references/api/vendor/sellers/list-member-invites.mdx +82 -0
  154. package/content/references/api/vendor/sellers/list-seller-members.mdx +80 -0
  155. package/content/references/api/vendor/sellers/list-sellers.mdx +71 -0
  156. package/content/references/api/vendor/sellers/remove-seller-member.mdx +48 -0
  157. package/content/references/api/vendor/sellers/retrieve-current-seller-member.mdx +59 -0
  158. package/content/references/api/vendor/sellers/retrieve-current-seller.mdx +69 -0
  159. package/content/references/api/vendor/sellers/select-seller.mdx +44 -0
  160. package/content/references/api/vendor/sellers/update-current-seller.mdx +108 -0
  161. package/content/references/api/vendor/sellers/update-member-role.mdx +51 -0
  162. package/content/references/api/vendor/sellers/upsert-payment-details.mdx +74 -0
  163. package/content/references/api/vendor/sellers/upsert-professional-details.mdx +70 -0
  164. package/content/references/api/vendor/sellers/upsert-seller-address.mdx +81 -0
  165. package/content/references/api/vendor.mdx +150 -0
  166. package/content/references/configuration.mdx +155 -0
  167. package/content/references/modules/commission.mdx +106 -0
  168. package/content/references/modules/custom-fields.mdx +45 -0
  169. package/content/references/modules/media.mdx +55 -0
  170. package/content/references/modules/offer.mdx +64 -0
  171. package/content/references/modules/payout.mdx +121 -0
  172. package/content/references/modules/product-attribute.mdx +111 -0
  173. package/content/references/modules/product-edit.mdx +80 -0
  174. package/content/references/modules/search.mdx +112 -0
  175. package/content/references/modules/seller.mdx +175 -0
  176. package/content/references/overview.mdx +70 -0
  177. package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +44 -0
  178. package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +36 -0
  179. package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +39 -0
  180. package/content/references/workflows/cart/update-cart-seller-promotions.mdx +42 -0
  181. package/content/references/workflows/commission/batch-commission-rules.mdx +45 -0
  182. package/content/references/workflows/commission/create-commission-rates.mdx +41 -0
  183. package/content/references/workflows/commission/delete-commission-rates.mdx +34 -0
  184. package/content/references/workflows/commission/refresh-order-commission-lines.mdx +30 -0
  185. package/content/references/workflows/commission/update-commission-rates.mdx +35 -0
  186. package/content/references/workflows/media/set-category-images.mdx +41 -0
  187. package/content/references/workflows/media/set-collection-images.mdx +41 -0
  188. package/content/references/workflows/member/accept-member-invite.mdx +33 -0
  189. package/content/references/workflows/member/add-seller-member.mdx +30 -0
  190. package/content/references/workflows/member/create-member-invites.mdx +34 -0
  191. package/content/references/workflows/member/delete-member-invite.mdx +24 -0
  192. package/content/references/workflows/member/remove-seller-member.mdx +28 -0
  193. package/content/references/workflows/member/resend-member-invite.mdx +28 -0
  194. package/content/references/workflows/member/update-member-role.mdx +28 -0
  195. package/content/references/workflows/member/update-member.mdx +35 -0
  196. package/content/references/workflows/offer/batch-offer-inventory-items.mdx +58 -0
  197. package/content/references/workflows/offer/create-offers.mdx +63 -0
  198. package/content/references/workflows/offer/delete-offers.mdx +35 -0
  199. package/content/references/workflows/offer/update-offers.mdx +51 -0
  200. package/content/references/workflows/order/cancel-order-fulfillment.mdx +34 -0
  201. package/content/references/workflows/order/confirm-claim-request.mdx +25 -0
  202. package/content/references/workflows/order/confirm-exchange-request.mdx +25 -0
  203. package/content/references/workflows/order/confirm-order-edit-request.mdx +25 -0
  204. package/content/references/workflows/order/confirm-return-receive.mdx +25 -0
  205. package/content/references/workflows/order/create-order-fulfillment.mdx +45 -0
  206. package/content/references/workflows/order-group/get-order-group-detail.mdx +29 -0
  207. package/content/references/workflows/order-group/get-order-groups-list.mdx +36 -0
  208. package/content/references/workflows/overview.mdx +72 -0
  209. package/content/references/workflows/payout/create-onboarding.mdx +36 -0
  210. package/content/references/workflows/payout/create-payout-account.mdx +33 -0
  211. package/content/references/workflows/payout/create-payout.mdx +30 -0
  212. package/content/references/workflows/payout/process-payout-for-webhook.mdx +32 -0
  213. package/content/references/workflows/product/confirm-products.mdx +46 -0
  214. package/content/references/workflows/product/create-products.mdx +63 -0
  215. package/content/references/workflows/product/link-sellers-to-product-category.mdx +40 -0
  216. package/content/references/workflows/product/link-sellers-to-product.mdx +40 -0
  217. package/content/references/workflows/product/reject-product.mdx +46 -0
  218. package/content/references/workflows/product/request-product-change.mdx +46 -0
  219. package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +49 -0
  220. package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +46 -0
  221. package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +43 -0
  222. package/content/references/workflows/product-attribute/create-product-attributes.mdx +56 -0
  223. package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +30 -0
  224. package/content/references/workflows/product-attribute/delete-product-attributes.mdx +30 -0
  225. package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +29 -0
  226. package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +44 -0
  227. package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +41 -0
  228. package/content/references/workflows/product-attribute/update-product-attributes.mdx +48 -0
  229. package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +43 -0
  230. package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +39 -0
  231. package/content/references/workflows/product-edit/cancel-product-change.mdx +49 -0
  232. package/content/references/workflows/product-edit/confirm-product-change.mdx +57 -0
  233. package/content/references/workflows/product-edit/create-product-change.mdx +72 -0
  234. package/content/references/workflows/product-edit/reject-product-change.mdx +54 -0
  235. package/content/references/workflows/product-edit/stage-product-change.mdx +75 -0
  236. package/content/references/workflows/seller/approve-seller.mdx +34 -0
  237. package/content/references/workflows/seller/create-seller-account.mdx +59 -0
  238. package/content/references/workflows/seller/create-seller-defaults.mdx +22 -0
  239. package/content/references/workflows/seller/create-sellers.mdx +65 -0
  240. package/content/references/workflows/seller/delete-seller-professional-details.mdx +37 -0
  241. package/content/references/workflows/seller/delete-sellers.mdx +24 -0
  242. package/content/references/workflows/seller/invite-seller.mdx +28 -0
  243. package/content/references/workflows/seller/suspend-seller.mdx +35 -0
  244. package/content/references/workflows/seller/terminate-seller.mdx +35 -0
  245. package/content/references/workflows/seller/unsuspend-seller.mdx +34 -0
  246. package/content/references/workflows/seller/unterminate-seller.mdx +34 -0
  247. package/content/references/workflows/seller/update-seller-address.mdx +55 -0
  248. package/content/references/workflows/seller/update-seller-payment-details.mdx +52 -0
  249. package/content/references/workflows/seller/update-seller-professional-details.mdx +48 -0
  250. package/content/references/workflows/seller/update-sellers.mdx +57 -0
  251. package/content/resources/ai/llms.mdx +74 -0
  252. package/content/resources/ai/mcp.mdx +152 -0
  253. package/content/resources/ai/overview.mdx +97 -0
  254. package/content/resources/customization/custom-fields.mdx +182 -0
  255. package/content/resources/customization/extend-a-workflow.mdx +39 -0
  256. package/content/resources/customization/extending-panels.mdx +309 -0
  257. package/content/resources/deployment/medusa-cloud.mdx +167 -0
  258. package/content/resources/integrations/notifications.mdx +39 -0
  259. package/content/resources/integrations/search.mdx +122 -0
  260. package/content/resources/integrations/stripe-connect.mdx +395 -0
  261. package/content/resources/tutorials/add-a-block.mdx +74 -0
  262. package/content/resources/tutorials/attributes-and-variant-axes.mdx +111 -0
  263. package/content/resources/tutorials/build-a-block.mdx +134 -0
  264. package/content/resources/tutorials/configure-commissions.mdx +127 -0
  265. package/content/resources/tutorials/custom-api-route.mdx +142 -0
  266. package/content/resources/tutorials/custom-panel-page.mdx +78 -0
  267. package/content/resources/tutorials/first-marketplace.mdx +45 -0
  268. package/content/resources/tutorials/handle-product-requests.mdx +80 -0
  269. package/content/resources/tutorials/import-export-products.mdx +96 -0
  270. package/content/resources/tutorials/master-products-and-offers.mdx +89 -0
  271. package/content/resources/tutorials/recompose-a-page.mdx +129 -0
  272. package/content/resources/tutorials/replace-panel-components.mdx +116 -0
  273. package/content/resources/tutorials/seller-payouts-stripe.mdx +89 -0
  274. package/content/telemetry.mdx +67 -0
  275. package/content/tools/api-client.mdx +155 -0
  276. package/content/tools/cli.mdx +196 -0
  277. package/content/tools/dashboard-sdk.mdx +35 -0
  278. package/content/user-guide/admin/overview.mdx +23 -0
  279. package/content/user-guide/admin/stores.mdx +193 -0
  280. package/content/user-guide/vendor/overview.mdx +23 -0
  281. package/content/user-guide/vendor/stores.mdx +209 -0
  282. package/llms.txt +307 -0
  283. package/package.json +33 -0
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: "rejectProductChangeWorkflow"
3
+ description: "Decline a pending ProductChange with an optional reason for the vendor."
4
+ ---
5
+
6
+ Declines a pending `ProductChange`: validates the change exists and is still `pending`, then sets it to `declined` with `declined_by`, `declined_at`, and `declined_reason` — the staged actions are never applied to the master product. Emits `product-change.declined` with `{ id }`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { rejectProductChangeWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await rejectProductChangeWorkflow(container).run({
14
+ input: {
15
+ id: "prch_01H...",
16
+ declined_by: "user_01H...",
17
+ declined_reason: "Price change exceeds allowed range",
18
+ },
19
+ })
20
+ ```
21
+
22
+ ## Input
23
+
24
+ <ParamField body="id" type="string" required>
25
+ Id of the product change to decline. Must exist and be in `pending` status.
26
+ </ParamField>
27
+
28
+ <ParamField body="declined_by" type="string">
29
+ Actor id recorded as the decliner on the change.
30
+ </ParamField>
31
+
32
+ <ParamField body="declined_reason" type="string">
33
+ Vendor-facing reason stored on the change.
34
+ </ParamField>
35
+
36
+ <ParamField body="additional_data" type="object">
37
+ Arbitrary data forwarded to the `productChangeRejected` hook.
38
+ </ParamField>
39
+
40
+ ## Result
41
+
42
+ <ResponseField name="result" type="void">
43
+ Returns nothing; the change status is updated in place.
44
+ </ResponseField>
45
+
46
+ ## Hooks
47
+
48
+ <ResponseField name="validate" type="hook">
49
+ Runs first with `{ input }` — use it to block rejection.
50
+ </ResponseField>
51
+
52
+ <ResponseField name="productChangeRejected" type="hook">
53
+ Runs after the decline with `{ id, additional_data }`.
54
+ </ResponseField>
@@ -0,0 +1,75 @@
1
+ ---
2
+ title: "stageProductChangeWorkflow"
3
+ description: "Stage a pending ProductChange with its actions and optionally auto-confirm it."
4
+ ---
5
+
6
+ Creates a `pending` `ProductChange` for one product, attaches the given actions to it, then runs `autoConfirmProductChangeWorkflow` — so the change is applied immediately when `auto_confirm` is `true` or the `product_request` feature flag is disabled. This is the engine behind the vendor product-edit workflows (`productEditUpdateProduct`, `productEditUpdateVariants`, `productEditUpdateAttributes`, `productEditDeleteProduct`). Emits `product-change.created`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { stageProductChangeWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ const { result } = await stageProductChangeWorkflow(container).run({
14
+ input: {
15
+ product_id: "prod_01H...",
16
+ created_by: "sel_01H...",
17
+ actions: [
18
+ {
19
+ product_id: "prod_01H...",
20
+ action: "UPDATE",
21
+ details: { title: "Linen Shirt v2" },
22
+ },
23
+ ],
24
+ },
25
+ })
26
+ ```
27
+
28
+ ## Input
29
+
30
+ <ParamField body="product_id" type="string" required>
31
+ Id of the product the change targets.
32
+ </ParamField>
33
+
34
+ <ParamField body="actions" type="object[]" required>
35
+ Actions to stage on the change (`CreateProductChangeActionDTO` without `product_change_id`, which is stamped automatically).
36
+ <Expandable title="properties">
37
+ <ParamField body="product_id" type="string" required>
38
+ Id of the product the action applies to.
39
+ </ParamField>
40
+ <ParamField body="action" type="string" required>
41
+ Action type, e.g. `UPDATE`, `VARIANT_ADD`, `VARIANT_UPDATE`, `VARIANT_REMOVE`, `ATTRIBUTE_ADD`, `ATTRIBUTE_UPDATE`, `ATTRIBUTE_REMOVE`, `PRODUCT_DELETE`, `STATUS_CHANGE`.
42
+ </ParamField>
43
+ <ParamField body="details" type="object">
44
+ Operation payload applied when the change is confirmed.
45
+ </ParamField>
46
+ <ParamField body="internal_note" type="string">
47
+ Operator-only note on the action.
48
+ </ParamField>
49
+ <ParamField body="applied" type="boolean">
50
+ Whether the action is already applied; leave unset for staged edits.
51
+ </ParamField>
52
+ </Expandable>
53
+ </ParamField>
54
+
55
+ <ParamField body="created_by" type="string">
56
+ Actor id who staged the change; also used as `confirmed_by` on auto-confirm.
57
+ </ParamField>
58
+
59
+ <ParamField body="internal_note" type="string">
60
+ Operator-only note stored on the change.
61
+ </ParamField>
62
+
63
+ <ParamField body="external_note" type="string">
64
+ Vendor-facing note stored on the change.
65
+ </ParamField>
66
+
67
+ <ParamField body="auto_confirm" type="boolean">
68
+ Force immediate confirmation even when the `product_request` feature flag is enabled.
69
+ </ParamField>
70
+
71
+ ## Result
72
+
73
+ <ResponseField name="result" type="ProductChangeDTO">
74
+ The created change record; still `pending` unless it was auto-confirmed.
75
+ </ResponseField>
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: "approveSellerWorkflow"
3
+ description: "Approve a pending seller and open its store."
4
+ ---
5
+
6
+ Validates the seller can be approved, sets `status` to `open`, clears `status_reason`, and stamps `approved_at` on first approval. Triggered by `POST /admin/sellers/:id/approve`. Emits `seller.approved`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { approveSellerWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await approveSellerWorkflow(container).run({
14
+ input: { seller_id: "sel_123" },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="seller_id" type="string" required>Id of the seller to approve.</ParamField>
21
+
22
+ ## Result
23
+
24
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
25
+
26
+ ## Hooks
27
+
28
+ - `sellerApproved` — runs after approval with `{ seller_id }`.
29
+
30
+ ```ts
31
+ approveSellerWorkflow.hooks.sellerApproved(async ({ seller_id }) => {
32
+ // e.g. send a welcome email
33
+ })
34
+ ```
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: "createSellerAccountWorkflow"
3
+ description: "Create a seller with its owner member during self-registration."
4
+ ---
5
+
6
+ Creates a seller with `pending_approval` status, ensures the default seller roles exist, creates (or reuses) the owner member, and links the member's auth identity via app metadata. Optionally sets the seller address, professional details, and payment details in the same run. Triggered by `POST /vendor/sellers` during vendor registration. Emits `seller.created`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { createSellerAccountWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ const { result } = await createSellerAccountWorkflow(container).run({
14
+ input: {
15
+ auth_identity_id: "authid_123",
16
+ seller: { name: "Acme", email: "hello@acme.co", currency_code: "usd" },
17
+ member_email: "owner@acme.co",
18
+ first_name: "Jane",
19
+ last_name: "Doe",
20
+ },
21
+ })
22
+ ```
23
+
24
+ ## Input
25
+
26
+ <ParamField body="auth_identity_id" type="string" required>Auth identity to bind to the owner member.</ParamField>
27
+ <ParamField body="seller" type="CreateSellerDTO" required>
28
+ Seller to create; `status` is forced to `pending_approval`.
29
+ <Expandable title="properties">
30
+ <ParamField body="name" type="string" required>Display name of the seller.</ParamField>
31
+ <ParamField body="email" type="string" required>Contact email of the seller.</ParamField>
32
+ <ParamField body="currency_code" type="string" required>Default currency of the seller.</ParamField>
33
+ <ParamField body="handle" type="string">URL handle; auto-generated when omitted.</ParamField>
34
+ <ParamField body="description" type="string">Public seller description.</ParamField>
35
+ <ParamField body="metadata" type="object">Custom key-value data.</ParamField>
36
+ </Expandable>
37
+ </ParamField>
38
+ <ParamField body="member_email" type="string">Email for the new owner member; required when `member_id` is not provided.</ParamField>
39
+ <ParamField body="member_id" type="string">Existing member to link as owner instead of creating one.</ParamField>
40
+ <ParamField body="first_name" type="string">Owner member first name.</ParamField>
41
+ <ParamField body="last_name" type="string">Owner member last name.</ParamField>
42
+ <ParamField body="address" type="UpdateSellerAddressDTO">Seller address to set after creation.</ParamField>
43
+ <ParamField body="professional_details" type="UpdateProfessionalDetailsDTO">Professional details to set after creation.</ParamField>
44
+ <ParamField body="payment_details" type="UpdatePaymentDetailsDTO">Payment details to set after creation.</ParamField>
45
+ <ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
46
+
47
+ ## Result
48
+
49
+ <ResponseField name="result" type="SellerDTO">The created seller.</ResponseField>
50
+
51
+ ## Hooks
52
+
53
+ - `sellerAccountCreated` — runs after the account is assembled with `{ seller, additional_data }`.
54
+
55
+ ```ts
56
+ createSellerAccountWorkflow.hooks.sellerAccountCreated(async ({ seller }) => {
57
+ // provision extra resources for the new seller
58
+ })
59
+ ```
@@ -0,0 +1,22 @@
1
+ ---
2
+ title: "createSellerDefaultsWorkflow"
3
+ description: "Ensure the default seller roles exist."
4
+ ---
5
+
6
+ Idempotently creates the built-in seller roles (administration, inventory management, order management, accounting, support). Run before assigning roles to members; also executed automatically by `createSellerAccountWorkflow` and `acceptMemberInviteWorkflow`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { createSellerDefaultsWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await createSellerDefaultsWorkflow(container).run({})
14
+ ```
15
+
16
+ ## Input
17
+
18
+ No input.
19
+
20
+ ## Result
21
+
22
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
@@ -0,0 +1,65 @@
1
+ ---
2
+ title: "createSellersWorkflow"
3
+ description: "Create one or more sellers and invite their first member."
4
+ ---
5
+
6
+ Creates sellers (defaulting `status` to `pending_approval`), then runs `createMemberInvitesWorkflow` to invite each seller's initial member with the seller administration role. Triggered by `POST /admin/sellers`. Emits `seller.created` and `member_invite.created`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { createSellersWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ const { result } = await createSellersWorkflow(container).run({
14
+ input: {
15
+ sellers: [
16
+ {
17
+ name: "Acme",
18
+ email: "hello@acme.co",
19
+ currency_code: "usd",
20
+ member: { email: "owner@acme.co" },
21
+ },
22
+ ],
23
+ },
24
+ })
25
+ ```
26
+
27
+ ## Input
28
+
29
+ <ParamField body="sellers" type="object[]" required>
30
+ Sellers to create.
31
+ <Expandable title="properties">
32
+ <ParamField body="name" type="string" required>Display name of the seller.</ParamField>
33
+ <ParamField body="email" type="string" required>Contact email of the seller.</ParamField>
34
+ <ParamField body="currency_code" type="string" required>Default currency of the seller.</ParamField>
35
+ <ParamField body="member" type="object" required>Initial member to invite; `{ email: string }`.</ParamField>
36
+ <ParamField body="handle" type="string">URL handle; auto-generated from the name when omitted.</ParamField>
37
+ <ParamField body="description" type="string">Public seller description.</ParamField>
38
+ <ParamField body="logo" type="string">Logo URL.</ParamField>
39
+ <ParamField body="banner" type="string">Banner URL.</ParamField>
40
+ <ParamField body="website_url" type="string">Seller website URL.</ParamField>
41
+ <ParamField body="external_id" type="string">External system identifier.</ParamField>
42
+ <ParamField body="status" type="string">One of `open`, `pending_approval`, `suspended`, `terminated`; defaults to `pending_approval`.</ParamField>
43
+ <ParamField body="status_reason" type="string">Reason attached to the current status.</ParamField>
44
+ <ParamField body="is_premium" type="boolean">Marks the seller as premium.</ParamField>
45
+ <ParamField body="closed_from" type="Date">Start of a store closure window.</ParamField>
46
+ <ParamField body="closed_to" type="Date">End of a store closure window.</ParamField>
47
+ <ParamField body="metadata" type="object">Custom key-value data.</ParamField>
48
+ </Expandable>
49
+ </ParamField>
50
+ <ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
51
+
52
+ ## Result
53
+
54
+ <ResponseField name="result" type="SellerDTO[]">The created sellers.</ResponseField>
55
+
56
+ ## Hooks
57
+
58
+ - `validate` — runs before creation with `{ input }`.
59
+ - `sellersCreated` — runs after creation with `{ sellers, additional_data }`.
60
+
61
+ ```ts
62
+ createSellersWorkflow.hooks.sellersCreated(async ({ sellers, additional_data }) => {
63
+ // react to new sellers
64
+ })
65
+ ```
@@ -0,0 +1,37 @@
1
+ ---
2
+ title: "deleteSellerProfessionalDetailsWorkflow"
3
+ description: "Remove a seller's professional details."
4
+ ---
5
+
6
+ Deletes the professional details record attached to a seller.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { deleteSellerProfessionalDetailsWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await deleteSellerProfessionalDetailsWorkflow(container).run({
14
+ input: { seller_id: "sel_123" },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="seller_id" type="string" required>Id of the seller whose professional details are removed.</ParamField>
21
+ <ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
22
+
23
+ ## Result
24
+
25
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
26
+
27
+ ## Hooks
28
+
29
+ - `professionalDetailsDeleted` — runs after deletion with `{ seller_id, additional_data }`.
30
+
31
+ ```ts
32
+ deleteSellerProfessionalDetailsWorkflow.hooks.professionalDetailsDeleted(
33
+ async ({ seller_id }) => {
34
+ // e.g. flag the seller for re-verification
35
+ }
36
+ )
37
+ ```
@@ -0,0 +1,24 @@
1
+ ---
2
+ title: "deleteSellersWorkflow"
3
+ description: "Delete sellers by id."
4
+ ---
5
+
6
+ Soft-deletes the given sellers. Emits `seller.deleted` for each id.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { deleteSellersWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await deleteSellersWorkflow(container).run({
14
+ input: { ids: ["sel_123"] },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="ids" type="string[]" required>Ids of the sellers to delete.</ParamField>
21
+
22
+ ## Result
23
+
24
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: "inviteSellerWorkflow"
3
+ description: "Send a marketplace invitation email to a prospective seller."
4
+ ---
5
+
6
+ Sends an invitation email (via the notification module, `email` channel) inviting someone to register as a seller, optionally with a registration link. Not wired to a core API route — run it from your own routes or automations. Does not create any seller records.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { inviteSellerWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ const { result } = await inviteSellerWorkflow(container).run({
14
+ input: {
15
+ email: "owner@acme.co",
16
+ registration_url: "https://vendor.example.com/register",
17
+ },
18
+ })
19
+ ```
20
+
21
+ ## Input
22
+
23
+ <ParamField body="email" type="string" required>Recipient of the invitation email.</ParamField>
24
+ <ParamField body="registration_url" type="string">Link rendered as the email's call-to-action button.</ParamField>
25
+
26
+ ## Result
27
+
28
+ <ResponseField name="result" type="NotificationDTO">The created email notification.</ResponseField>
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "suspendSellerWorkflow"
3
+ description: "Suspend a seller with an optional reason."
4
+ ---
5
+
6
+ Validates the seller can be suspended, sets `status` to `suspended`, records the reason, and stamps `rejected_at` on first suspension. Triggered by `POST /admin/sellers/:id/suspend`. Emits `seller.suspended`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { suspendSellerWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await suspendSellerWorkflow(container).run({
14
+ input: { seller_id: "sel_123", reason: "Policy violation" },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="seller_id" type="string" required>Id of the seller to suspend.</ParamField>
21
+ <ParamField body="reason" type="string">Reason stored in `status_reason`.</ParamField>
22
+
23
+ ## Result
24
+
25
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
26
+
27
+ ## Hooks
28
+
29
+ - `sellerSuspended` — runs after suspension with `{ seller_id }`.
30
+
31
+ ```ts
32
+ suspendSellerWorkflow.hooks.sellerSuspended(async ({ seller_id }) => {
33
+ // e.g. pause the seller's listings
34
+ })
35
+ ```
@@ -0,0 +1,35 @@
1
+ ---
2
+ title: "terminateSellerWorkflow"
3
+ description: "Terminate a seller with an optional reason."
4
+ ---
5
+
6
+ Validates the seller can be terminated, then sets `status` to `terminated` and records the reason. Emits `seller.terminated`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { terminateSellerWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await terminateSellerWorkflow(container).run({
14
+ input: { seller_id: "sel_123", reason: "Account closure requested" },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="seller_id" type="string" required>Id of the seller to terminate.</ParamField>
21
+ <ParamField body="reason" type="string">Reason stored in `status_reason`.</ParamField>
22
+
23
+ ## Result
24
+
25
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
26
+
27
+ ## Hooks
28
+
29
+ - `sellerTerminated` — runs after termination with `{ seller_id }`.
30
+
31
+ ```ts
32
+ terminateSellerWorkflow.hooks.sellerTerminated(async ({ seller_id }) => {
33
+ // e.g. archive the seller's data
34
+ })
35
+ ```
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: "unsuspendSellerWorkflow"
3
+ description: "Lift a seller suspension."
4
+ ---
5
+
6
+ Validates the seller is currently suspended, then sets `status` back to `open` and clears `status_reason`. Triggered by `POST /admin/sellers/:id/unsuspend`. Emits `seller.unsuspended`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { unsuspendSellerWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await unsuspendSellerWorkflow(container).run({
14
+ input: { seller_id: "sel_123" },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="seller_id" type="string" required>Id of the suspended seller.</ParamField>
21
+
22
+ ## Result
23
+
24
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
25
+
26
+ ## Hooks
27
+
28
+ - `sellerUnsuspended` — runs after the status change with `{ seller_id }`.
29
+
30
+ ```ts
31
+ unsuspendSellerWorkflow.hooks.sellerUnsuspended(async ({ seller_id }) => {
32
+ // e.g. re-enable listings
33
+ })
34
+ ```
@@ -0,0 +1,34 @@
1
+ ---
2
+ title: "unterminateSellerWorkflow"
3
+ description: "Revert a terminated seller back to suspended."
4
+ ---
5
+
6
+ Validates the seller is currently terminated, then sets `status` to `suspended` and clears `status_reason`. The seller must be unsuspended separately to reopen the store. Emits `seller.unterminated`.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { unterminateSellerWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ await unterminateSellerWorkflow(container).run({
14
+ input: { seller_id: "sel_123" },
15
+ })
16
+ ```
17
+
18
+ ## Input
19
+
20
+ <ParamField body="seller_id" type="string" required>Id of the terminated seller.</ParamField>
21
+
22
+ ## Result
23
+
24
+ <ResponseField name="result" type="void">Nothing is returned.</ResponseField>
25
+
26
+ ## Hooks
27
+
28
+ - `sellerUnterminated` — runs after the status change with `{ seller_id }`.
29
+
30
+ ```ts
31
+ unterminateSellerWorkflow.hooks.sellerUnterminated(async ({ seller_id }) => {
32
+ // e.g. notify the operator
33
+ })
34
+ ```
@@ -0,0 +1,55 @@
1
+ ---
2
+ title: "updateSellerAddressWorkflow"
3
+ description: "Upsert a seller's address."
4
+ ---
5
+
6
+ Creates or updates the address record attached to a seller. Also run as a step by `createSellerAccountWorkflow` when an address is provided at registration.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { updateSellerAddressWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ const { result } = await updateSellerAddressWorkflow(container).run({
14
+ input: {
15
+ seller_id: "sel_123",
16
+ data: { address_1: "1 Main St", city: "Berlin", country_code: "de" },
17
+ },
18
+ })
19
+ ```
20
+
21
+ ## Input
22
+
23
+ <ParamField body="seller_id" type="string" required>Id of the seller whose address is updated.</ParamField>
24
+ <ParamField body="data" type="UpdateSellerAddressDTO" required>
25
+ Address fields to set; all optional.
26
+ <Expandable title="properties">
27
+ <ParamField body="name" type="string">Address label.</ParamField>
28
+ <ParamField body="company" type="string">Company name.</ParamField>
29
+ <ParamField body="first_name" type="string">Contact first name.</ParamField>
30
+ <ParamField body="last_name" type="string">Contact last name.</ParamField>
31
+ <ParamField body="address_1" type="string">Street address, line 1.</ParamField>
32
+ <ParamField body="address_2" type="string">Street address, line 2.</ParamField>
33
+ <ParamField body="city" type="string">City.</ParamField>
34
+ <ParamField body="country_code" type="string">ISO 2-letter country code.</ParamField>
35
+ <ParamField body="province" type="string">Province or state.</ParamField>
36
+ <ParamField body="postal_code" type="string">Postal code.</ParamField>
37
+ <ParamField body="phone" type="string">Phone number.</ParamField>
38
+ <ParamField body="metadata" type="object">Custom key-value data.</ParamField>
39
+ </Expandable>
40
+ </ParamField>
41
+ <ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
42
+
43
+ ## Result
44
+
45
+ <ResponseField name="result" type="SellerAddressDTO">The updated address.</ResponseField>
46
+
47
+ ## Hooks
48
+
49
+ - `addressUpdated` — runs after the update with `{ address, additional_data }`.
50
+
51
+ ```ts
52
+ updateSellerAddressWorkflow.hooks.addressUpdated(async ({ address }) => {
53
+ // e.g. re-verify tax settings
54
+ })
55
+ ```
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: "updateSellerPaymentDetailsWorkflow"
3
+ description: "Upsert a seller's bank payment details."
4
+ ---
5
+
6
+ Creates or updates the payment details record attached to a seller. Also run as a step by `createSellerAccountWorkflow` when payment details are provided at registration.
7
+
8
+ ## Usage
9
+
10
+ ```ts
11
+ import { updateSellerPaymentDetailsWorkflow } from "@mercurjs/core/workflows"
12
+
13
+ const { result } = await updateSellerPaymentDetailsWorkflow(container).run({
14
+ input: {
15
+ seller_id: "sel_123",
16
+ data: { holder_name: "Acme GmbH", iban: "DE89370400440532013000" },
17
+ },
18
+ })
19
+ ```
20
+
21
+ ## Input
22
+
23
+ <ParamField body="seller_id" type="string" required>Id of the seller whose payment details are updated.</ParamField>
24
+ <ParamField body="data" type="UpdatePaymentDetailsDTO" required>
25
+ Payment fields to set; all optional.
26
+ <Expandable title="properties">
27
+ <ParamField body="country_code" type="string">Bank country code.</ParamField>
28
+ <ParamField body="holder_name" type="string">Account holder name.</ParamField>
29
+ <ParamField body="bank_name" type="string">Bank name.</ParamField>
30
+ <ParamField body="iban" type="string">IBAN.</ParamField>
31
+ <ParamField body="bic" type="string">BIC / SWIFT code.</ParamField>
32
+ <ParamField body="routing_number" type="string">Routing number.</ParamField>
33
+ <ParamField body="account_number" type="string">Account number.</ParamField>
34
+ </Expandable>
35
+ </ParamField>
36
+ <ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
37
+
38
+ ## Result
39
+
40
+ <ResponseField name="result" type="PaymentDetailsDTO">The updated payment details.</ResponseField>
41
+
42
+ ## Hooks
43
+
44
+ - `paymentDetailsUpdated` — runs after the update with `{ payment_details, additional_data }`.
45
+
46
+ ```ts
47
+ updateSellerPaymentDetailsWorkflow.hooks.paymentDetailsUpdated(
48
+ async ({ payment_details }) => {
49
+ // e.g. trigger payout account re-verification
50
+ }
51
+ )
52
+ ```