createPayoutAccountWorkflow that persists the PayoutAccount,
calls the configured provider to create the connected account, and links the
account to the store. Run it from any place that has access to the Medusa
container.
Run the workflow
src/api/custom/payout-account/route.ts
PENDING and can’t receive payouts until the provider
marks it ACTIVE. See Start onboarding.
A seller can have only one payout account. The workflow validates this
first and fails if the store already has one.
Forward provider data
The workflow acceptsdata and context payloads that are passed straight to
the provider when it creates the connected account. Use them to hand the
provider anything it needs up front.