Skip to main content
In this guide, you’ll learn how to drive a store through its lifecycle from your own server code. Each transition has a dedicated workflow, so the side effects (events, notifications, and compensation) run consistently.

Approve a store

Move a pending_approval store to open with approveSellerWorkflow.
src/api/custom/approve/route.ts

Suspend and reinstate

Freeze an open store’s operations, then reinstate it once the issue is resolved.

Terminate a store

Termination is irreversible. All orders and payouts must be resolved first.

React to lifecycle changes

To run your own side effects when a store’s status changes, subscribe to the events these workflows emit instead of polling. The Event reference lists the event names.