@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.
- package/README.md +24 -0
- package/content/blocks.mdx +209 -0
- package/content/learn/architecture.mdx +215 -0
- package/content/learn/attributes.mdx +89 -0
- package/content/learn/blocks.mdx +99 -0
- package/content/learn/commissions.mdx +175 -0
- package/content/learn/concepts.mdx +84 -0
- package/content/learn/installation.mdx +117 -0
- package/content/learn/introduction.mdx +71 -0
- package/content/learn/offers.mdx +78 -0
- package/content/learn/order-groups.mdx +114 -0
- package/content/learn/payouts.mdx +175 -0
- package/content/learn/product-requests.mdx +82 -0
- package/content/learn/products.mdx +79 -0
- package/content/learn/registry.mdx +155 -0
- package/content/learn/seller-members.mdx +62 -0
- package/content/learn/sellers.mdx +118 -0
- package/content/migration/from-1-x-to-2-0.mdx +152 -0
- package/content/migration/from-2-0-to-2-1.mdx +105 -0
- package/content/migration/overview.mdx +58 -0
- package/content/references/api/admin/commission-rates/batch-commission-rules.mdx +70 -0
- package/content/references/api/admin/commission-rates/create-commission-rate.mdx +95 -0
- package/content/references/api/admin/commission-rates/delete-commission-rate.mdx +40 -0
- package/content/references/api/admin/commission-rates/list-commission-rates.mdx +92 -0
- package/content/references/api/admin/commission-rates/retrieve-commission-rate.mdx +70 -0
- package/content/references/api/admin/commission-rates/update-commission-rate.mdx +84 -0
- package/content/references/api/admin/members/list-members.mdx +61 -0
- package/content/references/api/admin/offers/batch-create-offers.mdx +130 -0
- package/content/references/api/admin/offers/delete-offer.mdx +40 -0
- package/content/references/api/admin/offers/list-offers.mdx +106 -0
- package/content/references/api/admin/offers/retrieve-offer.mdx +82 -0
- package/content/references/api/admin/order-groups/list-order-groups.mdx +77 -0
- package/content/references/api/admin/order-groups/retrieve-order-group.mdx +56 -0
- package/content/references/api/admin/orders/get-order-commission-lines.mdx +65 -0
- package/content/references/api/admin/orders/get-order-order-group.mdx +56 -0
- package/content/references/api/admin/orders/list-orders.mdx +79 -0
- package/content/references/api/admin/payouts/list-payouts.mdx +75 -0
- package/content/references/api/admin/payouts/retrieve-payout.mdx +62 -0
- package/content/references/api/admin/product-attributes/create-attribute-value.mdx +76 -0
- package/content/references/api/admin/product-attributes/create-product-attribute.mdx +99 -0
- package/content/references/api/admin/product-attributes/delete-attribute-value.mdx +52 -0
- package/content/references/api/admin/product-attributes/delete-product-attribute.mdx +40 -0
- package/content/references/api/admin/product-attributes/list-product-attributes.mdx +91 -0
- package/content/references/api/admin/product-attributes/retrieve-product-attribute.mdx +81 -0
- package/content/references/api/admin/product-attributes/update-attribute-value.mdx +66 -0
- package/content/references/api/admin/product-attributes/update-product-attribute.mdx +76 -0
- package/content/references/api/admin/product-changes/cancel-product-change.mdx +68 -0
- package/content/references/api/admin/product-changes/confirm-product-change.mdx +47 -0
- package/content/references/api/admin/products/batch-product-attributes.mdx +96 -0
- package/content/references/api/admin/products/confirm-product.mdx +59 -0
- package/content/references/api/admin/products/create-product-variant.mdx +78 -0
- package/content/references/api/admin/products/create-product.mdx +169 -0
- package/content/references/api/admin/products/delete-product-variant.mdx +48 -0
- package/content/references/api/admin/products/delete-product.mdx +40 -0
- package/content/references/api/admin/products/list-product-variants.mdx +91 -0
- package/content/references/api/admin/products/list-products.mdx +109 -0
- package/content/references/api/admin/products/preview-product.mdx +78 -0
- package/content/references/api/admin/products/reject-product.mdx +59 -0
- package/content/references/api/admin/products/request-product-changes.mdx +59 -0
- package/content/references/api/admin/products/retrieve-product-variant.mdx +73 -0
- package/content/references/api/admin/products/retrieve-product.mdx +96 -0
- package/content/references/api/admin/products/set-product-sellers.mdx +47 -0
- package/content/references/api/admin/products/update-product-variant.mdx +89 -0
- package/content/references/api/admin/products/update-product.mdx +133 -0
- package/content/references/api/admin/sellers/add-seller-member.mdx +63 -0
- package/content/references/api/admin/sellers/approve-seller.mdx +54 -0
- package/content/references/api/admin/sellers/create-seller.mdx +100 -0
- package/content/references/api/admin/sellers/delete-member-invite.mdx +42 -0
- package/content/references/api/admin/sellers/delete-professional-details.mdx +52 -0
- package/content/references/api/admin/sellers/invite-seller-member.mdx +63 -0
- package/content/references/api/admin/sellers/list-member-invites.mdx +71 -0
- package/content/references/api/admin/sellers/list-seller-members.mdx +71 -0
- package/content/references/api/admin/sellers/list-seller-products.mdx +85 -0
- package/content/references/api/admin/sellers/list-sellers.mdx +96 -0
- package/content/references/api/admin/sellers/remove-seller-member.mdx +42 -0
- package/content/references/api/admin/sellers/resend-member-invite.mdx +55 -0
- package/content/references/api/admin/sellers/retrieve-seller.mdx +81 -0
- package/content/references/api/admin/sellers/suspend-seller.mdx +60 -0
- package/content/references/api/admin/sellers/terminate-seller.mdx +60 -0
- package/content/references/api/admin/sellers/unsuspend-seller.mdx +52 -0
- package/content/references/api/admin/sellers/unterminate-seller.mdx +52 -0
- package/content/references/api/admin/sellers/update-seller.mdx +83 -0
- package/content/references/api/admin/sellers/upsert-payment-details.mdx +88 -0
- package/content/references/api/admin/sellers/upsert-professional-details.mdx +78 -0
- package/content/references/api/admin/sellers/upsert-seller-address.mdx +91 -0
- package/content/references/api/admin.mdx +134 -0
- package/content/references/api/conventions.mdx +109 -0
- package/content/references/api/store/carts/add-line-item.mdx +115 -0
- package/content/references/api/store/carts/add-shipping-methods.mdx +84 -0
- package/content/references/api/store/carts/apply-promotions.mdx +83 -0
- package/content/references/api/store/carts/complete-cart.mdx +98 -0
- package/content/references/api/store/offers/list-offers.mdx +161 -0
- package/content/references/api/store/offers/retrieve-offer.mdx +112 -0
- package/content/references/api/store/order-groups/list-order-groups.mdx +105 -0
- package/content/references/api/store/order-groups/retrieve-order-group.mdx +78 -0
- package/content/references/api/store/product-attributes/list-product-attributes.mdx +134 -0
- package/content/references/api/store/product-attributes/retrieve-product-attribute.mdx +78 -0
- package/content/references/api/store/product-categories/list-product-categories.mdx +126 -0
- package/content/references/api/store/product-categories/retrieve-product-category.mdx +79 -0
- package/content/references/api/store/products/list-products.mdx +184 -0
- package/content/references/api/store/products/retrieve-product.mdx +107 -0
- package/content/references/api/store/search/search.mdx +136 -0
- package/content/references/api/store/sellers/list-sellers.mdx +105 -0
- package/content/references/api/store/sellers/retrieve-seller.mdx +62 -0
- package/content/references/api/store/shipping-options/list-shipping-options.mdx +74 -0
- package/content/references/api/store.mdx +67 -0
- package/content/references/api/vendor/members/accept-member-invite.mdx +65 -0
- package/content/references/api/vendor/members/retrieve-current-member.mdx +51 -0
- package/content/references/api/vendor/members/update-current-member.mdx +70 -0
- package/content/references/api/vendor/offers/batch-create-offers.mdx +123 -0
- package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +103 -0
- package/content/references/api/vendor/offers/create-offer.mdx +141 -0
- package/content/references/api/vendor/offers/delete-offer.mdx +51 -0
- package/content/references/api/vendor/offers/list-offers.mdx +125 -0
- package/content/references/api/vendor/offers/retrieve-offer.mdx +74 -0
- package/content/references/api/vendor/offers/update-offer.mdx +82 -0
- package/content/references/api/vendor/orders/cancel-fulfillment.mdx +63 -0
- package/content/references/api/vendor/orders/cancel-order.mdx +56 -0
- package/content/references/api/vendor/orders/complete-order.mdx +55 -0
- package/content/references/api/vendor/orders/create-fulfillment.mdx +76 -0
- package/content/references/api/vendor/orders/create-shipment.mdx +99 -0
- package/content/references/api/vendor/orders/get-order-commission-lines.mdx +66 -0
- package/content/references/api/vendor/orders/list-order-changes.mdx +75 -0
- package/content/references/api/vendor/orders/list-orders.mdx +103 -0
- package/content/references/api/vendor/orders/mark-fulfillment-delivered.mdx +62 -0
- package/content/references/api/vendor/orders/preview-order.mdx +65 -0
- package/content/references/api/vendor/orders/retrieve-order.mdx +84 -0
- package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +68 -0
- package/content/references/api/vendor/payout-accounts/create-payout-account.mdx +59 -0
- package/content/references/api/vendor/payout-accounts/retrieve-payout-account-by-id.mdx +60 -0
- package/content/references/api/vendor/payout-accounts/retrieve-payout-account.mdx +77 -0
- package/content/references/api/vendor/payouts/list-payouts.mdx +90 -0
- package/content/references/api/vendor/payouts/retrieve-payout.mdx +63 -0
- package/content/references/api/vendor/product-attributes/list-product-attributes.mdx +135 -0
- package/content/references/api/vendor/product-attributes/retrieve-product-attribute.mdx +71 -0
- package/content/references/api/vendor/product-variants/list-variants.mdx +136 -0
- package/content/references/api/vendor/products/batch-product-attributes.mdx +104 -0
- package/content/references/api/vendor/products/cancel-product-change.mdx +62 -0
- package/content/references/api/vendor/products/create-product-variant.mdx +92 -0
- package/content/references/api/vendor/products/create-product.mdx +197 -0
- package/content/references/api/vendor/products/delete-product-variant.mdx +68 -0
- package/content/references/api/vendor/products/delete-product.mdx +62 -0
- package/content/references/api/vendor/products/list-product-variants.mdx +114 -0
- package/content/references/api/vendor/products/list-products.mdx +163 -0
- package/content/references/api/vendor/products/preview-product.mdx +61 -0
- package/content/references/api/vendor/products/retrieve-product-variant.mdx +76 -0
- package/content/references/api/vendor/products/retrieve-product.mdx +69 -0
- package/content/references/api/vendor/products/update-product-variant.mdx +104 -0
- package/content/references/api/vendor/products/update-product.mdx +148 -0
- package/content/references/api/vendor/sellers/create-seller.mdx +150 -0
- package/content/references/api/vendor/sellers/delete-professional-details.mdx +54 -0
- package/content/references/api/vendor/sellers/invite-seller-member.mdx +67 -0
- package/content/references/api/vendor/sellers/list-member-invites.mdx +82 -0
- package/content/references/api/vendor/sellers/list-seller-members.mdx +80 -0
- package/content/references/api/vendor/sellers/list-sellers.mdx +71 -0
- package/content/references/api/vendor/sellers/remove-seller-member.mdx +48 -0
- package/content/references/api/vendor/sellers/retrieve-current-seller-member.mdx +59 -0
- package/content/references/api/vendor/sellers/retrieve-current-seller.mdx +69 -0
- package/content/references/api/vendor/sellers/select-seller.mdx +44 -0
- package/content/references/api/vendor/sellers/update-current-seller.mdx +108 -0
- package/content/references/api/vendor/sellers/update-member-role.mdx +51 -0
- package/content/references/api/vendor/sellers/upsert-payment-details.mdx +74 -0
- package/content/references/api/vendor/sellers/upsert-professional-details.mdx +70 -0
- package/content/references/api/vendor/sellers/upsert-seller-address.mdx +81 -0
- package/content/references/api/vendor.mdx +150 -0
- package/content/references/configuration.mdx +155 -0
- package/content/references/modules/commission.mdx +106 -0
- package/content/references/modules/custom-fields.mdx +45 -0
- package/content/references/modules/media.mdx +55 -0
- package/content/references/modules/offer.mdx +64 -0
- package/content/references/modules/payout.mdx +121 -0
- package/content/references/modules/product-attribute.mdx +111 -0
- package/content/references/modules/product-edit.mdx +80 -0
- package/content/references/modules/search.mdx +112 -0
- package/content/references/modules/seller.mdx +175 -0
- package/content/references/overview.mdx +70 -0
- package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +44 -0
- package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +36 -0
- package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +39 -0
- package/content/references/workflows/cart/update-cart-seller-promotions.mdx +42 -0
- package/content/references/workflows/commission/batch-commission-rules.mdx +45 -0
- package/content/references/workflows/commission/create-commission-rates.mdx +41 -0
- package/content/references/workflows/commission/delete-commission-rates.mdx +34 -0
- package/content/references/workflows/commission/refresh-order-commission-lines.mdx +30 -0
- package/content/references/workflows/commission/update-commission-rates.mdx +35 -0
- package/content/references/workflows/media/set-category-images.mdx +41 -0
- package/content/references/workflows/media/set-collection-images.mdx +41 -0
- package/content/references/workflows/member/accept-member-invite.mdx +33 -0
- package/content/references/workflows/member/add-seller-member.mdx +30 -0
- package/content/references/workflows/member/create-member-invites.mdx +34 -0
- package/content/references/workflows/member/delete-member-invite.mdx +24 -0
- package/content/references/workflows/member/remove-seller-member.mdx +28 -0
- package/content/references/workflows/member/resend-member-invite.mdx +28 -0
- package/content/references/workflows/member/update-member-role.mdx +28 -0
- package/content/references/workflows/member/update-member.mdx +35 -0
- package/content/references/workflows/offer/batch-offer-inventory-items.mdx +58 -0
- package/content/references/workflows/offer/create-offers.mdx +63 -0
- package/content/references/workflows/offer/delete-offers.mdx +35 -0
- package/content/references/workflows/offer/update-offers.mdx +51 -0
- package/content/references/workflows/order/cancel-order-fulfillment.mdx +34 -0
- package/content/references/workflows/order/confirm-claim-request.mdx +25 -0
- package/content/references/workflows/order/confirm-exchange-request.mdx +25 -0
- package/content/references/workflows/order/confirm-order-edit-request.mdx +25 -0
- package/content/references/workflows/order/confirm-return-receive.mdx +25 -0
- package/content/references/workflows/order/create-order-fulfillment.mdx +45 -0
- package/content/references/workflows/order-group/get-order-group-detail.mdx +29 -0
- package/content/references/workflows/order-group/get-order-groups-list.mdx +36 -0
- package/content/references/workflows/overview.mdx +72 -0
- package/content/references/workflows/payout/create-onboarding.mdx +36 -0
- package/content/references/workflows/payout/create-payout-account.mdx +33 -0
- package/content/references/workflows/payout/create-payout.mdx +30 -0
- package/content/references/workflows/payout/process-payout-for-webhook.mdx +32 -0
- package/content/references/workflows/product/confirm-products.mdx +46 -0
- package/content/references/workflows/product/create-products.mdx +63 -0
- package/content/references/workflows/product/link-sellers-to-product-category.mdx +40 -0
- package/content/references/workflows/product/link-sellers-to-product.mdx +40 -0
- package/content/references/workflows/product/reject-product.mdx +46 -0
- package/content/references/workflows/product/request-product-change.mdx +46 -0
- package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +49 -0
- package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +46 -0
- package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +43 -0
- package/content/references/workflows/product-attribute/create-product-attributes.mdx +56 -0
- package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +30 -0
- package/content/references/workflows/product-attribute/delete-product-attributes.mdx +30 -0
- package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +29 -0
- package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +44 -0
- package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +41 -0
- package/content/references/workflows/product-attribute/update-product-attributes.mdx +48 -0
- package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +43 -0
- package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +39 -0
- package/content/references/workflows/product-edit/cancel-product-change.mdx +49 -0
- package/content/references/workflows/product-edit/confirm-product-change.mdx +57 -0
- package/content/references/workflows/product-edit/create-product-change.mdx +72 -0
- package/content/references/workflows/product-edit/reject-product-change.mdx +54 -0
- package/content/references/workflows/product-edit/stage-product-change.mdx +75 -0
- package/content/references/workflows/seller/approve-seller.mdx +34 -0
- package/content/references/workflows/seller/create-seller-account.mdx +59 -0
- package/content/references/workflows/seller/create-seller-defaults.mdx +22 -0
- package/content/references/workflows/seller/create-sellers.mdx +65 -0
- package/content/references/workflows/seller/delete-seller-professional-details.mdx +37 -0
- package/content/references/workflows/seller/delete-sellers.mdx +24 -0
- package/content/references/workflows/seller/invite-seller.mdx +28 -0
- package/content/references/workflows/seller/suspend-seller.mdx +35 -0
- package/content/references/workflows/seller/terminate-seller.mdx +35 -0
- package/content/references/workflows/seller/unsuspend-seller.mdx +34 -0
- package/content/references/workflows/seller/unterminate-seller.mdx +34 -0
- package/content/references/workflows/seller/update-seller-address.mdx +55 -0
- package/content/references/workflows/seller/update-seller-payment-details.mdx +52 -0
- package/content/references/workflows/seller/update-seller-professional-details.mdx +48 -0
- package/content/references/workflows/seller/update-sellers.mdx +57 -0
- package/content/resources/ai/llms.mdx +74 -0
- package/content/resources/ai/mcp.mdx +152 -0
- package/content/resources/ai/overview.mdx +97 -0
- package/content/resources/customization/custom-fields.mdx +182 -0
- package/content/resources/customization/extend-a-workflow.mdx +39 -0
- package/content/resources/customization/extending-panels.mdx +309 -0
- package/content/resources/deployment/medusa-cloud.mdx +167 -0
- package/content/resources/integrations/notifications.mdx +39 -0
- package/content/resources/integrations/search.mdx +122 -0
- package/content/resources/integrations/stripe-connect.mdx +395 -0
- package/content/resources/tutorials/add-a-block.mdx +74 -0
- package/content/resources/tutorials/attributes-and-variant-axes.mdx +111 -0
- package/content/resources/tutorials/build-a-block.mdx +134 -0
- package/content/resources/tutorials/configure-commissions.mdx +127 -0
- package/content/resources/tutorials/custom-api-route.mdx +142 -0
- package/content/resources/tutorials/custom-panel-page.mdx +78 -0
- package/content/resources/tutorials/first-marketplace.mdx +45 -0
- package/content/resources/tutorials/handle-product-requests.mdx +80 -0
- package/content/resources/tutorials/import-export-products.mdx +96 -0
- package/content/resources/tutorials/master-products-and-offers.mdx +89 -0
- package/content/resources/tutorials/recompose-a-page.mdx +129 -0
- package/content/resources/tutorials/replace-panel-components.mdx +116 -0
- package/content/resources/tutorials/seller-payouts-stripe.mdx +89 -0
- package/content/telemetry.mdx +67 -0
- package/content/tools/api-client.mdx +155 -0
- package/content/tools/cli.mdx +196 -0
- package/content/tools/dashboard-sdk.mdx +35 -0
- package/content/user-guide/admin/overview.mdx +23 -0
- package/content/user-guide/admin/stores.mdx +193 -0
- package/content/user-guide/vendor/overview.mdx +23 -0
- package/content/user-guide/vendor/stores.mdx +209 -0
- package/llms.txt +307 -0
- package/package.json +33 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "setCollectionImagesWorkflow"
|
|
3
|
+
description: "Replace a collection's media gallery and icon, enforcing single thumbnail/banner."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Replaces a product collection's media. When `media` is provided, the entire existing gallery is swapped for the new list; when `icon` is provided, the existing icon image is swapped (pass `null` to clear it). Omitted fields are left untouched. At most one image keeps `is_thumbnail` and one keeps `is_banner` — the first flagged entry wins and later flags are silently dropped. Usually invoked through the `createProductCollectionWithImagesWorkflow`, `updateProductCollectionWithImagesWorkflow`, and `deleteProductCollectionWithImagesWorkflow` wrappers behind the `/admin/collections` routes.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { setCollectionImagesWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
await setCollectionImagesWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
collection_id: "pcol_123",
|
|
16
|
+
media: [
|
|
17
|
+
{ url: "https://cdn.example.com/hero.jpg", is_banner: true },
|
|
18
|
+
{ url: "https://cdn.example.com/thumb.jpg", is_thumbnail: true },
|
|
19
|
+
],
|
|
20
|
+
icon: "https://cdn.example.com/icon.svg",
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Input
|
|
26
|
+
|
|
27
|
+
<ParamField body="collection_id" type="string" required>The collection whose images are replaced.</ParamField>
|
|
28
|
+
<ParamField body="media" type="CollectionMediaInput[]">
|
|
29
|
+
New gallery; replaces all existing non-icon images (pass `[]` to clear).
|
|
30
|
+
<Expandable title="properties">
|
|
31
|
+
<ParamField body="url" type="string" required>Public URL of the image.</ParamField>
|
|
32
|
+
<ParamField body="is_thumbnail" type="boolean">Mark as the thumbnail; only the first flagged image is honoured.</ParamField>
|
|
33
|
+
<ParamField body="is_banner" type="boolean">Mark as the banner; only the first flagged image is honoured.</ParamField>
|
|
34
|
+
<ParamField body="rank" type="number">Sort rank; defaults to the array index.</ParamField>
|
|
35
|
+
</Expandable>
|
|
36
|
+
</ParamField>
|
|
37
|
+
<ParamField body="icon" type="string | null">New icon URL; `null` removes the current icon, omit to keep it.</ParamField>
|
|
38
|
+
|
|
39
|
+
## Result
|
|
40
|
+
|
|
41
|
+
<ResponseField name="result" type="void">No return value.</ResponseField>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "acceptMemberInviteWorkflow"
|
|
3
|
+
description: "Redeem an invite token and join a seller's team."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Validates the invite token, upserts the member by the invited email, links them to the seller with the invited role (as owner if the seller has none yet), binds the auth identity when the member is new, and deletes the consumed invite. Triggered by `POST /vendor/members/invites/accept`. Emits `member_invite.accepted`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { acceptMemberInviteWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await acceptMemberInviteWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
invite_token: "eyJhbGciOi...",
|
|
16
|
+
auth_identity_id: "authid_123",
|
|
17
|
+
first_name: "Jane",
|
|
18
|
+
last_name: "Doe",
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
|
|
25
|
+
<ParamField body="invite_token" type="string" required>Signed invite token from the invitation link.</ParamField>
|
|
26
|
+
<ParamField body="auth_identity_id" type="string" required>Auth identity of the accepting user.</ParamField>
|
|
27
|
+
<ParamField body="member_id" type="string">Existing member id; when set, no auth metadata is written.</ParamField>
|
|
28
|
+
<ParamField body="first_name" type="string">First name for a newly created member.</ParamField>
|
|
29
|
+
<ParamField body="last_name" type="string">Last name for a newly created member.</ParamField>
|
|
30
|
+
|
|
31
|
+
## Result
|
|
32
|
+
|
|
33
|
+
<ResponseField name="result" type="MemberDTO">The member linked to the seller.</ResponseField>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "addSellerMemberWorkflow"
|
|
3
|
+
description: "Attach an existing member to a seller with a role."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Creates a seller-member link between an existing member and a seller with the given role. Triggered by `POST /admin/sellers/:id/members` and `POST /vendor/sellers/:id/members`. Emits `seller_member.created`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { addSellerMemberWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await addSellerMemberWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
seller_id: "sel_123",
|
|
16
|
+
member_id: "mem_123",
|
|
17
|
+
role_id: "role_seller_support",
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Input
|
|
23
|
+
|
|
24
|
+
<ParamField body="seller_id" type="string" required>Id of the seller.</ParamField>
|
|
25
|
+
<ParamField body="member_id" type="string" required>Id of the member to attach.</ParamField>
|
|
26
|
+
<ParamField body="role_id" type="string" required>Role to assign, e.g. `role_seller_administration`, `role_seller_support`.</ParamField>
|
|
27
|
+
|
|
28
|
+
## Result
|
|
29
|
+
|
|
30
|
+
<ResponseField name="result" type="SellerMemberDTO">The created seller-member link.</ResponseField>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "createMemberInvitesWorkflow"
|
|
3
|
+
description: "Create tokenized member invitations for sellers."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Creates invite records with a signed token and expiry for each entry. Triggered by `POST /admin/sellers/:id/members/invite` and the vendor invite routes; also run as a step by `createSellersWorkflow` for the initial member. Emits `member_invite.created` with `{ id, token, expires_at }` per invite, which typically drives the invitation email.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { createMemberInvitesWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await createMemberInvitesWorkflow(container).run({
|
|
14
|
+
input: [
|
|
15
|
+
{
|
|
16
|
+
seller_id: "sel_123",
|
|
17
|
+
email: "teammate@acme.co",
|
|
18
|
+
role_id: "role_seller_support",
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Input
|
|
25
|
+
|
|
26
|
+
The input is an array of invites.
|
|
27
|
+
|
|
28
|
+
<ParamField body="[].seller_id" type="string" required>Seller the invite belongs to.</ParamField>
|
|
29
|
+
<ParamField body="[].email" type="string" required>Email of the invitee.</ParamField>
|
|
30
|
+
<ParamField body="[].role_id" type="string" required>Role the invitee receives on acceptance.</ParamField>
|
|
31
|
+
|
|
32
|
+
## Result
|
|
33
|
+
|
|
34
|
+
<ResponseField name="result" type="MemberInviteDTO[]">The created invites, including `token` and `expires_at`.</ResponseField>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "deleteMemberInviteWorkflow"
|
|
3
|
+
description: "Delete a pending member invite."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Deletes the invite so its token can no longer be redeemed. Triggered by `DELETE /admin/sellers/:id/members/invites/:invite_id` and the vendor equivalent.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { deleteMemberInviteWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
await deleteMemberInviteWorkflow(container).run({
|
|
14
|
+
input: { invite_id: "meminv_123" },
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
<ParamField body="invite_id" type="string" required>Id of the invite to delete.</ParamField>
|
|
21
|
+
|
|
22
|
+
## Result
|
|
23
|
+
|
|
24
|
+
<ResponseField name="result" type="void">Nothing is returned.</ResponseField>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "removeSellerMemberWorkflow"
|
|
3
|
+
description: "Remove a member from a seller's team."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Validates the seller-member link can be removed (owners cannot be removed), then deletes it. Triggered by `DELETE /admin/sellers/:id/members/:member_id` and `DELETE /vendor/sellers/:id/members/:member_id`. Emits `seller_member.deleted`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { removeSellerMemberWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
await removeSellerMemberWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
seller_member_id: "selmem_123",
|
|
16
|
+
seller_id: "sel_123",
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Input
|
|
22
|
+
|
|
23
|
+
<ParamField body="seller_member_id" type="string" required>Id of the seller-member link to delete.</ParamField>
|
|
24
|
+
<ParamField body="seller_id" type="string" required>Id of the seller, included in the emitted event.</ParamField>
|
|
25
|
+
|
|
26
|
+
## Result
|
|
27
|
+
|
|
28
|
+
<ResponseField name="result" type="void">Nothing is returned.</ResponseField>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "resendMemberInviteWorkflow"
|
|
3
|
+
description: "Re-issue a member invite with a fresh token."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Loads the existing invite, deletes it, and creates a new one with the same email and role — resetting the token and expiry. Triggered by `POST /admin/sellers/:id/members/invites/:invite_id/resend` and the vendor equivalent. Emits `member_invite.created` for the new invite.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { resendMemberInviteWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await resendMemberInviteWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
invite_id: "meminv_123",
|
|
16
|
+
seller_id: "sel_123",
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Input
|
|
22
|
+
|
|
23
|
+
<ParamField body="invite_id" type="string" required>Id of the invite to re-issue; must belong to the seller.</ParamField>
|
|
24
|
+
<ParamField body="seller_id" type="string" required>Seller the invite belongs to.</ParamField>
|
|
25
|
+
|
|
26
|
+
## Result
|
|
27
|
+
|
|
28
|
+
<ResponseField name="result" type="MemberInviteDTO[]">The re-created invite (single-element array) with a new `token` and `expires_at`.</ResponseField>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "updateMemberRoleWorkflow"
|
|
3
|
+
description: "Change a team member's role."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Validates the target is not the seller owner, then updates the seller-member link's role. Triggered by `POST /admin/sellers/:id/members/:member_id` and `POST /vendor/sellers/:id/members/:member_id`. Emits `seller_member.updated`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { updateMemberRoleWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
await updateMemberRoleWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
seller_member_id: "selmem_123",
|
|
16
|
+
role_id: "role_seller_order_management",
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Input
|
|
22
|
+
|
|
23
|
+
<ParamField body="seller_member_id" type="string" required>Id of the seller-member link to update; must not be the owner.</ParamField>
|
|
24
|
+
<ParamField body="role_id" type="string" required>New role to assign.</ParamField>
|
|
25
|
+
|
|
26
|
+
## Result
|
|
27
|
+
|
|
28
|
+
<ResponseField name="result" type="void">Nothing is returned.</ResponseField>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "updateMemberWorkflow"
|
|
3
|
+
description: "Update member profile fields matching a selector."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Updates every member matching the selector — name and locale only. Triggered by `POST /vendor/members/me` when a member edits their own profile.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { updateMemberWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await updateMemberWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
selector: { id: "mem_123" },
|
|
16
|
+
update: { first_name: "Jane", last_name: "Doe" },
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Input
|
|
22
|
+
|
|
23
|
+
<ParamField body="selector" type="object" required>Filter selecting the members to update, e.g. `{ id: "mem_123" }`.</ParamField>
|
|
24
|
+
<ParamField body="update" type="object" required>
|
|
25
|
+
Fields to update.
|
|
26
|
+
<Expandable title="properties">
|
|
27
|
+
<ParamField body="first_name" type="string | null">First name.</ParamField>
|
|
28
|
+
<ParamField body="last_name" type="string | null">Last name.</ParamField>
|
|
29
|
+
<ParamField body="locale" type="string | null">Preferred locale.</ParamField>
|
|
30
|
+
</Expandable>
|
|
31
|
+
</ParamField>
|
|
32
|
+
|
|
33
|
+
## Result
|
|
34
|
+
|
|
35
|
+
<ResponseField name="result" type="MemberDTO[]">The updated members.</ResponseField>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "batchOfferInventoryItemsWorkflow"
|
|
3
|
+
description: "Create, update, and delete an offer's inventory-item links in one call."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Manages the `offer ↔ inventory_item` links that define what stock an offer consumes. Validates the payload (no duplicates, no ID in more than one bucket, created items must exist, deleted items must already be linked), then batches the link changes — each link carries a `required_quantity` (default `1`). Emits `offer.updated`. Triggered by `POST /vendor/offers/:id/inventory-items/batch`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { batchOfferInventoryItemsWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await batchOfferInventoryItemsWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
offer_id: "offer_123",
|
|
16
|
+
create: [{ inventory_item_id: "iitem_1", required_quantity: 2 }],
|
|
17
|
+
update: [{ inventory_item_id: "iitem_2", required_quantity: 1 }],
|
|
18
|
+
delete: ["iitem_3"],
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Input
|
|
24
|
+
|
|
25
|
+
<ParamField body="offer_id" type="string" required>The offer whose inventory links are managed; fails if not found.</ParamField>
|
|
26
|
+
<ParamField body="create" type="object[]">Links to create; the inventory items must exist and not appear in `update`/`delete`.
|
|
27
|
+
<Expandable title="properties">
|
|
28
|
+
<ParamField body="inventory_item_id" type="string" required>The inventory item to link.</ParamField>
|
|
29
|
+
<ParamField body="required_quantity" type="number">Units consumed per offer unit; defaults to `1`.</ParamField>
|
|
30
|
+
</Expandable>
|
|
31
|
+
</ParamField>
|
|
32
|
+
<ParamField body="update" type="object[]">Existing links to update.
|
|
33
|
+
<Expandable title="properties">
|
|
34
|
+
<ParamField body="inventory_item_id" type="string" required>The linked inventory item.</ParamField>
|
|
35
|
+
<ParamField body="required_quantity" type="number" required>New units consumed per offer unit.</ParamField>
|
|
36
|
+
</Expandable>
|
|
37
|
+
</ParamField>
|
|
38
|
+
<ParamField body="delete" type="string[]">Inventory item IDs to unlink; each must currently be linked or the workflow throws a 404.</ParamField>
|
|
39
|
+
<ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
|
|
40
|
+
|
|
41
|
+
## Result
|
|
42
|
+
|
|
43
|
+
<ResponseField name="result.created" type="LinkDefinition[]">The created offer ↔ inventory-item links.</ResponseField>
|
|
44
|
+
<ResponseField name="result.updated" type="LinkDefinition[]">The updated links.</ResponseField>
|
|
45
|
+
<ResponseField name="result.deleted" type="string[]">Inventory item IDs that were unlinked.</ResponseField>
|
|
46
|
+
|
|
47
|
+
## Hooks
|
|
48
|
+
|
|
49
|
+
- `validate` — runs first with `{ input }`.
|
|
50
|
+
- `offerInventoryItemsBatched` — runs after the batch with `{ offer_id, result, additional_data }`.
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
batchOfferInventoryItemsWorkflow.hooks.offerInventoryItemsBatched(
|
|
54
|
+
async ({ offer_id, result }) => {
|
|
55
|
+
// react to link changes
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "createOffersWorkflow"
|
|
3
|
+
description: "Create seller offers with inventory items and offer-scoped prices."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Creates one offer per entry: creates and links new inventory items (with optional starting stock levels) to the offer and the seller, ensures the master variant has a `PriceSet`, writes the offer's prices onto that shared set scoped by an `offer_id` price rule, and links the price rows to the offer. Emits `offer.created`. Triggered by `POST /vendor/offers` and the vendor/admin offer batch routes.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { createOffersWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await createOffersWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
offers: [
|
|
16
|
+
{
|
|
17
|
+
seller_id: "sel_123",
|
|
18
|
+
created_by: "member_123",
|
|
19
|
+
variant_id: "variant_123",
|
|
20
|
+
shipping_profile_id: "sp_123",
|
|
21
|
+
sku: "ACME-TEE-M",
|
|
22
|
+
inventory_items: [
|
|
23
|
+
{ stock_levels: [{ location_id: "sloc_123", stocked_quantity: 50 }] },
|
|
24
|
+
],
|
|
25
|
+
prices: [{ amount: 1999, currency_code: "usd" }],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Input
|
|
33
|
+
|
|
34
|
+
<ParamField body="offers" type="object[]" required>Offers to create.
|
|
35
|
+
<Expandable title="properties">
|
|
36
|
+
<ParamField body="seller_id" type="string" required>The seller that owns the offer.</ParamField>
|
|
37
|
+
<ParamField body="created_by" type="string" required>ID of the member creating the offer.</ParamField>
|
|
38
|
+
<ParamField body="sku" type="string" required>The offer's SKU.</ParamField>
|
|
39
|
+
<ParamField body="variant_id" type="string" required>The master product variant the offer sells; fails if not found.</ParamField>
|
|
40
|
+
<ParamField body="shipping_profile_id" type="string" required>Shipping profile used to fulfill the offer.</ParamField>
|
|
41
|
+
<ParamField body="inventory_items" type="object[]" required>New inventory items to create and link; at least one entry. Each entry accepts `sku`, `title`, `required_quantity` (default `1`), and `stock_levels` (`{ location_id, stocked_quantity }[]`).</ParamField>
|
|
42
|
+
<ParamField body="prices" type="object[]" required>Offer price ladder; each row accepts `amount`, `currency_code`, `min_quantity`, `max_quantity`, and `rules`.</ParamField>
|
|
43
|
+
<ParamField body="ean" type="string | null">EAN; snapshotted from the variant when omitted.</ParamField>
|
|
44
|
+
<ParamField body="upc" type="string | null">UPC; snapshotted from the variant when omitted.</ParamField>
|
|
45
|
+
<ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
|
|
46
|
+
</Expandable>
|
|
47
|
+
</ParamField>
|
|
48
|
+
<ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
|
|
49
|
+
|
|
50
|
+
## Result
|
|
51
|
+
|
|
52
|
+
<ResponseField name="result" type="OfferDTO[]">The created offers.</ResponseField>
|
|
53
|
+
|
|
54
|
+
## Hooks
|
|
55
|
+
|
|
56
|
+
- `validate` — runs first with `{ input }`.
|
|
57
|
+
- `offersCreated` — runs after creation with `{ offers, additional_data }`.
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
createOffersWorkflow.hooks.offersCreated(async ({ offers, additional_data }) => {
|
|
61
|
+
// react to new offers
|
|
62
|
+
})
|
|
63
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "deleteOffersWorkflow"
|
|
3
|
+
description: "Delete one or more offers."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Deletes the given offers and emits `offer.deleted` with each offer's `id` and `product_id`. Triggered by `DELETE /vendor/offers/:id`, `DELETE /admin/offers/:id`, and the offer batch routes.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { deleteOffersWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
await deleteOffersWorkflow(container).run({
|
|
14
|
+
input: { ids: ["offer_123"] },
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
<ParamField body="ids" type="string[]" required>IDs of the offers to delete.</ParamField>
|
|
21
|
+
<ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
|
|
22
|
+
|
|
23
|
+
## Result
|
|
24
|
+
|
|
25
|
+
<ResponseField name="result" type="void">No return value; the offers are deleted.</ResponseField>
|
|
26
|
+
|
|
27
|
+
## Hooks
|
|
28
|
+
|
|
29
|
+
- `offersDeleted` — runs after deletion with `{ ids, additional_data }`.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
deleteOffersWorkflow.hooks.offersDeleted(async ({ ids, additional_data }) => {
|
|
33
|
+
// react to deleted offers
|
|
34
|
+
})
|
|
35
|
+
```
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "updateOffersWorkflow"
|
|
3
|
+
description: "Update offer rows and rewrite their price ladders with replace semantics."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Applies partial updates to offer rows (`sku`, `shipping_profile_id`, `metadata`). When an entry sets `prices`, the offer's price ladder is rewritten with replace semantics: rows with `id` are updated in place, rows without `id` are added, and existing offer-owned prices omitted from the array are removed — all on the variant's shared `PriceSet`, scoped by the `offer_id` price rule. Price ownership is asserted so an offer can't touch another offer's rows. Emits `offer.updated`. Triggered by `POST /vendor/offers/:id` and the offer batch routes.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { updateOffersWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await updateOffersWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
offers: [
|
|
16
|
+
{
|
|
17
|
+
id: "offer_123",
|
|
18
|
+
prices: [{ amount: 1799, currency_code: "usd" }],
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Input
|
|
26
|
+
|
|
27
|
+
<ParamField body="offers" type="object[]" required>Offer updates, keyed by ID.
|
|
28
|
+
<Expandable title="properties">
|
|
29
|
+
<ParamField body="id" type="string" required>The offer to update; fails if not found.</ParamField>
|
|
30
|
+
<ParamField body="sku" type="string">New SKU.</ParamField>
|
|
31
|
+
<ParamField body="shipping_profile_id" type="string">New shipping profile.</ParamField>
|
|
32
|
+
<ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
|
|
33
|
+
<ParamField body="prices" type="object[]">Full replacement price ladder; each row accepts `id` (update in place when set), `amount`, `currency_code`, `min_quantity`, `max_quantity`, and `rules`. Omit the field to leave prices untouched.</ParamField>
|
|
34
|
+
</Expandable>
|
|
35
|
+
</ParamField>
|
|
36
|
+
<ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
|
|
37
|
+
|
|
38
|
+
## Result
|
|
39
|
+
|
|
40
|
+
<ResponseField name="result" type="OfferDTO[]">The updated offers.</ResponseField>
|
|
41
|
+
|
|
42
|
+
## Hooks
|
|
43
|
+
|
|
44
|
+
- `validate` — runs first with `{ input }`.
|
|
45
|
+
- `offersUpdated` — runs after the update with `{ offers, additional_data }`.
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
updateOffersWorkflow.hooks.offersUpdated(async ({ offers, additional_data }) => {
|
|
49
|
+
// react to updated offers
|
|
50
|
+
})
|
|
51
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "cancelOrderFulfillmentWorkflow"
|
|
3
|
+
description: "Cancel an unshipped fulfillment and restore reservations and stock."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Mercur's offer-aware replacement for Medusa's cancel-order-fulfillment flow. Validates that the fulfillment exists, is not shipped, and not already canceled, then cancels it on the order and at the provider, re-creates or tops up reservations, and adjusts inventory back up — dividing line quantities by each offer's `required_quantity` so bundle offers restock correctly. Triggered by `POST /vendor/orders/:id/fulfillments/:fulfillment_id/cancel`. Emits `order.fulfillment_canceled`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { cancelOrderFulfillmentWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
await cancelOrderFulfillmentWorkflow(container).run({
|
|
14
|
+
input: {
|
|
15
|
+
order_id: "order_123",
|
|
16
|
+
fulfillment_id: "ful_123",
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Input
|
|
22
|
+
|
|
23
|
+
<ParamField body="order_id" type="string" required>The order the fulfillment belongs to; must not be canceled.</ParamField>
|
|
24
|
+
<ParamField body="fulfillment_id" type="string" required>The fulfillment to cancel; shipped or already-canceled fulfillments throw.</ParamField>
|
|
25
|
+
<ParamField body="no_notification" type="boolean">Suppress customer notification for the cancellation.</ParamField>
|
|
26
|
+
<ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
|
|
27
|
+
|
|
28
|
+
## Result
|
|
29
|
+
|
|
30
|
+
<ResponseField name="result" type="void">No return value.</ResponseField>
|
|
31
|
+
|
|
32
|
+
## Hooks
|
|
33
|
+
|
|
34
|
+
- `orderFulfillmentCanceled` — runs after cancellation with `{ fulfillment, additional_data }`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "confirmClaimRequestWorkflow"
|
|
3
|
+
description: "Confirm a claim request and fix reservations for offer bundles."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Wraps Medusa's `confirmClaimRequestWorkflow` and then rewrites the reservations created for the claim's additional items when those items come from offers: single-link offers get their reservation quantity scaled by `required_quantity`, multi-link (bundle) offers have the default reservation replaced with one reservation per linked inventory item. Triggered by `POST /admin/claims/:id/request` and `POST /vendor/claims/:id/request`. Events are emitted by the wrapped Medusa workflow.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { confirmClaimRequestWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await confirmClaimRequestWorkflow(container).run({
|
|
14
|
+
input: { claim_id: "claim_123", confirmed_by: "user_123" },
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
<ParamField body="claim_id" type="string" required>The claim whose pending request is confirmed.</ParamField>
|
|
21
|
+
<ParamField body="confirmed_by" type="string">Id of the user confirming the claim.</ParamField>
|
|
22
|
+
|
|
23
|
+
## Result
|
|
24
|
+
|
|
25
|
+
<ResponseField name="result" type="OrderPreviewDTO">Preview of the order with the confirmed claim applied.</ResponseField>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "confirmExchangeRequestWorkflow"
|
|
3
|
+
description: "Confirm an exchange request and fix reservations for offer bundles."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Wraps Medusa's `confirmExchangeRequestWorkflow` and then rewrites the reservations created for the exchange's additional items when those items come from offers: single-link offers get their reservation quantity scaled by `required_quantity`, multi-link (bundle) offers have the default reservation replaced with one reservation per linked inventory item. Triggered by `POST /admin/exchanges/:id/request` and `POST /vendor/exchanges/:id/request`. Events are emitted by the wrapped Medusa workflow.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { confirmExchangeRequestWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await confirmExchangeRequestWorkflow(container).run({
|
|
14
|
+
input: { exchange_id: "exchange_123", confirmed_by: "user_123" },
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
<ParamField body="exchange_id" type="string" required>The exchange whose pending request is confirmed.</ParamField>
|
|
21
|
+
<ParamField body="confirmed_by" type="string">Id of the user confirming the exchange.</ParamField>
|
|
22
|
+
|
|
23
|
+
## Result
|
|
24
|
+
|
|
25
|
+
<ResponseField name="result" type="OrderPreviewDTO">Preview of the order with the confirmed exchange applied.</ResponseField>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "confirmOrderEditRequestWorkflow"
|
|
3
|
+
description: "Confirm an order edit and reconcile offer-bundle reservations."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Wraps Medusa's `confirmOrderEditRequestWorkflow` and then reconciles reservations for every unfulfilled order item that comes from an offer with inventory links: desired quantities are computed as `(ordered - fulfilled) × required_quantity` per linked inventory item, and mismatching reservations are replaced with a correct set (one per linked item, bundle offers included). Triggered by `POST /admin/order-edits/:id/confirm` and `POST /vendor/order-edits/:id/confirm`. Events are emitted by the wrapped Medusa workflow.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { confirmOrderEditRequestWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await confirmOrderEditRequestWorkflow(container).run({
|
|
14
|
+
input: { order_id: "order_123", confirmed_by: "user_123" },
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
<ParamField body="order_id" type="string" required>The order whose pending edit is confirmed.</ParamField>
|
|
21
|
+
<ParamField body="confirmed_by" type="string">Id of the user confirming the edit.</ParamField>
|
|
22
|
+
|
|
23
|
+
## Result
|
|
24
|
+
|
|
25
|
+
<ResponseField name="result" type="OrderPreviewDTO">Preview of the order with the confirmed edit applied.</ResponseField>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "confirmReturnReceiveWorkflow"
|
|
3
|
+
description: "Confirm a return receival, offer-aware restock included."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Mercur's offer-aware replacement for Medusa's confirm-return-receive flow. Applies the pending receive actions of the return's order change, updates return items' received/damaged quantities, marks the return `received` (or `partially_received`), restocks inventory — expanding offer bundle links by `required_quantity` — and refreshes the order payment collection. Throws when a bundle offer has no stock level at the return's location. Triggered by `POST /admin/returns/:id/receive/confirm` and `POST /vendor/returns/:id/receive/confirm`. Emits `order.return_received`.
|
|
7
|
+
|
|
8
|
+
## Usage
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { confirmReturnReceiveWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
+
|
|
13
|
+
const { result } = await confirmReturnReceiveWorkflow(container).run({
|
|
14
|
+
input: { return_id: "return_123", confirmed_by: "user_123" },
|
|
15
|
+
})
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Input
|
|
19
|
+
|
|
20
|
+
<ParamField body="return_id" type="string" required>The return whose pending receival is confirmed.</ParamField>
|
|
21
|
+
<ParamField body="confirmed_by" type="string">Id of the user confirming the receival.</ParamField>
|
|
22
|
+
|
|
23
|
+
## Result
|
|
24
|
+
|
|
25
|
+
<ResponseField name="result" type="OrderPreviewDTO">Preview of the order with the confirmed changes applied.</ResponseField>
|