respondReviewWorkflow to attach a store’s answer to a review, for example from a custom vendor route or a support tool. The workflow writes seller_note once and refuses to overwrite an existing answer.
Before you begin
Check which reviews a store may answer before you build on this workflow:- Seller reviews only: product reviews have no seller link, so the built-in Vendor API can’t reach them
- One answer per review: a second call fails until
seller_noteis cleared - No status change: answering leaves
statusas it is
1
Check that the review belongs to the store
Look up the seller link before you write. The built-in Vendor route runs the same check:
src/api/vendor/review-answers/[id]/helpers.ts
seller_seller_review_review is the link table between sellers and reviews.2
Run the workflow
Call Mercur fills
respondReviewWorkflow with the review id and the answer:src/api/vendor/review-answers/[id]/route.ts
req.seller_context on /vendor routes with the signed-in member’s current store.Handle a second answer
respondReviewWorkflow throws in two cases:
NOT_FOUND, “Review not found”: no review has this idNOT_ALLOWED, “This review already has a response”:seller_noteis already set
400 for the second case. If a later step fails after the write, the workflow sets seller_note back to null.
Replace an existing answer
The respond workflow never overwrites. To replace an answer, clear it withupdateReviewWorkflow, then respond again:
@mercurjs/core/workflows. The built-in APIs cap seller_note at 300 characters, while the workflow itself doesn’t.