# PUT /api/v1/deferred-revenue/{deferral_id}

> Update deferral terms

- **Tag:** deferred-revenue
- **Operation ID:** `update_deferral_terms_api_v1_deferred_revenue__deferral_id__put`

## Description

Re-cut the not-yet-posted part of a recognition schedule.

## Authentication

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

## Parameters

- `deferral_id` (path, string, required)

## Request body

Schema: `UpdateDeferralTermsRequest`

- `unit` (DeferralUnitEnum)
- `method` (DeferralMethodEnum)
- `period_count` (integer)
- `total_units` (number | string)
- `start_date` (string · date)
- `revenue_ledger_name` (string)
- `notes` (string)

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_InvoiceDeferralResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (InvoiceDeferralResponse)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

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

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/deferred-revenue/{deferral_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "unit": "string",
  "method": "string",
  "period_count": 0,
  "total_units": "string",
  "start_date": "2026-01-01",
  "revenue_ledger_name": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/deferred-revenue/{deferral_id}', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "unit": "string",
  "method": "string",
  "period_count": 0,
  "total_units": "string",
  "start_date": "2026-01-01",
  "revenue_ledger_name": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "unit": "string",
  "method": "string",
  "period_count": 0,
  "total_units": "string",
  "start_date": "2026-01-01",
  "revenue_ledger_name": "string"
}

response = httpx.put("https://api.ondayzero.com/api/v1/deferred-revenue/{deferral_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/deferred-revenue/update-deferral-terms
- OpenAPI slice: https://www.ondayzero.com/docs/reference/deferred-revenue/update-deferral-terms/openapi.json
- Other endpoints in **deferred-revenue**: https://www.ondayzero.com/docs/reference/deferred-revenue
