---
title: "Run a payee 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 payee action

Path: Nicer API › Commerce

`POST /commerce/payees/{payeeId}/actions`

URL: `https://api.nicer.travel/commerce/payees/{payeeId}/actions`

One action on a payee of the company (an advisor's user id, or the agency's company name). SAVE_SETTINGS (statement cycle — one to four days of the month, 31 for its last day —, statements on or off and from which date, minimum payout, payout method, legal name, tax form status) against the version read, agency admins and finance staff. START_STRIPE_ONBOARDING creates the payee's Stripe Connect Express account when it has none and answers a hosted onboarding link; REFRESH_STRIPE_ACCOUNT reads back whether Stripe lets it receive transfers. The payee runs these two for themselves; admins and staff for anyone. Returns the payee.

## Authentication

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

## Path parameters

- `payeeId` (`commerce.payees.actions.create.path.payeeId`; string, required)

## Header parameters

- `Idempotency-Key` (`commerce.payees.actions.create.header.Idempotency-Key`; string, required) — Unique key (8–255 chars) per request; replays return the original result.
- `x-nicer-company` (`commerce.payees.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:

- `payeeKind` (`<option>.payeeKind`; string, required)
  - one of `"ADVISOR"`, `"COMPANY"`
- `type` (`<option>.type`; string, required)

One of the following, each adding:

- `object` (`commerce.payees.actions.create.1`)
  - `cycleDays` (`commerce.payees.actions.create.1.cycleDays`; array of integer, required)
    - maximum: `31` · minimum: `1`
  - `expectedVersion` (`commerce.payees.actions.create.1.expectedVersion`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `minimumPayoutMinor` (`commerce.payees.actions.create.1.minimumPayoutMinor`; integer, required)
    - maximum: `100000000` · minimum: `0`
  - `statementsEnabled` (`commerce.payees.actions.create.1.statementsEnabled`; boolean, required)
  - `taxFormStatus` (`commerce.payees.actions.create.1.taxFormStatus`; string, required)
    - one of `"MISSING"`, `"W9_ON_FILE"`, `"W8_ON_FILE"`
  - `legalName` (`commerce.payees.actions.create.1.legalName`; any of, optional)
    - any of the following: `string`, `null`
  - `payoutMethod` (`commerce.payees.actions.create.1.payoutMethod`; any of, optional)
    - any of the following: `PayoutMethod`, `null`
  - `statementsStartOn` (`commerce.payees.actions.create.1.statementsStartOn`; any of, optional)
    - any of the following: `string`, `null`
- `object` (`commerce.payees.actions.create.2`)
- `object` (`commerce.payees.actions.create.3`)

## Example request

```json
{
  "payeeKind": "ADVISOR",
  "cycleDays": [
    1
  ],
  "expectedVersion": 9007199254740991,
  "legalName": "string",
  "minimumPayoutMinor": 100000000,
  "payoutMethod": "STRIPE_CONNECT",
  "statementsEnabled": true,
  "statementsStartOn": "2019-08-24",
  "taxFormStatus": "MISSING",
  "type": "SAVE_SETTINGS"
}
```

## 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.payees.actions.create({
  "payeeId": "string",
  "payeeKind": "ADVISOR",
  "cycleDays": [
    1
  ],
  "expectedVersion": 9007199254740991,
  "minimumPayoutMinor": 100000000,
  "statementsEnabled": true,
  "taxFormStatus": "MISSING",
  "type": "SAVE_SETTINGS"
});
```

### Nicer CLI

```bash
nicer commerce payees actions create --payee-id 'string' --company "$NICER_COMPANY" --input - <<'JSON'
{
  "payeeKind": "ADVISOR",
  "cycleDays": [
    1
  ],
  "expectedVersion": 9007199254740991,
  "minimumPayoutMinor": 100000000,
  "statementsEnabled": true,
  "taxFormStatus": "MISSING",
  "type": "SAVE_SETTINGS"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url 'https://api.nicer.travel/commerce/payees/<payeeId>/actions' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: string' \
  --header 'x-nicer-company: string' \
  --data '
{
  "payeeKind": "ADVISOR",
  "cycleDays": [
    1
  ],
  "expectedVersion": 9007199254740991,
  "legalName": "string",
  "minimumPayoutMinor": 100000000,
  "payoutMethod": "STRIPE_CONNECT",
  "statementsEnabled": true,
  "statementsStartOn": "2019-08-24",
  "taxFormStatus": "MISSING",
  "type": "SAVE_SETTINGS"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/payees/<payeeId>/actions';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Idempotency-Key': 'string',
    'x-nicer-company': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    payeeKind: 'ADVISOR',
    cycleDays: [1],
    expectedVersion: 9007199254740991,
    legalName: 'string',
    minimumPayoutMinor: 100000000,
    payoutMethod: 'STRIPE_CONNECT',
    statementsEnabled: true,
    statementsStartOn: '2019-08-24',
    taxFormStatus: 'MISSING',
    type: 'SAVE_SETTINGS'
  })
};

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/payees/<payeeId>/actions"

payload = {
    "payeeKind": "ADVISOR",
    "cycleDays": [1],
    "expectedVersion": 9007199254740991,
    "legalName": "string",
    "minimumPayoutMinor": 100000000,
    "payoutMethod": "STRIPE_CONNECT",
    "statementsEnabled": True,
    "statementsStartOn": "2019-08-24",
    "taxFormStatus": "MISSING",
    "type": "SAVE_SETTINGS"
}
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
{
  "onboardingUrl": "http://example.com",
  "payee": {
    "companyName": "string",
    "cycleDays": [
      1
    ],
    "legalName": "string",
    "minimumPayoutMinor": 9007199254740991,
    "nextCycleOn": "2019-08-24",
    "payeeId": "string",
    "payeeKind": "ADVISOR",
    "payoutMethod": "STRIPE_CONNECT",
    "payoutReady": true,
    "statementsEnabled": true,
    "statementsStartOn": "2019-08-24",
    "stripeAccountId": "string",
    "stripeTransfersEnabled": true,
    "taxFormStatus": "MISSING",
    "unassigned": [
      {
        "amountMinor": -9007199254740991,
        "currency": "string"
      }
    ],
    "updatedAt": "2019-08-24T14:15:22Z",
    "version": 9007199254740991
  }
}
```

- `onboardingUrl` (`commerce.payees.actions.create.response.200.onboardingUrl`; any of, required)
  - any of the following: `string`, `null`
- `payee` (`commerce.payees.actions.create.response.200.payee`; object, required)
  - `companyName` (`commerce.payees.actions.create.response.200.payee.companyName`; string, required)
    - minLength: `1`
  - `cycleDays` (`commerce.payees.actions.create.response.200.payee.cycleDays`; array of integer, required)
    - maximum: `31` · minimum: `1`
  - `legalName` (`commerce.payees.actions.create.response.200.payee.legalName`; any of, required)
    - any of the following: `string`, `null`
  - `minimumPayoutMinor` (`commerce.payees.actions.create.response.200.payee.minimumPayoutMinor`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`
  - `nextCycleOn` (`commerce.payees.actions.create.response.200.payee.nextCycleOn`; any of, required)
    - any of the following: `string`, `null`
  - `payeeId` (`commerce.payees.actions.create.response.200.payee.payeeId`; string, required)
    - minLength: `1`
  - `payeeKind` (`commerce.payees.actions.create.response.200.payee.payeeKind`; string, required)
    - one of `"ADVISOR"`, `"COMPANY"`
  - `payoutMethod` (`commerce.payees.actions.create.response.200.payee.payoutMethod`; any of, required)
    - any of the following: `PayoutMethod`, `null`
  - `payoutReady` (`commerce.payees.actions.create.response.200.payee.payoutReady`; boolean, required)
  - `statementsEnabled` (`commerce.payees.actions.create.response.200.payee.statementsEnabled`; boolean, required)
  - `statementsStartOn` (`commerce.payees.actions.create.response.200.payee.statementsStartOn`; any of, required)
    - any of the following: `string`, `null`
  - `stripeAccountId` (`commerce.payees.actions.create.response.200.payee.stripeAccountId`; any of, required)
    - any of the following: `string`, `null`
  - `stripeTransfersEnabled` (`commerce.payees.actions.create.response.200.payee.stripeTransfersEnabled`; boolean, required)
  - `taxFormStatus` (`commerce.payees.actions.create.response.200.payee.taxFormStatus`; string, required)
    - one of `"MISSING"`, `"W9_ON_FILE"`, `"W8_ON_FILE"`
  - `unassigned` (`commerce.payees.actions.create.response.200.payee.unassigned`; array of object, required)
    - `amountMinor` (`commerce.payees.actions.create.response.200.payee.unassigned.amountMinor`; integer, required)
      - maximum: `9007199254740991` · minimum: `-9007199254740991`
    - `currency` (`commerce.payees.actions.create.response.200.payee.unassigned.currency`; string, required)
      - pattern: `^[A-Z]{3}$`
  - `updatedAt` (`commerce.payees.actions.create.response.200.payee.updatedAt`; any of, required)
    - any of the following: `string`, `null`
  - `version` (`commerce.payees.actions.create.response.200.payee.version`; integer, required)
    - maximum: `9007199254740991` · minimum: `0`

### 400

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

#### Example

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

- `errorCode` (`commerce.payees.actions.create.response.400.errorCode`; string, required)
- `errorMessage` (`commerce.payees.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.payees.actions.create.response.401.errorCode`; string, required)
- `errorMessage` (`commerce.payees.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.payees.actions.create.response.403.errorCode`; string, required)
- `errorMessage` (`commerce.payees.actions.create.response.403.errorMessage`; string, required)


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