# PUT /api/v1/contracts/settings

> Update Order-to-Cash settings

- **Tag:** contracts
- **Operation ID:** `update_o2c_settings`

## Description

Persist the business's O2C configuration defaults (invoice cadence, default net days, tax treatment, hours/invoice approver roles) and return the stored settings.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `O2CSettings`

- `invoice_cadence` (InvoiceCadenceEnum) → `InvoiceCadenceEnum` — Default recurring invoice cadence: calendar_month or four_week.
- `default_net_days` (integer) — Default payment terms as net days (e.g. 30 for Net 30).
- `default_tax_treatment` (string) — Default tax treatment applied to new invoices (e.g. 'exempt').
- `hours_approver_role` (string) — Role permitted to approve hours/drawdowns (e.g. 'admin').
- `invoice_approver_role` (string) — Role permitted to approve/send invoices (e.g. 'admin').
- `slack_team_id` (string) — Slack workspace (team) ID linked to this business for inbound hours submissions (/hours slash command and app mentions). Must look like a Slack team ID (``T`` + 8 or more upper-case letters/digits) and may be linked to only one business. Requests from unlinked workspaces are rejected.

## Responses

### 200 — Successful Response

Schema: `O2CSettings`

- `invoice_cadence` (InvoiceCadenceEnum) → `InvoiceCadenceEnum` — Default recurring invoice cadence: calendar_month or four_week.
- `default_net_days` (integer) — Default payment terms as net days (e.g. 30 for Net 30).
- `default_tax_treatment` (string) — Default tax treatment applied to new invoices (e.g. 'exempt').
- `hours_approver_role` (string) — Role permitted to approve hours/drawdowns (e.g. 'admin').
- `invoice_approver_role` (string) — Role permitted to approve/send invoices (e.g. 'admin').
- `slack_team_id` (string) — Slack workspace (team) ID linked to this business for inbound hours submissions (/hours slash command and app mentions). Must look like a Slack team ID (``T`` + 8 or more upper-case letters/digits) and may be linked to only one business. Requests from unlinked workspaces are rejected.

### 400 — Bad Request - Invalid input

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 401 — Unauthorized - Missing/invalid token or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 404 — Not Found - Resource does not exist

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/contracts/settings' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "invoice_cadence": "string",
  "default_net_days": 0,
  "default_tax_treatment": "string",
  "hours_approver_role": "string",
  "invoice_approver_role": "string",
  "slack_team_id": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/contracts/settings', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "invoice_cadence": "string",
  "default_net_days": 0,
  "default_tax_treatment": "string",
  "hours_approver_role": "string",
  "invoice_approver_role": "string",
  "slack_team_id": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {'invoice_cadence': 'string',
 'default_net_days': 0,
 'default_tax_treatment': 'string',
 'hours_approver_role': 'string',
 'invoice_approver_role': 'string',
 'slack_team_id': 'string'}

response = httpx.put("https://api.ondayzero.com/api/v1/contracts/settings", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/contracts/update-o2c-settings
- OpenAPI slice: https://www.ondayzero.com/docs/reference/contracts/update-o2c-settings/openapi.json
- Other endpoints in **contracts**: https://www.ondayzero.com/docs/reference/contracts (markdown bundle: https://www.ondayzero.com/docs/reference/contracts.md, OpenAPI: https://www.ondayzero.com/docs/reference/contracts/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
