---
title: "Run a payout run action"
---

> 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.

# Run a payout run action

Path: Nicer API › Commerce

`POST /commerce/payout-runs/{payoutRunId}/actions`

URL: `https://api.nicer.travel/commerce/payout-runs/{payoutRunId}/actions`

One action on a payout run. RETRY (finance staff) sends its failed payouts again: the transfer already made for a payout is looked up before a new one is made, so nothing is paid twice. CANCEL (agency admins and finance staff) drops pending or failed payouts once the run is not being sent (409 COMMISSION_PAYOUT_RUN_BUSY while it is), leaving their statements approved for another run or for MARK_PAID on the statement. Returns the run.

## Authentication

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

## Path parameters

- `payoutRunId` (`commerce.payoutRuns.actions.create.path.payoutRunId`; string, required)

## Header parameters

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

## Request body

_Required._

Every option has:

- `type` (`<option>.type`; string, required)

One of the following, each adding:

- `object` (`commerce.payoutRuns.actions.create.1`)
- `object` (`commerce.payoutRuns.actions.create.2`)
  - `payoutIds` (`commerce.payoutRuns.actions.create.2.payoutIds`; array of string, required)
    - maxLength: `255` · minLength: `1`
  - `reason` (`commerce.payoutRuns.actions.create.2.reason`; string, required)
    - maxLength: `500` · minLength: `1`

## Example request

```json
{
  "type": "RETRY"
}
```

## 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.actions.create({
  "payoutRunId": "string",
  "type": "RETRY"
});
```

### Nicer CLI

```bash
nicer commerce payout-runs actions create --payout-run-id 'string' --company "$NICER_COMPANY" --input - <<'JSON'
{
  "type": "RETRY"
}
JSON
```

### cURL

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

### TypeScript

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

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/<payoutRunId>/actions"

payload = { "type": "RETRY" }
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.actions.create.response.200.companyName`; string, required)
  - minLength: `1`
- `completedAt` (`commerce.payoutRuns.actions.create.response.200.completedAt`; any of, required)
  - any of the following: `string`, `null`
- `createdAt` (`commerce.payoutRuns.actions.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.actions.create.response.200.createdByUserId`; string, required)
  - minLength: `1`
- `jobId` (`commerce.payoutRuns.actions.create.response.200.jobId`; any of, required)
  - any of the following: `string`, `null`
- `number` (`commerce.payoutRuns.actions.create.response.200.number`; string, required)
  - minLength: `1`
- `payoutCount` (`commerce.payoutRuns.actions.create.response.200.payoutCount`; integer, required)
  - maximum: `9007199254740991` · minimum: `0`
- `payoutRunId` (`commerce.payoutRuns.actions.create.response.200.payoutRunId`; string, required)
  - minLength: `1`
- `status` (`commerce.payoutRuns.actions.create.response.200.status`; string, required)
  - one of `"SUBMITTED"`, `"PARTIALLY_FAILED"`, `"COMPLETED"`
- `submittedAt` (`commerce.payoutRuns.actions.create.response.200.submittedAt`; any of, required)
  - any of the following: `string`, `null`
- `totals` (`commerce.payoutRuns.actions.create.response.200.totals`; array of object, required)
  - `amountMinor` (`commerce.payoutRuns.actions.create.response.200.totals.amountMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `currency` (`commerce.payoutRuns.actions.create.response.200.totals.currency`; string, required)
    - pattern: `^[A-Z]{3}$`
  - `failedMinor` (`commerce.payoutRuns.actions.create.response.200.totals.failedMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `paidMinor` (`commerce.payoutRuns.actions.create.response.200.totals.paidMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
- `updatedAt` (`commerce.payoutRuns.actions.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.actions.create.response.200.allowedActions`; array of string, required)
  - one of `"RETRY"`, `"CANCEL"`
- `nextCursor` (`commerce.payoutRuns.actions.create.response.200.nextCursor`; any of, required)
  - any of the following: `string`, `null`
- `payouts` (`commerce.payoutRuns.actions.create.response.200.payouts`; array of object, required)
  - `amountMinor` (`commerce.payoutRuns.actions.create.response.200.payouts.amountMinor`; integer, required)
    - maximum: `9007199254740991`
  - `attempts` (`commerce.payoutRuns.actions.create.response.200.payouts.attempts`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `companyName` (`commerce.payoutRuns.actions.create.response.200.payouts.companyName`; string, required)
    - minLength: `1`
  - `createdAt` (`commerce.payoutRuns.actions.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.actions.create.response.200.payouts.currency`; string, required)
    - pattern: `^[A-Z]{3}$`
  - `failureReason` (`commerce.payoutRuns.actions.create.response.200.payouts.failureReason`; any of, required)
    - any of the following: `string`, `null`
  - `method` (`commerce.payoutRuns.actions.create.response.200.payouts.method`; string, required)
    - one of `"STRIPE_CONNECT"`, `"CHECK"`, `"MANUAL"`
  - `paidAt` (`commerce.payoutRuns.actions.create.response.200.payouts.paidAt`; any of, required)
    - any of the following: `string`, `null`
  - `payeeId` (`commerce.payoutRuns.actions.create.response.200.payouts.payeeId`; string, required)
    - minLength: `1`
  - `payeeKind` (`commerce.payoutRuns.actions.create.response.200.payouts.payeeKind`; string, required)
    - one of `"ADVISOR"`, `"COMPANY"`
  - `payoutId` (`commerce.payoutRuns.actions.create.response.200.payouts.payoutId`; string, required)
    - minLength: `1`
  - `payoutRunId` (`commerce.payoutRuns.actions.create.response.200.payouts.payoutRunId`; string, required)
    - minLength: `1`
  - `processorReference` (`commerce.payoutRuns.actions.create.response.200.payouts.processorReference`; any of, required)
    - any of the following: `string`, `null`
  - `statementId` (`commerce.payoutRuns.actions.create.response.200.payouts.statementId`; string, required)
    - minLength: `1`
  - `statementNumber` (`commerce.payoutRuns.actions.create.response.200.payouts.statementNumber`; string, required)
    - minLength: `1`
  - `status` (`commerce.payoutRuns.actions.create.response.200.payouts.status`; string, required)
    - one of `"PENDING"`, `"PAID"`, `"FAILED"`, `"CANCELLED"`
  - `updatedAt` (`commerce.payoutRuns.actions.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.actions.create.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.payoutRuns.actions.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.actions.create.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.payoutRuns.actions.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.actions.create.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.payoutRuns.actions.create.response.403.errorMessage`; string, required)


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