Requests Subscribers Reference
Request Creation Subscribers
product-request-to-create
Creates a product creation request workflow when a product needs approval. Event:requests.product.to_create (ProductRequestUpdatedEvent.TO_CREATE)Source:
packages/modules/requests/src/subscribers/product-request-to-create.ts
Functionality
When a product needs to be created as a request:- Receives product data and seller ID from the event
- Executes
createProductRequestWorkflowto create the request record - Links the request to the seller
- Emits additional events for notifications
Event Payload
product-update-request-to-create
Creates a product update request workflow when product modifications need approval. Event:requests.product_update.to_create (ProductUpdateRequestUpdatedEvent.TO_CREATE)Source:
packages/modules/requests/src/subscribers/product-update-request-to-create.ts
Functionality
When a product update needs approval:- Checks if product approval is required via configuration rules
- If approval is required, executes
createProductUpdateRequestWorkflow - Sets the product status to “proposed”
- Creates the request record and links it to the seller
Configuration Check
Only creates the request ifREQUIRE_PRODUCT_APPROVAL configuration rule is enabled. If disabled, product updates go through directly without approval.
seller-creation-request-to-create
Creates a seller registration request workflow. Event:requests.seller.to_create (SellerRequest.TO_CREATE)Source:
packages/modules/requests/src/subscribers/seller-creation-request-to-create.ts
Functionality
When a seller registration needs to be processed:- Receives seller registration data from the event
- Executes
createSellerCreationRequestWorkflowto create the request record - Emits events for admin notifications
import-seller-products-to-create
Creates bulk product requests when products are imported via CSV. Event:requests.import_seller_products.to_create (ImportSellerProductsRequestUpdatedEvent.TO_CREATE)Source:
packages/modules/requests/src/subscribers/import-seller-products-to-create.ts
Functionality
When products are imported in bulk:- Receives an array of product request payloads and seller ID
- Executes
importSellerProductsRequestWorkflowto create multiple requests - Links all requests to the seller
- Emits individual creation events for each product request
Event Payload
Auto-Approval Subscribers
product-request-created
Automatically approves product creation requests if approval is not required. Event:requests.product.created (ProductRequestUpdatedEvent.CREATED)Source:
packages/modules/requests/src/subscribers/product-request-created.ts
Functionality
When a product request is created:- Retrieves the request from the database
- Checks if the request is not in draft status
- Checks configuration rule
REQUIRE_PRODUCT_APPROVAL - If approval is not required, automatically accepts the request:
- Executes
acceptProductRequestWorkflow - Sets reviewer as “system”
- Adds note “auto accepted”
- Publishes the product
- Executes
Use Cases
- Streamlined seller onboarding without manual approval overhead
- Trusted seller programs where products don’t need review
- Self-service marketplaces with post-moderation policies
product-update-request-created
Automatically approves product update requests if approval is not required. Event:requests.product_update.created (ProductUpdateRequestUpdatedEvent.CREATED)Source:
packages/modules/requests/src/subscribers/product-update-request-created.ts
Functionality
Identical toproduct-request-created but for product updates:
- Checks if approval is required
- Auto-accepts if approval is disabled
- Allows sellers to update products without admin intervention
Product Status Synchronization Subscriber
product-updated
Synchronizes request status with product status changes. Event:product.updated (Medusa core event)Source:
packages/modules/requests/src/subscribers/product-updated.ts
Functionality
When a product status changes:- Finds Related Requests: Queries for all requests linked to the product
- Pending → Published: If product becomes “published” and request is “pending”, marks request as “accepted”
- Pending → Rejected: If product becomes “rejected” and request is “pending”, marks request as “rejected”
- Any → Proposed: If product becomes “proposed” (edited), sets request back to “pending”
Status Flow
Use Cases
- Manual product moderation by admins
- Keeping request records in sync with actual product status
- Audit trail for product lifecycle
Notification Subscribers
notification-admin-request-created
Notifies admins in the admin panel when any request is created. Event:requests.*.created (RequestUpdated.CREATED)Source:
packages/modules/requests/src/subscribers/notification-admin-request-created.ts
Functionality
When any request is created:- Extracts the request type from the event data
- Humanizes the type for display (e.g., “product” → “Product Request”)
- Creates an admin UI notification:
- Title: Dynamically generated based on request type (e.g., “New Product Request”)
- Description: “You have received a new request from a seller 🔔”
- Redirect: “/admin/requests”
- Channel: “feed”
Seller Notification Subscribers
These subscribers notify sellers about request status changes via vendor panel notifications.notification-seller-product-request-accepted
Notifies sellers when their product creation request is accepted. Event:requests.product.accepted (ProductRequestUpdatedEvent.ACCEPTED)Template:
seller_product_request_accepted_notification
notification-seller-product-request-rejected
Notifies sellers when their product creation request is rejected. Event:requests.product.rejected (ProductRequestUpdatedEvent.REJECTED)Template:
seller_product_request_rejected_notification
notification-seller-product-category-request-accepted
Notifies sellers when their product category creation request is accepted. Event:requests.product_category.acceptedTemplate:
seller_product_category_request_accepted_notification
notification-seller-product-category-request-rejected
Notifies sellers when their product category creation request is rejected. Event:requests.product_category.rejectedTemplate:
seller_product_category_request_rejected_notification
notification-seller-product-collection-request-accepted
Notifies sellers when their product collection creation request is accepted. Event:requests.product_collection.acceptedTemplate:
seller_product_collection_request_accepted_notification
notification-seller-product-collection-request-rejected
Notifies sellers when their product collection creation request is rejected. Event:requests.product_collection.rejectedTemplate:
seller_product_collection_request_rejected_notification
notification-seller-product-type-request-accepted
Notifies sellers when their product type creation request is accepted. Event:requests.product_type.acceptedTemplate:
seller_product_type_request_accepted_notification
notification-seller-product-type-request-rejected
Notifies sellers when their product type creation request is rejected. Event:requests.product_type.rejectedTemplate:
seller_product_type_request_rejected_notification
notification-seller-product-tag-request-accepted
Notifies sellers when their product tag creation request is accepted. Event:requests.product_tag.acceptedTemplate:
seller_product_tag_request_accepted_notification
notification-seller-product-tag-request-rejected
Notifies sellers when their product tag creation request is rejected. Event:requests.product_tag.rejectedTemplate:
seller_product_tag_request_rejected_notification
Notification Behavior
All seller notification subscribers:- Check if the request type matches (skips if not)
- Retrieve the member (seller) who submitted the request
- Verify the member has an email address
- Send a vendor UI notification using
sendVendorUIRequestNotification - Target the vendor_feed channel for in-app notifications
REQUIRE_PRODUCT_APPROVAL configuration before sending notifications (e.g., product request accepted).
Notes
Configuration-Based Behavior
The Requests Module uses configuration rules to control approval flows:REQUIRE_PRODUCT_APPROVAL:
- Enabled: Products go through approval workflow, admins must review
- Disabled: Products are auto-approved, sellers can publish directly
- Start with strict moderation for new sellers
- Transition to self-service for trusted sellers
- Implement tiered seller programs
Event-Driven Request Lifecycle
The request lifecycle is entirely event-driven:- Creation Event (
to_create) → Create request record - Created Event (
created) → Auto-approve if configured - Status Change Events (
accepted/rejected) → Send notifications - Product Status Sync → Keep requests in sync with actual data
Request Types Supported
The module handles requests for:- Products: New product creation
- Product Updates: Modifications to existing products
- Product Categories: New category creation
- Product Collections: New collection creation
- Product Types: New type creation
- Product Tags: New tag creation
- Sellers: Seller registration
- Reviews: Review removal requests
Notification Channels
Admin Notifications:- Channel:
feed - Template:
admin-ui - Displayed in admin panel
- Include redirect links
- Channel:
vendor_feed - Custom templates per request type
- Displayed in vendor panel
- Include request details and status
Performance and Scalability
Bulk Import Handling:- The
import-seller-products-to-createsubscriber processes arrays of products - Each product creates a separate request for tracking
- Events are emitted in batches for efficiency
- Configuration checks prevent unnecessary database queries
- Early returns skip processing when approval is required
- System user avoids auth overhead