@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
@@ -1,34 +0,0 @@
1
- ---
2
- title: "processPayoutForWebhookWorkflow"
3
- description: "Apply a payout provider webhook event to the matching account or payout."
4
- ---
5
-
6
- Maps a normalized provider webhook action to a status update: account events set the payout account to `active`, `restricted`, or `rejected`; payout events set the payout to `processing`, `paid`, `failed`, or `canceled`. Unsupported actions (or events without an ID) are ignored. Triggered by the `payout-webhook` subscriber after the payout provider parses the raw webhook payload.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { processPayoutForWebhookWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await processPayoutForWebhookWorkflow(container).run({
14
- input: {
15
- action: "payout.paid",
16
- data: { id: "payout_123" },
17
- },
18
- })
19
- ```
20
-
21
- ## Input
22
-
23
- <ParamField body="action" type="string" required>One of `account.activated`, `account.restricted`, `account.rejected`, `payout.processing`, `payout.paid`, `payout.failed`, `payout.canceled`, `not_supported`.</ParamField>
24
- <ParamField body="data" type="object">
25
- Event target; nothing happens when omitted.
26
-
27
- <Expandable title="properties">
28
- <ParamField body="id" type="string" required>The ID of the payout account (for `account.*` actions) or the payout (for `payout.*` actions).</ParamField>
29
- </Expandable>
30
- </ParamField>
31
-
32
- ## Result
33
-
34
- <ResponseField name="result" type="void">No return value; the matching account or payout status is updated as a side effect.</ResponseField>
@@ -1,48 +0,0 @@
1
- ---
2
- title: "confirmProductsWorkflow"
3
- description: "Approve proposed products and publish them to the catalog."
4
- ---
5
-
6
- Approves products awaiting review: validates every product is in `proposed` status, sets them to `published`, and records a confirmed `STATUS_CHANGE` audit action per product. Triggered by `POST /admin/products/:id/confirm`. Emits `product.published` with one `{ id, internal_note }` entry per product.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { confirmProductsWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await confirmProductsWorkflow(container).run({
14
- input: {
15
- product_ids: ["prod_01H..."],
16
- actor_id: "user_01H...",
17
- internal_note: "Approved after review",
18
- },
19
- })
20
- ```
21
-
22
- ## Input
23
-
24
- <ParamField body="product_ids" type="string[]" required>
25
- Ids of the products to publish. Every product must currently be in `proposed` status.
26
- </ParamField>
27
-
28
- <ParamField body="actor_id" type="string">
29
- Actor id recorded on the audit trail entry.
30
- </ParamField>
31
-
32
- <ParamField body="internal_note" type="string">
33
- Operator-only note stored on the audit change and included in the emitted event.
34
- </ParamField>
35
-
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="void">
41
- Returns nothing; the products are updated in place.
42
- </ResponseField>
43
-
44
- ## Hooks
45
-
46
- <ResponseField name="productsConfirmed" type="hook">
47
- Runs after publishing with `{ product_ids, internal_note }`.
48
- </ResponseField>
@@ -1,63 +0,0 @@
1
- ---
2
- title: "createProductsWorkflow"
3
- description: "Create master catalog products with seller eligibility and creator attribution."
4
- ---
5
-
6
- Creates master catalog products, resolving Mercur `attributes` inputs into native product options and value links, linking each product to its eligible sellers (`product_seller` links), and recording a confirmed `PRODUCT_ADD` audit action attributed to `created_by`. Triggered by `POST /admin/products` and `POST /vendor/products`. Variants default to `manage_inventory: false` unless set explicitly. Emits `product.created`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { createProductsWorkflow } from "@mercurjs/core/workflows"
12
-
13
- const { result } = await createProductsWorkflow(container).run({
14
- input: {
15
- products: [{ title: "Linen Shirt", seller_ids: ["sel_01H..."] }],
16
- created_by: "sel_01H...",
17
- },
18
- })
19
- ```
20
-
21
- ## Input
22
-
23
- <ParamField body="products" type="object[]" required>
24
- Products to create.
25
- <Expandable title="properties">
26
- <ParamField body="title" type="string" required>
27
- The product title. All Medusa `CreateProductDTO` fields (handle, description, status, variants, categories, images, etc.) are accepted, except `options`.
28
- </ParamField>
29
- <ParamField body="attributes" type="ProductAttributeBatchAdd[]">
30
- Attribute inputs resolved into native options and value links — `{ id, value_ids }` / `{ id, value }` for existing attributes, or `{ title, values, is_variant_axis }` / `{ title, type, value }` for inline ones. Do not pass native `options`.
31
- </ParamField>
32
- <ParamField body="seller_ids" type="string[]">
33
- Seller ids to link to the product as eligible sellers.
34
- </ParamField>
35
- <ParamField body="variants" type="object[]">
36
- Variants to create; `options` name-maps bind them to axis attributes. `manage_inventory` defaults to `false`.
37
- </ParamField>
38
- </Expandable>
39
- </ParamField>
40
-
41
- <ParamField body="created_by" type="string" required>
42
- Actor id recorded on the `PRODUCT_ADD` audit action.
43
- </ParamField>
44
-
45
- <ParamField body="additional_data" type="object">
46
- Arbitrary data forwarded to the underlying Medusa create workflows and the `productsCreated` hook.
47
- </ParamField>
48
-
49
- ## Result
50
-
51
- <ResponseField name="result" type="ProductDTO[]">
52
- The created products, including their generated ids, options, and statuses.
53
- </ResponseField>
54
-
55
- ## Hooks
56
-
57
- <ResponseField name="validate" type="hook">
58
- Runs first with `{ input, products }` — use it to reject invalid payloads before anything is created.
59
- </ResponseField>
60
-
61
- <ResponseField name="productsCreated" type="hook">
62
- Runs after creation with `{ products, additional_data }`.
63
- </ResponseField>
@@ -1,40 +0,0 @@
1
- ---
2
- title: "linkSellersToProductCategoryWorkflow"
3
- description: "Add or remove seller eligibility links on a product category."
4
- ---
5
-
6
- Updates which sellers are allowed to sell in a product category by creating and removing seller–category links in one call — the mechanism behind restricted categories. Triggered by `POST /admin/product-categories/:id/sellers`. No events are emitted.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { linkSellersToProductCategoryWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await linkSellersToProductCategoryWorkflow(container).run({
14
- input: {
15
- id: "pcat_01H...",
16
- add: ["sel_01H..."],
17
- remove: ["sel_01J..."],
18
- },
19
- })
20
- ```
21
-
22
- ## Input
23
-
24
- <ParamField body="id" type="string" required>
25
- Id of the product category whose seller links are being updated.
26
- </ParamField>
27
-
28
- <ParamField body="add" type="string[]">
29
- Seller ids to link to the category.
30
- </ParamField>
31
-
32
- <ParamField body="remove" type="string[]">
33
- Seller ids to unlink from the category.
34
- </ParamField>
35
-
36
- ## Result
37
-
38
- <ResponseField name="result" type="void">
39
- Returns nothing; the links are created and removed in place.
40
- </ResponseField>
@@ -1,40 +0,0 @@
1
- ---
2
- title: "linkSellersToProductWorkflow"
3
- description: "Add or remove seller eligibility links on a master product."
4
- ---
5
-
6
- Updates which sellers are eligible for a master product by creating and removing `product_seller` links in one call. Triggered by `POST /admin/products/:id/sellers`. No events are emitted and the product record itself is untouched.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { linkSellersToProductWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await linkSellersToProductWorkflow(container).run({
14
- input: {
15
- id: "prod_01H...",
16
- add: ["sel_01H..."],
17
- remove: ["sel_01J..."],
18
- },
19
- })
20
- ```
21
-
22
- ## Input
23
-
24
- <ParamField body="id" type="string" required>
25
- Id of the product whose seller links are being updated.
26
- </ParamField>
27
-
28
- <ParamField body="add" type="string[]">
29
- Seller ids to link to the product.
30
- </ParamField>
31
-
32
- <ParamField body="remove" type="string[]">
33
- Seller ids to unlink from the product.
34
- </ParamField>
35
-
36
- ## Result
37
-
38
- <ResponseField name="result" type="void">
39
- Returns nothing; the links are created and removed in place.
40
- </ResponseField>
@@ -1,48 +0,0 @@
1
- ---
2
- title: "rejectProductWorkflow"
3
- description: "Reject a proposed product submission with an optional message to the vendor."
4
- ---
5
-
6
- Rejects a product awaiting review: validates the product is in `proposed` status, sets it to `rejected`, and records a confirmed `STATUS_CHANGE` audit action whose `external_note` carries the rejection message. Triggered by `POST /admin/products/:id/reject`. Emits `product.rejected` with `{ id, message }`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { rejectProductWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await rejectProductWorkflow(container).run({
14
- input: {
15
- product_id: "prod_01H...",
16
- message: "Images do not meet marketplace guidelines",
17
- actor_id: "user_01H...",
18
- },
19
- })
20
- ```
21
-
22
- ## Input
23
-
24
- <ParamField body="product_id" type="string" required>
25
- Id of the product to reject. Must currently be in `proposed` status.
26
- </ParamField>
27
-
28
- <ParamField body="message" type="string">
29
- Vendor-facing rejection reason, stored as the audit change's `external_note` and included in the emitted event.
30
- </ParamField>
31
-
32
- <ParamField body="actor_id" type="string">
33
- Actor id recorded on the audit trail entry.
34
- </ParamField>
35
-
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="void">
41
- Returns nothing; the product status is updated in place.
42
- </ResponseField>
43
-
44
- ## Hooks
45
-
46
- <ResponseField name="productRejected" type="hook">
47
- Runs after rejection with `{ product_id, message }`.
48
- </ResponseField>
@@ -1,48 +0,0 @@
1
- ---
2
- title: "requestProductChangeWorkflow"
3
- description: "Ask a vendor to revise a proposed product submission without changing its status."
4
- ---
5
-
6
- Records an operator's request for revisions on a product awaiting review. Validates the product is in `proposed` status and records a confirmed `CHANGE_REQUESTED` audit action — the product itself is not mutated; the audit entry and its `external_note` are the durable signal to the vendor. Triggered by `POST /admin/products/:id/request-changes`. Emits `product.change-requested` with `{ id, message, actor_id }`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { requestProductChangeWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await requestProductChangeWorkflow(container).run({
14
- input: {
15
- product_id: "prod_01H...",
16
- message: "Please add care instructions to the description",
17
- actor_id: "user_01H...",
18
- },
19
- })
20
- ```
21
-
22
- ## Input
23
-
24
- <ParamField body="product_id" type="string" required>
25
- Id of the product to request changes on. Must currently be in `proposed` status.
26
- </ParamField>
27
-
28
- <ParamField body="message" type="string">
29
- Vendor-facing revision request, stored as the audit change's `external_note` and in the action's `details.message`.
30
- </ParamField>
31
-
32
- <ParamField body="actor_id" type="string">
33
- Actor id recorded on the audit trail entry.
34
- </ParamField>
35
-
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="void">
41
- Returns nothing; only an audit entry is created.
42
- </ResponseField>
43
-
44
- ## Hooks
45
-
46
- <ResponseField name="productChangeRequested" type="hook">
47
- Runs after the audit entry is recorded with `{ product_id, message }`.
48
- </ResponseField>
@@ -1,49 +0,0 @@
1
- ---
2
- title: "addProductAttributesToProductWorkflow"
3
- description: "Attach existing or inline attributes (and their values) to a product."
4
- ---
5
-
6
- Handles the `add` portion of the attribute batch engine (`createAndLinkProductAttributesToProductWorkflow`). Existing `text`/`unit` attributes get a new value created from `value`; `toggle` links the seeded `true`/`false` value; existing variant-axis `multi_select` attributes have their mirror `ProductOption` attached to the product with the selected value subset. Inline refs create a product-scoped attribute — axis refs also create an exclusive `ProductOption` — and link the values to the product.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { addProductAttributesToProductWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await addProductAttributesToProductWorkflow(container).run({
14
- input: {
15
- product_id: "prod_123",
16
- add: [
17
- { id: "pattr_material", value: "Cotton" },
18
- { title: "Size", values: ["S", "M", "L"], is_variant_axis: true },
19
- ],
20
- },
21
- })
22
- ```
23
-
24
- Also accepts an array of `{ product_id, add }` items to process several products in one run.
25
-
26
- ## Input
27
-
28
- <ParamField body="product_id" type="string" required>The product to attach the attributes to.</ParamField>
29
- <ParamField body="add" type="ProductAttributeBatchAdd[]" required>
30
- Attribute refs to attach.
31
- <Expandable title="properties">
32
- <ParamField body="id" type="string">Id of an existing attribute (existing form).</ParamField>
33
- <ParamField body="value_ids" type="string[]">Attribute value ids to link (select types / axis subset).</ParamField>
34
- <ParamField body="value" type="string | number | boolean">Scalar for `text` / `unit` / `toggle` attributes.</ParamField>
35
- <ParamField body="title" type="string">Name of the inline attribute to create (inline form).</ParamField>
36
- <ParamField body="type" type="AttributeType">One of `single_select`, `multi_select`, `unit`, `toggle`, `text`; inferred when omitted (`is_variant_axis` ⇒ `multi_select`, boolean `value` ⇒ `toggle`, else `text`).</ParamField>
37
- <ParamField body="values" type="string[]">Value names to create for inline multi-value attributes.</ParamField>
38
- <ParamField body="is_variant_axis" type="boolean">Create the inline attribute as a variant axis with an exclusive product option.</ParamField>
39
- <ParamField body="is_filterable" type="boolean">Whether the inline attribute is filterable. Defaults to `false`.</ParamField>
40
- <ParamField body="is_required" type="boolean">Whether the inline attribute is required. Defaults to `false`.</ParamField>
41
- <ParamField body="description" type="string | null">Description of the inline attribute.</ParamField>
42
- <ParamField body="metadata" type="object | null">Custom key-value data on the inline attribute.</ParamField>
43
- </Expandable>
44
- </ParamField>
45
- <ParamField body="additional_data" type="object">Custom data passed through.</ParamField>
46
-
47
- ## Result
48
-
49
- <ResponseField name="result" type="void">No return value.</ResponseField>
@@ -1,46 +0,0 @@
1
- ---
2
- title: "createAndLinkProductAttributesToProductWorkflow"
3
- description: "Batch attach, detach, and update attribute selections on a product."
4
- ---
5
-
6
- The batch orchestrator behind `POST /admin/products/:id/attributes/batch` and `POST /vendor/products/:id/attributes/batch`. Delegates to `removeProductAttributesFromProductWorkflow`, `addProductAttributesToProductWorkflow`, and `updateProductAttributesOnProductWorkflow`, applied in the order **remove → add → update** so removing and re-adding the same attribute in one call resolves correctly.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { createAndLinkProductAttributesToProductWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await createAndLinkProductAttributesToProductWorkflow(container).run({
14
- input: {
15
- product_id: "prod_123",
16
- add: [{ id: "pattr_color", value_ids: ["pattrval_red"] }],
17
- remove: ["pattr_old"],
18
- update: [{ id: "pattr_size", add: ["pattrval_xl"] }],
19
- },
20
- })
21
- ```
22
-
23
- ## Input
24
-
25
- <ParamField body="product_id" type="string" required>The product whose attributes are being managed.</ParamField>
26
- <ParamField body="add" type="ProductAttributeBatchAdd[]">Attributes to attach — existing (`{ id, value_ids | value }`) or inline (`{ title, type?, value | values, is_variant_axis? }`).</ParamField>
27
- <ParamField body="remove" type="string[]">Ids of attributes to detach; product-scoped attributes are deleted, shared ones are unlinked.</ParamField>
28
- <ParamField body="update" type="ProductAttributeBatchUpdate[]">Per-attribute selection changes (`{ id, title?, add?, remove?, value? }`).</ParamField>
29
- <ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
30
-
31
- ## Result
32
-
33
- <ResponseField name="result" type="void">No return value.</ResponseField>
34
-
35
- ## Hooks
36
-
37
- - `validate` — runs before any mutation with `{ input }`; throw to reject the batch.
38
- - `productAttributesLinked` — runs after all sub-workflows with `{ product_id }`.
39
-
40
- ```ts
41
- createAndLinkProductAttributesToProductWorkflow.hooks.productAttributesLinked(
42
- async ({ product_id }) => {
43
- // re-index the product
44
- },
45
- )
46
- ```
@@ -1,43 +0,0 @@
1
- ---
2
- title: "createProductAttributeValuesWorkflow"
3
- description: "Add values to an attribute, mirroring them onto its product option."
4
- ---
5
-
6
- Creates values on an existing attribute. If the attribute is a variant-axis `multi_select` with a mirror `ProductOption`, the option's value list is extended first and each new attribute value is bound to its option value via `product_option_value_id`. Triggered by `POST /admin/product-attributes/:id/values`. Emits `product-attribute-value.created`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { createProductAttributeValuesWorkflow } from "@mercurjs/core/workflows"
12
-
13
- const { result } = await createProductAttributeValuesWorkflow(container).run({
14
- input: {
15
- attribute_id: "pattr_color",
16
- values: [{ name: "Green" }, { name: "Yellow", rank: 5 }],
17
- },
18
- })
19
- ```
20
-
21
- ## Input
22
-
23
- <ParamField body="attribute_id" type="string" required>The attribute to add the values to.</ParamField>
24
- <ParamField body="values" type="CreateProductAttributeValueDTO[]" required>
25
- Values to create.
26
- <Expandable title="properties">
27
- <ParamField body="name" type="string" required>Display name of the value.</ParamField>
28
- <ParamField body="handle" type="string">URL-safe handle; auto-generated when omitted.</ParamField>
29
- <ParamField body="rank" type="number">Sort rank.</ParamField>
30
- <ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
31
- <ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
32
- </Expandable>
33
- </ParamField>
34
- <ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
35
-
36
- ## Result
37
-
38
- <ResponseField name="result" type="ProductAttributeValueDTO[]">The created values.</ResponseField>
39
-
40
- ## Hooks
41
-
42
- - `validate` — runs before creation with `{ input }`.
43
- - `productAttributeValuesCreated` — runs after creation with `{ values, additional_data }`.
@@ -1,56 +0,0 @@
1
- ---
2
- title: "createProductAttributesWorkflow"
3
- description: "Create catalog attributes with values, mirror options, and category links."
4
- ---
5
-
6
- Creates product attributes and their values. Variant-axis `multi_select` attributes also get a shared mirror `ProductOption` created, with each value bound to its option value. Optional `category_ids` create category links per attribute. Triggered by `POST /admin/product-attributes`. Emits `product-attribute.created`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { createProductAttributesWorkflow } from "@mercurjs/core/workflows"
12
-
13
- const { result } = await createProductAttributesWorkflow(container).run({
14
- input: {
15
- attributes: [
16
- {
17
- name: "Color",
18
- type: "multi_select",
19
- is_variant_axis: true,
20
- values: [{ name: "Red" }, { name: "Blue" }],
21
- category_ids: ["pcat_apparel"],
22
- },
23
- ],
24
- },
25
- })
26
- ```
27
-
28
- ## Input
29
-
30
- <ParamField body="attributes" type="(CreateProductAttributeDTO & { category_ids?: string[] })[]" required>
31
- Attributes to create.
32
- <Expandable title="properties">
33
- <ParamField body="name" type="string" required>Display name of the attribute.</ParamField>
34
- <ParamField body="type" type="AttributeType" required>One of `single_select`, `multi_select`, `unit`, `toggle`, `text`.</ParamField>
35
- <ParamField body="handle" type="string">URL-safe handle; auto-generated when omitted.</ParamField>
36
- <ParamField body="description" type="string | null">Description of the attribute.</ParamField>
37
- <ParamField body="is_required" type="boolean">Whether products must carry this attribute.</ParamField>
38
- <ParamField body="is_filterable" type="boolean">Whether the attribute is exposed as a storefront filter.</ParamField>
39
- <ParamField body="is_variant_axis" type="boolean">Mirror the attribute as a shared `ProductOption` (with `type: multi_select`).</ParamField>
40
- <ParamField body="rank" type="number">Sort rank.</ParamField>
41
- <ParamField body="is_active" type="boolean">Whether the attribute is active.</ParamField>
42
- <ParamField body="values" type="CreateProductAttributeValueDTO[]">Values to create (`{ name, handle?, rank?, is_active?, metadata? }`).</ParamField>
43
- <ParamField body="category_ids" type="string[]">Category ids to link the attribute to.</ParamField>
44
- <ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
45
- </Expandable>
46
- </ParamField>
47
- <ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
48
-
49
- ## Result
50
-
51
- <ResponseField name="result" type="ProductAttributeDTO[]">The created attributes.</ResponseField>
52
-
53
- ## Hooks
54
-
55
- - `validate` — runs before creation with `{ input }`.
56
- - `productAttributesCreated` — runs after creation with `{ attributes, additional_data }`.
@@ -1,30 +0,0 @@
1
- ---
2
- title: "deleteProductAttributeValuesWorkflow"
3
- description: "Delete attribute values and shrink the mirror option accordingly."
4
- ---
5
-
6
- Deletes attribute values by id. When the deleted values belong to a single variant-axis `multi_select` attribute with a mirror `ProductOption`, the option's value list is rewritten to the attribute's remaining value names. Triggered by `DELETE /admin/product-attributes/:id/values/:value_id`; also run internally by the batch update engine. Emits `product-attribute-value.deleted`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { deleteProductAttributeValuesWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await deleteProductAttributeValuesWorkflow(container).run({
14
- input: { ids: ["pattrval_123", "pattrval_456"] },
15
- })
16
- ```
17
-
18
- ## Input
19
-
20
- <ParamField body="ids" type="string[]" required>Ids of the attribute values to delete.</ParamField>
21
- <ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
22
-
23
- ## Result
24
-
25
- <ResponseField name="result" type="void">No return value.</ResponseField>
26
-
27
- ## Hooks
28
-
29
- - `validate` — runs before deletion with `{ input }`.
30
- - `productAttributeValuesDeleted` — runs after deletion with `{ ids, additional_data }`.
@@ -1,30 +0,0 @@
1
- ---
2
- title: "deleteProductAttributesWorkflow"
3
- description: "Delete attributes and their mirror product options."
4
- ---
5
-
6
- Deletes product attributes after validating none of them is still linked to a product or category. Mirror `ProductOption`s of axis attributes are deleted alongside. Triggered by `DELETE /admin/product-attributes/:id`; also run internally when detaching product-scoped attributes. Emits `product-attribute.deleted`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { deleteProductAttributesWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await deleteProductAttributesWorkflow(container).run({
14
- input: { ids: ["pattr_123"] },
15
- })
16
- ```
17
-
18
- ## Input
19
-
20
- <ParamField body="ids" type="string[]" required>Ids of the attributes to delete; the workflow throws if an attribute is still linked.</ParamField>
21
- <ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
22
-
23
- ## Result
24
-
25
- <ResponseField name="result" type="void">No return value.</ResponseField>
26
-
27
- ## Hooks
28
-
29
- - `validate` — runs before deletion with `{ input }`.
30
- - `productAttributesDeleted` — runs after deletion with `{ ids, additional_data }`.
@@ -1,29 +0,0 @@
1
- ---
2
- title: "removeProductAttributesFromProductWorkflow"
3
- description: "Detach attributes from a product, deleting product-scoped ones."
4
- ---
5
-
6
- Handles the `remove` portion of the attribute batch engine (`createAndLinkProductAttributesToProductWorkflow`). Rejects required attributes, dismisses the product's value links for every listed attribute, detaches the mirror `ProductOption` for shared axis attributes, and runs `deleteProductAttributesWorkflow` for product-scoped (inline) attributes so their exclusive options are deleted too.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { removeProductAttributesFromProductWorkflow } from "@mercurjs/core/workflows"
12
-
13
- await removeProductAttributesFromProductWorkflow(container).run({
14
- input: {
15
- product_id: "prod_123",
16
- remove: ["pattr_color", "pattr_custom_size"],
17
- },
18
- })
19
- ```
20
-
21
- ## Input
22
-
23
- <ParamField body="product_id" type="string" required>The product to detach the attributes from.</ParamField>
24
- <ParamField body="remove" type="string[]" required>Ids of the attributes to detach; attributes with `is_required: true` cause the workflow to throw.</ParamField>
25
- <ParamField body="additional_data" type="object">Custom data passed through.</ParamField>
26
-
27
- ## Result
28
-
29
- <ResponseField name="result" type="void">No return value.</ResponseField>
@@ -1,44 +0,0 @@
1
- ---
2
- title: "updateProductAttributeValuesWorkflow"
3
- description: "Update attribute values matching a selector and re-sync the mirror option."
4
- ---
5
-
6
- Updates attribute values by selector. When the touched values belong to a single variant-axis `multi_select` attribute with a mirror `ProductOption`, the option's value list is rewritten from the attribute's current value names. Triggered by `POST /admin/product-attributes/:id/values/:value_id`. Emits `product-attribute-value.updated`.
7
-
8
- ## Usage
9
-
10
- ```ts
11
- import { updateProductAttributeValuesWorkflow } from "@mercurjs/core/workflows"
12
-
13
- const { result } = await updateProductAttributeValuesWorkflow(container).run({
14
- input: {
15
- selector: { id: "pattrval_123" },
16
- update: { name: "Dark Green" },
17
- },
18
- })
19
- ```
20
-
21
- ## Input
22
-
23
- <ParamField body="selector" type="object" required>Filter for the values to update, e.g. `{ id: "pattrval_123" }`.</ParamField>
24
- <ParamField body="update" type="UpdateProductAttributeValueDTO" required>
25
- Fields to set on every matched value.
26
- <Expandable title="properties">
27
- <ParamField body="name" type="string">New display name.</ParamField>
28
- <ParamField body="handle" type="string">New handle.</ParamField>
29
- <ParamField body="rank" type="number">Sort rank.</ParamField>
30
- <ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
31
- <ParamField body="product_option_value_id" type="string | null">Bound mirror option value.</ParamField>
32
- <ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
33
- </Expandable>
34
- </ParamField>
35
- <ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
36
-
37
- ## Result
38
-
39
- <ResponseField name="result" type="ProductAttributeValueDTO[]">The updated values.</ResponseField>
40
-
41
- ## Hooks
42
-
43
- - `validate` — runs before the update with `{ input }`.
44
- - `productAttributeValuesUpdated` — runs after the update with `{ values, additional_data }`.