# POST /api/v1/deferred-revenue/{deferral_id}/periods/{period_id}

> Fill in a period's numerator

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

## Description

Enter the units burned down in a period so it can post.

## Authentication

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

## Parameters

- `deferral_id` (path, string, required)
- `period_id` (path, string, required)

## Request body

Schema: `SetPeriodUnitsRequest`

- `units` (number | string · required) — Numerator burned down in this period
- `recognition_date` (string · date) — Date the entry should post on. Defaults to the period's end. Once this date has passed the entry posts on the next run.
- `post_now` (boolean) — Post immediately when the period is already due

## Responses

### 201 — 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 POST 'https://api.ondayzero.com/api/v1/deferred-revenue/{deferral_id}/periods/{period_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "units": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/deferred-revenue/{deferral_id}/periods/{period_id}', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "units": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "units": "string"
}

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

## See also

- HTML version: https://www.ondayzero.com/docs/reference/deferred-revenue/set-period-units
- OpenAPI slice: https://www.ondayzero.com/docs/reference/deferred-revenue/set-period-units/openapi.json
- Other endpoints in **deferred-revenue**: https://www.ondayzero.com/docs/reference/deferred-revenue
