---
title: "Save the commerce settlement"
---

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

# Save the commerce settlement

Path: Nicer API › Commerce

`POST /commerce/settings/actions`

URL: `https://api.nicer.travel/commerce/settings/actions`

Nicer staff mutation on the company's Stripe settlement account, the account checkout collects into. Agency admins pass the route scope but are refused with 403 ERROR_DO_NOT_HAVE_PERMISSION. Uses `expectedVersion` for optimistic concurrency and returns the new version. Commission shares and the Smith markup are split plans, saved through `POST /commerce/commission-settings/actions` (CREATE_SPLIT_PLAN, ASSIGN_SPLIT_PLAN).

## Authentication

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

## Header parameters

- `x-nicer-company` (`commerce.settings.actions.create.header.x-nicer-company`; string, required) — Company context. Authentication and tenant membership are validated by the API.

## Request body

_Required._

One of the following:

- `object`
  - `enabled` (`commerce.settings.actions.create.1.enabled`; boolean, required)
  - `expectedVersion` (`commerce.settings.actions.create.1.expectedVersion`; any of, required)
    - any of the following: `string`, `null`
  - `processorAccountReference` (`commerce.settings.actions.create.1.processorAccountReference`; string, required)
    - minLength: `1`
  - `settlementVersion` (`commerce.settings.actions.create.1.settlementVersion`; string, required)
    - minLength: `1`
  - `type` (`commerce.settings.actions.create.1.type`; string, required)

## Example request

```json
{
  "enabled": true,
  "expectedVersion": "string",
  "processorAccountReference": "string",
  "settlementVersion": "string",
  "type": "SAVE_STRIPE_SETTLEMENT"
}
```

## Code samples

### JavaScript SDK

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

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

await nicer.commerce.settings.actions.create({
  "enabled": true,
  "expectedVersion": "string",
  "processorAccountReference": "string",
  "settlementVersion": "string",
  "type": "SAVE_STRIPE_SETTLEMENT"
});
```

### Nicer CLI

```bash
nicer commerce settings actions create --company "$NICER_COMPANY" --input - <<'JSON'
{
  "enabled": true,
  "expectedVersion": "string",
  "processorAccountReference": "string",
  "settlementVersion": "string",
  "type": "SAVE_STRIPE_SETTLEMENT"
}
JSON
```

### cURL

```bash
curl --request POST \
  --url https://api.nicer.travel/commerce/settings/actions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-nicer-company: string' \
  --data '
{
  "enabled": true,
  "expectedVersion": "string",
  "processorAccountReference": "string",
  "settlementVersion": "string",
  "type": "SAVE_STRIPE_SETTLEMENT"
}
'
```

### TypeScript

```typescript
const url = 'https://api.nicer.travel/commerce/settings/actions';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-nicer-company': 'string',
    Authorization: 'Bearer <token>'
  },
  body: JSON.stringify({
    enabled: true,
    expectedVersion: 'string',
    processorAccountReference: 'string',
    settlementVersion: 'string',
    type: 'SAVE_STRIPE_SETTLEMENT'
  })
};

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

payload = {
    "enabled": True,
    "expectedVersion": "string",
    "processorAccountReference": "string",
    "settlementVersion": "string",
    "type": "SAVE_STRIPE_SETTLEMENT"
}
headers = {
    "Content-Type": "application/json",
    "x-nicer-company": "string",
    "Authorization": "Bearer <token>"
}

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

print(response.text)
```

## Responses

### 200

OK

#### Example

```json
{
  "resourceType": "SETTLEMENT",
  "status": "SAVED",
  "version": "string"
}
```

- `resourceType` (`commerce.settings.actions.create.response.200.resourceType`; string, required)
- `status` (`commerce.settings.actions.create.response.200.status`; string, required)
- `version` (`commerce.settings.actions.create.response.200.version`; string, required)
  - minLength: `1`

### 400

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

#### Example

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

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


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