---
title: "Create a payout run"
---

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

# Create a payout run

Path: Nicer API › Commerce

`POST /commerce/payout-runs`

URL: `https://api.nicer.travel/commerce/payout-runs`

Pays approved statements of payees paid by Stripe Connect: one payout per statement, then a job sends each as a Stripe Connect transfer from the platform balance (when the company has transfers enabled and the payee finished onboarding). A statement paid by check or by hand is recorded with MARK_PAID on the statement instead; a payee with another payout method answers 422 COMMISSION_PAYOUT_NOT_READY. Every payee needs a legal name and a tax form on file. A statement already in a live payout answers 409 COMMISSION_STATEMENT_ALREADY_PAID. Finance staff only. Poll `GET /payout-runs/{payoutRunId}`.

## Authentication

- `bearerAuth`, http bearer, header `Authorization`, format `JWT`

## Header parameters

- `Idempotency-Key` (`commerce.payoutRuns.create.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.
- `x-nicer-company` (`commerce.payoutRuns.create.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.

## Request body

_Required._

- `statementIds` (`commerce.payoutRuns.create.statementIds`; array of string, required)
  - maxLength: `255` · minLength: `1`

## Example request

```json
{
  "statementIds": [
    "string"
  ]
}
```

## Code samples

### JavaScript SDK

```javascript
import { createClient } from "@nicertravel/sdk";

const nicer = createClient({
  baseUrl: "https://api.nicer.travel",
  token: process.env.NICER_TOKEN,
  headers: { "Idempotency-Key": process.env.NICER_IDEMPOTENCY_KEY, "x-nicer-company": process.env.NICER_COMPANY },
});

await nicer.commerce.payoutRuns.create({
  "statementIds": [
    "string"
  ]
});
```

### Nicer CLI

```bash
nicer commerce payout-runs create --company "$NICER_COMPANY" --input - <<'JSON'
{
  "statementIds": [
    "string"
  ]
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/commerce/payout-runs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --header 'x-nicer-company: string' \
  --data '
{
  "statementIds": [
    "string"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/payout-runs';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    'x-nicer-company': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({statementIds: ['string']})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.nicer.travel/commerce/payout-runs"

payload = { "statementIds": ["string"] }
headers = {
    "Content-Type": "application/json",
    "Idempotency-Key": "string",
    "x-nicer-company": "string",
    "Authorization": "Bearer <token>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "companyName": "string",
  "completedAt": "2019-08-24T14:15:22Z",
  "createdAt": "2019-08-24T14:15:22Z",
  "createdByUserId": "string",
  "jobId": "string",
  "number": "string",
  "payoutCount": 9007199254740991,
  "payoutRunId": "string",
  "status": "SUBMITTED",
  "submittedAt": "2019-08-24T14:15:22Z",
  "totals": [
    {
      "amountMinor": 9007199254740991,
      "currency": "string",
      "failedMinor": 9007199254740991,
      "paidMinor": 9007199254740991
    }
  ],
  "updatedAt": "2019-08-24T14:15:22Z",
  "allowedActions": [
    "RETRY"
  ],
  "nextCursor": "string",
  "payouts": [
    {
      "amountMinor": 9007199254740991,
      "attempts": 9007199254740991,
      "companyName": "string",
      "createdAt": "2019-08-24T14:15:22Z",
      "currency": "string",
      "failureReason": "string",
      "method": "STRIPE_CONNECT",
      "paidAt": "2019-08-24T14:15:22Z",
      "payeeId": "string",
      "payeeKind": "ADVISOR",
      "payoutId": "string",
      "payoutRunId": "string",
      "processorReference": "string",
      "statementId": "string",
      "statementNumber": "string",
      "status": "PENDING",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ]
}
```

- `companyName` (`commerce.payoutRuns.create.response.200.companyName`; string, required)
  - minLength: `1`
- `completedAt` (`commerce.payoutRuns.create.response.200.completedAt`; any of, required)
  - any of the following: `string`, `null`
- `createdAt` (`commerce.payoutRuns.create.response.200.createdAt`; string, required)
  - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
- `createdByUserId` (`commerce.payoutRuns.create.response.200.createdByUserId`; string, required)
  - minLength: `1`
- `jobId` (`commerce.payoutRuns.create.response.200.jobId`; any of, required)
  - any of the following: `string`, `null`
- `number` (`commerce.payoutRuns.create.response.200.number`; string, required)
  - minLength: `1`
- `payoutCount` (`commerce.payoutRuns.create.response.200.payoutCount`; integer, required)
  - maximum: `9007199254740991` · minimum: `0`
- `payoutRunId` (`commerce.payoutRuns.create.response.200.payoutRunId`; string, required)
  - minLength: `1`
- `status` (`commerce.payoutRuns.create.response.200.status`; string, required)
  - one of `"SUBMITTED"`, `"PARTIALLY_FAILED"`, `"COMPLETED"`
- `submittedAt` (`commerce.payoutRuns.create.response.200.submittedAt`; any of, required)
  - any of the following: `string`, `null`
- `totals` (`commerce.payoutRuns.create.response.200.totals`; array of object, required)
  - `amountMinor` (`commerce.payoutRuns.create.response.200.totals.amountMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `currency` (`commerce.payoutRuns.create.response.200.totals.currency`; string, required)
    - pattern: `^[A-Z]{3}$`
  - `failedMinor` (`commerce.payoutRuns.create.response.200.totals.failedMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `paidMinor` (`commerce.payoutRuns.create.response.200.totals.paidMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
- `updatedAt` (`commerce.payoutRuns.create.response.200.updatedAt`; string, required)
  - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
- `allowedActions` (`commerce.payoutRuns.create.response.200.allowedActions`; array of string, required)
  - one of `"RETRY"`, `"CANCEL"`
- `nextCursor` (`commerce.payoutRuns.create.response.200.nextCursor`; any of, required)
  - any of the following: `string`, `null`
- `payouts` (`commerce.payoutRuns.create.response.200.payouts`; array of object, required)
  - `amountMinor` (`commerce.payoutRuns.create.response.200.payouts.amountMinor`; integer, required)
    - maximum: `9007199254740991`
  - `attempts` (`commerce.payoutRuns.create.response.200.payouts.attempts`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `companyName` (`commerce.payoutRuns.create.response.200.payouts.companyName`; string, required)
    - minLength: `1`
  - `createdAt` (`commerce.payoutRuns.create.response.200.payouts.createdAt`; string, required)
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`
  - `currency` (`commerce.payoutRuns.create.response.200.payouts.currency`; string, required)
    - pattern: `^[A-Z]{3}$`
  - `failureReason` (`commerce.payoutRuns.create.response.200.payouts.failureReason`; any of, required)
    - any of the following: `string`, `null`
  - `method` (`commerce.payoutRuns.create.response.200.payouts.method`; string, required)
    - one of `"STRIPE_CONNECT"`, `"CHECK"`, `"MANUAL"`
  - `paidAt` (`commerce.payoutRuns.create.response.200.payouts.paidAt`; any of, required)
    - any of the following: `string`, `null`
  - `payeeId` (`commerce.payoutRuns.create.response.200.payouts.payeeId`; string, required)
    - minLength: `1`
  - `payeeKind` (`commerce.payoutRuns.create.response.200.payouts.payeeKind`; string, required)
    - one of `"ADVISOR"`, `"COMPANY"`
  - `payoutId` (`commerce.payoutRuns.create.response.200.payouts.payoutId`; string, required)
    - minLength: `1`
  - `payoutRunId` (`commerce.payoutRuns.create.response.200.payouts.payoutRunId`; string, required)
    - minLength: `1`
  - `processorReference` (`commerce.payoutRuns.create.response.200.payouts.processorReference`; any of, required)
    - any of the following: `string`, `null`
  - `statementId` (`commerce.payoutRuns.create.response.200.payouts.statementId`; string, required)
    - minLength: `1`
  - `statementNumber` (`commerce.payoutRuns.create.response.200.payouts.statementNumber`; string, required)
    - minLength: `1`
  - `status` (`commerce.payoutRuns.create.response.200.payouts.status`; string, required)
    - one of `"PENDING"`, `"PAID"`, `"FAILED"`, `"CANCELLED"`
  - `updatedAt` (`commerce.payoutRuns.create.response.200.payouts.updatedAt`; string, required)
    - format: `date-time` · pattern: `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$`

### 400

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.payoutRuns.create.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.payoutRuns.create.response.400.errorMessage`; string, required)

### 401

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.payoutRuns.create.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.payoutRuns.create.response.401.errorMessage`; string, required)

### 403

Request failed. `errorCode` is stable; `errorMessage` is for humans.

#### Example

```json
{
  "errorCode": "string",
  "errorMessage": "string"
}
```

- `errorCode` (`commerce.payoutRuns.create.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.payoutRuns.create.response.403.errorMessage`; string, required)


Source: https://docs.nicer.travel/api/Commerce/commerce.payoutRuns.create/index.md
