Workflows
createWishlistEntryWorkflow
This documentation provides a reference to thecreateWishlistEntryWorkflow. It belongs to the @mercurjs/b2c-core package.
This workflow adds a product to a customer’s wishlist. If the customer doesn’t have a wishlist yet, it creates one and links it to the customer. It then links the specified product to the wishlist.
Source code
Examples
- API Route
packages/modules/b2c-core/src/api/store/wishlist/route.ts
Steps
- createWishlistEntryStep: Creates or retrieves the wishlist and links the product to it.
Input
The wishlist entry creation details.
Output
The wishlist containing the newly added product.
deleteWishlistEntryWorkflow
This documentation provides a reference to thedeleteWishlistEntryWorkflow. It belongs to the @mercurjs/b2c-core package.
This workflow removes a product from a customer’s wishlist by dismissing the link between the wishlist and the product.
Source code
Examples
- API Route
packages/modules/b2c-core/src/api/store/wishlist/[id]/product/[reference_id]/route.ts
Steps
- deleteWishlistEntryStep: Removes the link between the wishlist and the product.
Input
The wishlist entry deletion details.
Output
Steps
createWishlistEntryStep
Creates or retrieves a wishlist for a customer and links a product to it. If the customer doesn’t have a wishlist, it creates one and links it to the customer. Then it creates a link between the wishlist and the specified product. Source codeInput
The wishlist entry creation details.
Output
The wishlist containing the newly linked product.
deleteWishlistEntryStep
Removes the link between a wishlist and a product, effectively removing the product from the customer’s wishlist. Source codeInput
The wishlist entry deletion details.