> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createPayoutAccountWorkflow

> Create a payout account for a seller through the registered payout provider.

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

```ts theme={null}
import { createPayoutAccountWorkflow } from "@mercurjs/core/workflows"

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

## Input

<ParamField body="seller_id" type="string" required>The seller to create the payout account for; fails if the seller already has one.</ParamField>
<ParamField body="context" type="object">Provider context; supports `idempotency_key` plus provider-specific keys.</ParamField>
<ParamField body="data" type="object">Provider-specific creation data passed straight to the payout provider.</ParamField>

## Result

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