Skip to main content
Validates that the seller doesn’t already have a payout account, creates one through the payout provider (e.g. Stripe Connect), and links it to the seller. Triggered by POST /vendor/payout-accounts.

Usage

import { createPayoutAccountWorkflow } from "@mercurjs/core/workflows"

const { result } = await createPayoutAccountWorkflow(container).run({
  input: {
    seller_id: "sel_123",
    context: { country: "US" },
  },
})

Input

seller_id
string
required
The seller to create the payout account for; fails if the seller already has one.
context
object
Provider context; supports idempotency_key plus provider-specific keys.
data
object
Provider-specific creation data passed straight to the payout provider.

Result

result
PayoutAccountDTO
The created payout account.
result.id
string
Payout account ID.
result.status
string
One of pending, active, restricted, rejected; starts as pending until onboarding completes.
result.data
object
Provider-side account data (e.g. the connected account payload).
result.context
object | null
The context the account was created with.