@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,74 @@
1
+ ---
2
+ title: "Upsert Payment Details"
3
+ api: "POST /vendor/sellers/{id}/payment-details"
4
+ description: "Create or update the seller's bank account details."
5
+ ---
6
+
7
+ Upserts the seller's payment details and returns the full seller object.
8
+
9
+ ## Path parameters
10
+
11
+ <ParamField path="id" type="string" required>
12
+ The seller's ID.
13
+ </ParamField>
14
+
15
+ ## Body parameters
16
+
17
+ <ParamField body="country_code" type="string">Bank country code.</ParamField>
18
+ <ParamField body="holder_name" type="string">Account holder name.</ParamField>
19
+ <ParamField body="bank_name" type="string">Bank name.</ParamField>
20
+ <ParamField body="iban" type="string">IBAN.</ParamField>
21
+ <ParamField body="bic" type="string">BIC / SWIFT code.</ParamField>
22
+ <ParamField body="routing_number" type="string">Routing number.</ParamField>
23
+ <ParamField body="account_number" type="string">Account number.</ParamField>
24
+ <ParamField body="additional_data" type="object">Custom data passed to workflow hooks.</ParamField>
25
+
26
+ ## Query parameters
27
+
28
+ <ParamField query="fields" type="string">
29
+ Comma-separated fields to include in the response.
30
+ </ParamField>
31
+
32
+ ## Response
33
+
34
+ <ResponseField name="seller" type="object">
35
+ <Expandable title="properties">
36
+ <ResponseField name="id" type="string">The seller's ID.</ResponseField>
37
+ <ResponseField name="payment_details" type="object">The updated payment details.</ResponseField>
38
+ </Expandable>
39
+ </ResponseField>
40
+
41
+ <RequestExample>
42
+ ```bash cURL
43
+ curl -X POST 'http://localhost:9000/vendor/sellers/sel_01HXYZ/payment-details' \
44
+ -H 'Authorization: Bearer <token>' \
45
+ -H 'x-seller-id: <seller_id>' \
46
+ -H 'Content-Type: application/json' \
47
+ -d '{"holder_name": "Acme Inc.", "iban": "DE89370400440532013000", "bic": "COBADEFFXXX"}'
48
+ ```
49
+
50
+ ```ts JS Client
51
+ const { seller } = await client.vendor.sellers.$id.paymentDetails.mutate({
52
+ $id: "sel_01HXYZ",
53
+ holder_name: "Acme Inc.",
54
+ iban: "DE89370400440532013000",
55
+ bic: "COBADEFFXXX",
56
+ })
57
+ ```
58
+ </RequestExample>
59
+
60
+ <ResponseExample>
61
+ ```json 200
62
+ {
63
+ "seller": {
64
+ "id": "sel_01HXYZ",
65
+ "name": "Acme Store",
66
+ "payment_details": {
67
+ "holder_name": "Acme Inc.",
68
+ "iban": "DE89370400440532013000",
69
+ "bic": "COBADEFFXXX"
70
+ }
71
+ }
72
+ }
73
+ ```
74
+ </ResponseExample>
@@ -0,0 +1,70 @@
1
+ ---
2
+ title: "Upsert Professional Details"
3
+ api: "POST /vendor/sellers/{id}/professional-details"
4
+ description: "Create or update the seller's business registration details."
5
+ ---
6
+
7
+ Upserts the seller's professional details and returns the full seller object.
8
+
9
+ ## Path parameters
10
+
11
+ <ParamField path="id" type="string" required>
12
+ The seller's ID.
13
+ </ParamField>
14
+
15
+ ## Body parameters
16
+
17
+ <ParamField body="corporate_name" type="string">Registered corporate name.</ParamField>
18
+ <ParamField body="registration_number" type="string">Business registration number.</ParamField>
19
+ <ParamField body="tax_id" type="string">Tax identification number.</ParamField>
20
+ <ParamField body="additional_data" type="object">Custom data passed to workflow hooks.</ParamField>
21
+
22
+ ## Query parameters
23
+
24
+ <ParamField query="fields" type="string">
25
+ Comma-separated fields to include in the response.
26
+ </ParamField>
27
+
28
+ ## Response
29
+
30
+ <ResponseField name="seller" type="object">
31
+ <Expandable title="properties">
32
+ <ResponseField name="id" type="string">The seller's ID.</ResponseField>
33
+ <ResponseField name="professional_details" type="object">The updated professional details.</ResponseField>
34
+ </Expandable>
35
+ </ResponseField>
36
+
37
+ <RequestExample>
38
+ ```bash cURL
39
+ curl -X POST 'http://localhost:9000/vendor/sellers/sel_01HXYZ/professional-details' \
40
+ -H 'Authorization: Bearer <token>' \
41
+ -H 'x-seller-id: <seller_id>' \
42
+ -H 'Content-Type: application/json' \
43
+ -d '{"corporate_name": "Acme Inc.", "registration_number": "HRB 12345", "tax_id": "DE123456789"}'
44
+ ```
45
+
46
+ ```ts JS Client
47
+ const { seller } = await client.vendor.sellers.$id.professionalDetails.mutate({
48
+ $id: "sel_01HXYZ",
49
+ corporate_name: "Acme Inc.",
50
+ registration_number: "HRB 12345",
51
+ tax_id: "DE123456789",
52
+ })
53
+ ```
54
+ </RequestExample>
55
+
56
+ <ResponseExample>
57
+ ```json 200
58
+ {
59
+ "seller": {
60
+ "id": "sel_01HXYZ",
61
+ "name": "Acme Store",
62
+ "professional_details": {
63
+ "corporate_name": "Acme Inc.",
64
+ "registration_number": "HRB 12345",
65
+ "tax_id": "DE123456789"
66
+ }
67
+ }
68
+ }
69
+ ```
70
+ </ResponseExample>
@@ -0,0 +1,81 @@
1
+ ---
2
+ title: "Upsert Seller Address"
3
+ api: "POST /vendor/sellers/{id}/address"
4
+ description: "Create or update the seller's address."
5
+ ---
6
+
7
+ Upserts the seller's address and returns the full seller object.
8
+
9
+ ## Path parameters
10
+
11
+ <ParamField path="id" type="string" required>
12
+ The seller's ID.
13
+ </ParamField>
14
+
15
+ ## Body parameters
16
+
17
+ <ParamField body="name" type="string">Address label.</ParamField>
18
+ <ParamField body="company" type="string">Company name.</ParamField>
19
+ <ParamField body="first_name" type="string">Contact first name.</ParamField>
20
+ <ParamField body="last_name" type="string">Contact last name.</ParamField>
21
+ <ParamField body="address_1" type="string">Street address.</ParamField>
22
+ <ParamField body="address_2" type="string">Apartment, suite, etc.</ParamField>
23
+ <ParamField body="city" type="string">City.</ParamField>
24
+ <ParamField body="country_code" type="string">Two-letter country code.</ParamField>
25
+ <ParamField body="province" type="string">Province or state.</ParamField>
26
+ <ParamField body="postal_code" type="string">Postal code.</ParamField>
27
+ <ParamField body="phone" type="string">Phone number.</ParamField>
28
+ <ParamField body="metadata" type="object">Custom key-value pairs.</ParamField>
29
+ <ParamField body="additional_data" type="object">Custom data passed to workflow hooks.</ParamField>
30
+
31
+ ## Query parameters
32
+
33
+ <ParamField query="fields" type="string">
34
+ Comma-separated fields to include in the response.
35
+ </ParamField>
36
+
37
+ ## Response
38
+
39
+ <ResponseField name="seller" type="object">
40
+ <Expandable title="properties">
41
+ <ResponseField name="id" type="string">The seller's ID.</ResponseField>
42
+ <ResponseField name="address" type="object">The updated address.</ResponseField>
43
+ </Expandable>
44
+ </ResponseField>
45
+
46
+ <RequestExample>
47
+ ```bash cURL
48
+ curl -X POST 'http://localhost:9000/vendor/sellers/sel_01HXYZ/address' \
49
+ -H 'Authorization: Bearer <token>' \
50
+ -H 'x-seller-id: <seller_id>' \
51
+ -H 'Content-Type: application/json' \
52
+ -d '{"address_1": "123 Main St", "city": "New York", "country_code": "us", "postal_code": "10001"}'
53
+ ```
54
+
55
+ ```ts JS Client
56
+ const { seller } = await client.vendor.sellers.$id.address.mutate({
57
+ $id: "sel_01HXYZ",
58
+ address_1: "123 Main St",
59
+ city: "New York",
60
+ country_code: "us",
61
+ postal_code: "10001",
62
+ })
63
+ ```
64
+ </RequestExample>
65
+
66
+ <ResponseExample>
67
+ ```json 200
68
+ {
69
+ "seller": {
70
+ "id": "sel_01HXYZ",
71
+ "name": "Acme Store",
72
+ "address": {
73
+ "address_1": "123 Main St",
74
+ "city": "New York",
75
+ "country_code": "us",
76
+ "postal_code": "10001"
77
+ }
78
+ }
79
+ }
80
+ ```
81
+ </ResponseExample>
@@ -0,0 +1,150 @@
1
+ ---
2
+ title: "Vendor API"
3
+ description: "Seller-scoped routes under /vendor/* — every request operates on the authenticated member's selected seller."
4
+ ---
5
+
6
+ The Vendor API is the seller's surface. Every route is scoped to one seller through the member authentication and `x-seller-id` mechanism described in [API conventions](/rc/references/api/conventions#vendor) — a seller can never read or mutate another seller's data.
7
+
8
+ ## Account and team
9
+
10
+ | Method | Path | Purpose |
11
+ | --- | --- | --- |
12
+ | `GET` `POST` | `/vendor/sellers` | Registration lookup / create a seller account (**public**) |
13
+ | `POST` | `/vendor/sellers/select` | Select the active seller for the session |
14
+ | `GET` `POST` | `/vendor/sellers/me` | Retrieve / update the current seller |
15
+ | `POST` | `/vendor/sellers/:id/address` | Upsert the seller address |
16
+ | `POST` | `/vendor/sellers/:id/payment-details` | Upsert payment details |
17
+ | `POST` `DELETE` | `/vendor/sellers/:id/professional-details` | Upsert / remove professional details |
18
+ | `GET` `POST` | `/vendor/sellers/:id/members` | List / manage members |
19
+ | `POST` `DELETE` | `/vendor/sellers/:id/members/:member_id` | Update role / remove a member |
20
+ | `GET` | `/vendor/sellers/:id/members/me` | The current member within this seller |
21
+ | `GET` | `/vendor/sellers/:id/members/invites` | List pending invites |
22
+ | `GET` `POST` | `/vendor/members/me` | Retrieve / update the current member profile |
23
+ | `POST` | `/vendor/members/invites/accept` | Accept an invite (**public**) |
24
+
25
+ ## Products and offers
26
+
27
+ Products are shared master records: updates stage a [change request](/rc/references/modules/product-edit) rather than writing directly, and the list shows products the seller created plus published, unrestricted products.
28
+
29
+ | Method | Path | Purpose |
30
+ | --- | --- | --- |
31
+ | `GET` `POST` | `/vendor/products` | List / create a product (created as `proposed`) |
32
+ | `GET` `POST` `DELETE` | `/vendor/products/:id` | Retrieve / request an update / request deletion |
33
+ | `GET` | `/vendor/products/:id/preview` | Preview with pending changes applied |
34
+ | `POST` | `/vendor/products/:id/cancel` | Withdraw the pending change request |
35
+ | `POST` | `/vendor/products/:id/attributes/batch` | Batch add / update / remove attributes |
36
+ | `GET` `POST` | `/vendor/products/:id/variants` | List / create variants |
37
+ | `GET` `POST` `DELETE` | `/vendor/products/:id/variants/:variant_id` | Retrieve / update / delete a variant |
38
+ | `GET` | `/vendor/product-variants` | List variants across products |
39
+ | `GET` `POST` | `/vendor/offers` | List / create offers |
40
+ | `GET` `POST` `DELETE` | `/vendor/offers/:id` | Retrieve / update / delete an offer |
41
+ | `POST` | `/vendor/offers/batch` | Batch create offers |
42
+ | `POST` | `/vendor/offers/:id/inventory-items/batch` | Link inventory items to an offer |
43
+
44
+ ### Catalog taxonomy (read-only)
45
+
46
+ `GET /vendor/product-categories[/:id]`, `/vendor/product-tags[/:id]`, `/vendor/product-types[/:id]`, `/vendor/product-attributes[/:id]`, `/vendor/collections[/:id]` — plus `POST /vendor/product-categories/:id/products` and `POST /vendor/collections/:id/products` to place own products.
47
+
48
+ ## Orders and fulfillment
49
+
50
+ | Method | Path | Purpose |
51
+ | --- | --- | --- |
52
+ | `GET` | `/vendor/orders` | List the seller's orders |
53
+ | `GET` | `/vendor/orders/:id` | Retrieve an order |
54
+ | `GET` | `/vendor/orders/:id/preview` | Preview with pending edits |
55
+ | `GET` | `/vendor/orders/:id/changes` | List order changes |
56
+ | `GET` | `/vendor/orders/:id/commission-lines` | Commission charged on the order |
57
+ | `POST` | `/vendor/orders/:id/complete` | Complete the order |
58
+ | `POST` | `/vendor/orders/:id/cancel` | Cancel the order |
59
+ | `POST` | `/vendor/orders/:id/fulfillments` | Create a fulfillment |
60
+ | `POST` | `/vendor/orders/:id/fulfillments/:fulfillment_id/cancel` | Cancel a fulfillment |
61
+ | `POST` | `/vendor/orders/:id/fulfillments/:fulfillment_id/mark-as-delivered` | Mark delivered |
62
+ | `POST` | `/vendor/orders/:id/fulfillments/:fulfillment_id/shipments` | Create a shipment |
63
+
64
+ ### Order edits, returns, claims, exchanges
65
+
66
+ Full RMA suites exist per domain, following the same action pattern Medusa uses (begin → stage item/shipping actions → request → confirm):
67
+
68
+ - `POST /vendor/order-edits` + `/:id/request|confirm|items|shipping-method` sub-routes
69
+ - `GET/POST /vendor/returns` + `/:id/request-items|dismiss-items|receive-items|receive|shipping-method` sub-routes
70
+ - `GET/POST /vendor/claims` + `/:id/claim-items|inbound|outbound` sub-routes
71
+ - `GET/POST /vendor/exchanges` + `/:id/inbound|outbound` sub-routes
72
+ - `GET /vendor/return-reasons[/:id]`, `GET /vendor/refund-reasons[/:id]`
73
+
74
+ ### Payments
75
+
76
+ | Method | Path | Purpose |
77
+ | --- | --- | --- |
78
+ | `GET` | `/vendor/payments[/:id]` | List / retrieve payments |
79
+ | `POST` | `/vendor/payments/:id/capture` | Capture a payment |
80
+ | `POST` | `/vendor/payments/:id/refund` | Refund a payment |
81
+ | `GET` | `/vendor/payments/payment-providers` | List payment providers |
82
+
83
+ ## Payouts
84
+
85
+ | Method | Path | Purpose |
86
+ | --- | --- | --- |
87
+ | `GET` | `/vendor/payouts[/:id]` | Payout history |
88
+ | `GET` `POST` | `/vendor/payout-accounts` | Retrieve / create the payout account |
89
+ | `POST` | `/vendor/payout-accounts/:id/onboarding` | Start or refresh provider onboarding |
90
+
91
+ ## Inventory and stock locations
92
+
93
+ | Method | Path | Purpose |
94
+ | --- | --- | --- |
95
+ | `GET` `POST` | `/vendor/inventory-items` | List / create inventory items |
96
+ | `GET` `POST` `DELETE` | `/vendor/inventory-items/:id` | Retrieve / update / delete an item |
97
+ | `GET` `POST` | `/vendor/inventory-items/:id/location-levels` | List / create location levels |
98
+ | `POST` `DELETE` | `/vendor/inventory-items/:id/location-levels/:location_id` | Update / delete a level |
99
+ | `POST` | `/vendor/inventory-items/location-levels/batch` | Batch update levels |
100
+ | `GET` `POST` | `/vendor/reservations[/:id]` | Manage reservations |
101
+ | `GET` `POST` | `/vendor/stock-locations` | List / create stock locations |
102
+ | `GET` `POST` `DELETE` | `/vendor/stock-locations/:id` | Retrieve / update / delete a location |
103
+ | `POST` | `/vendor/stock-locations/:id/fulfillment-sets` | Create a fulfillment set |
104
+ | `POST` | `/vendor/stock-locations/:id/fulfillment-providers` | Link fulfillment providers |
105
+ | `POST` | `/vendor/stock-locations/:id/sales-channels` | Link sales channels |
106
+
107
+ ## Shipping
108
+
109
+ | Method | Path | Purpose |
110
+ | --- | --- | --- |
111
+ | `GET` `POST` | `/vendor/shipping-options` | List / create shipping options |
112
+ | `GET` `POST` `DELETE` | `/vendor/shipping-options/:id` | Retrieve / update / delete an option |
113
+ | `POST` | `/vendor/shipping-options/:id/rules/batch` | Batch manage option rules |
114
+ | `GET` | `/vendor/shipping-option-types[/:id]` | List option types |
115
+ | `GET` `POST` | `/vendor/shipping-profiles` | List / create profiles |
116
+ | `GET` `POST` `DELETE` | `/vendor/shipping-profiles/:id` | Retrieve / update / delete a profile |
117
+ | `DELETE` | `/vendor/fulfillment-sets/:id` | Delete a fulfillment set |
118
+ | `POST` | `/vendor/fulfillment-sets/:id/service-zones` | Create a service zone |
119
+ | `GET` `POST` `DELETE` | `/vendor/fulfillment-sets/:id/service-zones/:zone_id` | Manage a service zone |
120
+ | `GET` | `/vendor/fulfillment-providers` | List fulfillment providers |
121
+
122
+ ## Pricing, promotions, customers
123
+
124
+ | Method | Path | Purpose |
125
+ | --- | --- | --- |
126
+ | `GET` `POST` | `/vendor/price-lists[/:id]` | Manage price lists (+ `/:id/prices`, `/:id/prices/batch`, `/:id/products`) |
127
+ | `GET` | `/vendor/price-preferences[/:id]` | Read price preferences |
128
+ | `GET` `POST` | `/vendor/promotions[/:id]` | Manage promotions (+ rule batch sub-routes and rule option lookups) |
129
+ | `GET` `POST` | `/vendor/campaigns[/:id]` | Manage campaigns (+ `/:id/promotions`) |
130
+ | `GET` | `/vendor/customers[/:id]` | The seller's customers |
131
+ | `POST` | `/vendor/customers/:id/customer-groups` | Manage a customer's groups |
132
+ | `GET` `POST` | `/vendor/customer-groups[/:id]` | Manage customer groups (+ `/:id/customers`) |
133
+
134
+ ## Configuration and misc
135
+
136
+ | Method | Path | Purpose |
137
+ | --- | --- | --- |
138
+ | `GET` `POST` | `/vendor/sales-channels[/:id]` | Manage sales channels (+ `/:id/products`) |
139
+ | `GET` | `/vendor/regions[/:id]` | Read regions |
140
+ | `GET` | `/vendor/currencies[/:code]` | Read currencies |
141
+ | `GET` | `/vendor/stores` | List stores (**public**) |
142
+ | `GET` | `/vendor/feature-flags` | Feature flags (**public**) |
143
+ | `POST` | `/vendor/uploads` | Upload files |
144
+
145
+ ## Next steps
146
+
147
+ <CardGroup cols={2}>
148
+ <Card title="Store API" href="/rc/references/api/store" />
149
+ <Card title="API Client" href="/rc/tools/api-client" />
150
+ </CardGroup>
@@ -0,0 +1,155 @@
1
+ ---
2
+ title: "Configuration"
3
+ description: "withMercur() options, environment variables, and provider configuration."
4
+ ---
5
+
6
+ Mercur is configured through the standard Medusa config file. `withMercur()` wraps `defineConfig()` and wires the marketplace layer in — you pass it the same shape you would pass to Medusa, plus one Mercur-specific field.
7
+
8
+ ## withMercur()
9
+
10
+ ```ts medusa-config.ts
11
+ import { loadEnv } from "@medusajs/framework/utils"
12
+ import { withMercur } from "@mercurjs/core"
13
+
14
+ loadEnv(process.env.NODE_ENV || "development", process.cwd())
15
+
16
+ module.exports = withMercur({
17
+ projectConfig: {
18
+ databaseUrl: process.env.DATABASE_URL,
19
+ redisUrl: process.env.REDIS_URL,
20
+ http: {
21
+ storeCors: process.env.STORE_CORS!,
22
+ adminCors: process.env.ADMIN_CORS!,
23
+ vendorCors: process.env.VENDOR_CORS!, // Mercur-specific
24
+ authCors: process.env.AUTH_CORS!,
25
+ jwtSecret: process.env.JWT_SECRET,
26
+ cookieSecret: process.env.COOKIE_SECRET,
27
+ },
28
+ },
29
+ featureFlags: {
30
+ seller_registration: true,
31
+ },
32
+ modules: [
33
+ // your modules and providers
34
+ ],
35
+ })
36
+ ```
37
+
38
+ The option surface is Medusa's `InputConfigWithArrayModules` extended with:
39
+
40
+ | Option | Type | Purpose |
41
+ | --- | --- | --- |
42
+ | `projectConfig.http.vendorCors` | `string` | CORS origins for the Vendor API (`/vendor/*`) — the only Mercur-specific option |
43
+
44
+ ### What withMercur applies
45
+
46
+ | Behavior | Detail |
47
+ | --- | --- |
48
+ | Registers the core plugin | Appends `@mercurjs/core` to `plugins` unless already present |
49
+ | Registers RBAC | Appends the `@medusajs/medusa/rbac` module and forces `featureFlags.rbac = true`, so vendor role scoping works out of the box |
50
+ | Disables the Medusa admin | `admin.disable` defaults to `true` — Mercur ships its own dashboards |
51
+ | Adjusts core middlewares | Replaces the Medusa middlewares that Mercur overrides (e.g. collections with media) |
52
+
53
+ Everything you pass is otherwise forwarded to `defineConfig()` unchanged, so any valid Medusa configuration remains valid here.
54
+
55
+ ## Environment variables
56
+
57
+ The starter (`apps/api` and projects created with `create-mercur-app`) reads:
58
+
59
+ | Variable | Purpose | Default |
60
+ | --- | --- | --- |
61
+ | `DATABASE_URL` | Postgres connection string | — (required) |
62
+ | `REDIS_URL` | Redis for cache, event bus, workflow engine, locking | `redis://localhost:6379` |
63
+ | `STORE_CORS` | Storefront CORS origins | — (required) |
64
+ | `ADMIN_CORS` | Admin panel CORS origins | — (required) |
65
+ | `VENDOR_CORS` | Vendor panel CORS origins | — (required) |
66
+ | `AUTH_CORS` | Auth endpoint CORS origins | — (required) |
67
+ | `JWT_SECRET` | JWT signing secret | `supersecret` (change in production) |
68
+ | `COOKIE_SECRET` | Cookie signing secret | `supersecret` (change in production) |
69
+ | `FILE_BACKEND_URL` | Public origin baked into uploaded file URLs | `http://localhost:9000/static` |
70
+ | `MERCUR_VENDOR_URL` | Vendor dashboard base URL used in member invite links | `""` — can also be set via the seller module's `vendor_url` option |
71
+ | `NODE_ENV` | Environment selection | `development` |
72
+
73
+ ## Dashboard modules
74
+
75
+ The admin and vendor dashboards are served by two UI modules:
76
+
77
+ ```ts
78
+ modules: [
79
+ {
80
+ resolve: "@mercurjs/core/modules/admin-ui",
81
+ options: { appDir: "./admin", path: "/dashboard" },
82
+ },
83
+ {
84
+ resolve: "@mercurjs/core/modules/vendor-ui",
85
+ options: { appDir: "./vendor", path: "/seller" },
86
+ },
87
+ ]
88
+ ```
89
+
90
+ | Option | Type | Purpose |
91
+ | --- | --- | --- |
92
+ | `disable` | `boolean` | Skip serving this dashboard from the API process |
93
+ | `path` | `string` | Mount path (e.g. `/dashboard`, `/seller`) |
94
+ | `appDir` | `string` | Directory of the dashboard Vite app |
95
+ | `viteDevServerPort` / `viteDevServerHost` | `number` / `string` | Dev-mode proxy target (host defaults to `localhost`) |
96
+
97
+ ## Stripe Connect payout provider
98
+
99
+ Register `@mercurjs/payout-stripe-connect` as a provider of the payout module:
100
+
101
+ ```ts
102
+ {
103
+ resolve: "@mercurjs/core/modules/payout",
104
+ options: {
105
+ providers: [
106
+ {
107
+ resolve: "@mercurjs/payout-stripe-connect",
108
+ id: "stripe-connect",
109
+ options: {
110
+ apiKey: process.env.STRIPE_SECRET_KEY,
111
+ webhookSecret: process.env.STRIPE_WEBHOOK_SECRET,
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ }
117
+ ```
118
+
119
+ | Option | Type | Default | Purpose |
120
+ | --- | --- | --- | --- |
121
+ | `apiKey` | `string` | — (required) | Stripe secret key |
122
+ | `webhookSecret` | `string` | — (required) | Verifies incoming Stripe webhook signatures |
123
+ | `accountValidation.detailsSubmitted` | `boolean` | `true` | Require onboarding details submitted before the account is active |
124
+ | `accountValidation.chargesEnabled` | `boolean` | `true` | Require charges enabled |
125
+ | `accountValidation.payoutsEnabled` | `boolean` | `true` | Require payouts enabled |
126
+ | `accountValidation.noOutstandingRequirements` | `boolean` | `true` | Treat pending Stripe requirements as `restricted` |
127
+ | `accountValidation.requiredCapabilities` | `string[]` | `[]` | Stripe capabilities that must be `active` |
128
+
129
+ The payout module itself also accepts scheduling options (`authorizationWindowMs`, `sellerActionWindowMs`, `captureSafetyBufferMs`, `requiredFulfillmentStatus`) — see the [Payout module reference](/rc/references/modules/payout#module-options).
130
+
131
+ ## Search provider
132
+
133
+ The search module needs no configuration — when no provider is given, the built-in in-memory Orama provider registers automatically. To use a custom provider:
134
+
135
+ ```ts
136
+ {
137
+ resolve: "@mercurjs/core/modules/search",
138
+ options: {
139
+ provider: {
140
+ resolve: "./src/providers/my-search-provider",
141
+ id: "my-search",
142
+ options: { /* provider options */ },
143
+ },
144
+ },
145
+ }
146
+ ```
147
+
148
+ The provider must extend `AbstractSearchProvider` — see the [Search module reference](/rc/references/modules/search#provider-contract).
149
+
150
+ ## Next steps
151
+
152
+ <CardGroup cols={2}>
153
+ <Card title="Installation" href="/rc/learn/installation" />
154
+ <Card title="Stripe Connect integration" href="/rc/resources/integrations/stripe-connect" />
155
+ </CardGroup>
@@ -0,0 +1,106 @@
1
+ ---
2
+ title: "Commission module"
3
+ description: "Data models and service methods for the Commission module."
4
+ ---
5
+
6
+ The Commission module owns commission configuration and calculation. Operators define **commission rates** (percentage or fixed, optionally per-currency) with a set of **rules** that scope where a rate applies. During checkout, the module resolves the most specific matching rate per order item and persists idempotent **commission lines** on the order.
7
+
8
+ For the conceptual introduction, see [Commissions](/rc/learn/commissions).
9
+
10
+ ## Data models
11
+
12
+ ### `CommissionRate`
13
+
14
+ Table `commission_rate`, ID prefix `comrate`.
15
+
16
+ | Field | Type | Notes |
17
+ | --- | --- | --- |
18
+ | `name` | text | Searchable |
19
+ | `code` | text | Unique; auto-generated from `name` when omitted |
20
+ | `type` | enum | `fixed` or `percentage` |
21
+ | `value` | bigNumber | The percentage or the fixed amount |
22
+ | `is_enabled` | boolean | Default `true` |
23
+ | `is_default` | boolean | Default `false`; the platform fallback rate |
24
+ | `currency_code` | text | Nullable; restricts the rate to one currency |
25
+ | `include_tax` | boolean | Default `false`; commission is computed on the tax-inclusive amount |
26
+ | `include_shipping` | boolean | Default `false`; adds shipping commission lines from the default rate |
27
+
28
+ Relations: `rules` (one-to-many `CommissionRule`), `values` (one-to-many `CommissionRateValue`).
29
+
30
+ ### `CommissionRule`
31
+
32
+ Table `commission_rule`, ID prefix `comrule`. A rule scopes its rate to one reference:
33
+
34
+ | Field | Type | Notes |
35
+ | --- | --- | --- |
36
+ | `reference` | text | One of `product`, `product_type`, `product_collection`, `product_category`, `seller` |
37
+ | `reference_id` | text | The referenced entity's ID |
38
+
39
+ ### `CommissionRateValue`
40
+
41
+ Table `commission_rate_value`, ID prefix `comval`. Per-currency amounts for `fixed` rates:
42
+
43
+ | Field | Type |
44
+ | --- | --- |
45
+ | `currency_code` | text |
46
+ | `amount` | bigNumber |
47
+
48
+ ### `CommissionLine`
49
+
50
+ Table `commission_line`, ID prefix `comline`. The persisted result of a calculation, anchored to an order item or shipping method:
51
+
52
+ | Field | Type | Notes |
53
+ | --- | --- | --- |
54
+ | `item_id` | text | Nullable; the order line item |
55
+ | `shipping_method_id` | text | Nullable; set for shipping commission lines |
56
+ | `commission_rate_id` | text | Nullable; the rate that produced this line |
57
+ | `code` | text | Rate code snapshot |
58
+ | `rate` | float | Rate value snapshot |
59
+ | `amount` | bigNumber | Computed commission |
60
+ | `description` | text | Nullable |
61
+
62
+ ## Enums
63
+
64
+ ```ts
65
+ enum CommissionRateType {
66
+ FIXED = "fixed",
67
+ PERCENTAGE = "percentage",
68
+ }
69
+ ```
70
+
71
+ ## Rate matching
72
+
73
+ When multiple rates match an order item, the module resolves them deterministically:
74
+
75
+ 1. Only enabled rates whose `currency_code` matches (or is unset) are considered.
76
+ 2. Rules combine **AND across dimensions, OR within a dimension** — a rate with a `seller` rule and a `product_category` rule matches only items that satisfy both.
77
+ 3. The **most specific** rate wins (the one matching on the most dimensions).
78
+ 4. Ties break to the oldest-created rate.
79
+ 5. If nothing matches, the rate flagged `is_default` applies.
80
+
81
+ List endpoints additionally accept a virtual `scope_type` filter (`store`, `product_type`, `category`, `store_product_type`, `store_category`) that the service translates into SQL predicates over the rules table.
82
+
83
+ ## Service
84
+
85
+ `CommissionModuleService` extends `MedusaService` with auto-generated CRUD for all models above, plus:
86
+
87
+ | Method | Behavior |
88
+ | --- | --- |
89
+ | `getCommissionLines(context)` | The core calculator — resolves the matching rate per item, computes amounts (percentage of the subtotal, or the per-currency fixed amount), and appends shipping lines when the winning rate has `include_shipping` |
90
+ | `upsertCommissionLines(lines)` | Idempotent replace: deletes existing lines for the same item/shipping anchors, then inserts |
91
+ | `createCommissionRates(data)` | Auto-generates a unique `code` from `name` when absent |
92
+ | `listCommissionRates` / `listAndCountCommissionRates` | Apply the virtual `scope_type` filter |
93
+
94
+ A loader seeds a default commission rate on first boot.
95
+
96
+ ## Related endpoints
97
+
98
+ - `GET/POST /admin/commission-rates`, `POST /admin/commission-rates/:id/rules` — see [Admin API](/rc/references/api/admin)
99
+ - `GET /admin/orders/:id/commission-lines` and `GET /vendor/orders/:id/commission-lines` expose the computed lines per order.
100
+
101
+ ## Next steps
102
+
103
+ <CardGroup cols={2}>
104
+ <Card title="Seller module" href="/rc/references/modules/seller" />
105
+ <Card title="Payout module" href="/rc/references/modules/payout" />
106
+ </CardGroup>