# POST /api/v1/estimates

> Create estimate

- **Tag:** estimates
- **Operation ID:** `create_estimate`

## Description

Create a new estimate in draft status.

## Authentication

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

## Request body

Schema: `EstimateCreate`

- `customer_id` (string · required) — Customer to send estimate to
- `line_items` (array · EstimateLineItem · required) → `EstimateLineItem` — Line items
  - `variant_id` (string) — Product variant ID or null for custom
  - `description` (string · required) — Line item description
  - `quantity` (integer) — Quantity
  - `unit_price` (integer · required) — Unit price in cents
  - `amount` (integer · required) — Total amount in cents (qty * unit_price)
- `due_date` (string) — Proposed payment due date (YYYY-MM-DD)
- `expiration_date` (string) — Estimate expiration date (YYYY-MM-DD)
- `description` (string) — Estimate description
- `internal_notes` (string) — Internal notes
- `currency` (string) — Currency code

## Example request

```json
{
  "customer_id": "0192a4f0-1b2c-7d3e-8f4a-5b6c7d8e9f01",
  "description": "Q2 website redesign proposal",
  "expiration_date": "2026-03-31",
  "line_items": [
    {
      "amount": 250000,
      "description": "Website redesign - discovery phase",
      "quantity": 1,
      "unit_price": 250000
    },
    {
      "amount": 1200000,
      "description": "Design sprint (per week)",
      "quantity": 3,
      "unit_price": 400000
    }
  ]
}
```

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_EstimateResponse_`

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

### 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 or expired token, an MCP OAuth token used against the REST API, 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 POST 'https://api.ondayzero.com/api/v1/estimates' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "customer_id": "0192a4f0-1b2c-7d3e-8f4a-5b6c7d8e9f01",
  "description": "Q2 website redesign proposal",
  "expiration_date": "2026-03-31",
  "line_items": [
    {
      "amount": 250000,
      "description": "Website redesign - discovery phase",
      "quantity": 1,
      "unit_price": 250000
    },
    {
      "amount": 1200000,
      "description": "Design sprint (per week)",
      "quantity": 3,
      "unit_price": 400000
    }
  ]
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/estimates', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "customer_id": "0192a4f0-1b2c-7d3e-8f4a-5b6c7d8e9f01",
  "description": "Q2 website redesign proposal",
  "expiration_date": "2026-03-31",
  "line_items": [
    {
      "amount": 250000,
      "description": "Website redesign - discovery phase",
      "quantity": 1,
      "unit_price": 250000
    },
    {
      "amount": 1200000,
      "description": "Design sprint (per week)",
      "quantity": 3,
      "unit_price": 400000
    }
  ]
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {'customer_id': '0192a4f0-1b2c-7d3e-8f4a-5b6c7d8e9f01',
 'description': 'Q2 website redesign proposal',
 'expiration_date': '2026-03-31',
 'line_items': [{'amount': 250000,
                 'description': 'Website redesign - discovery phase',
                 'quantity': 1,
                 'unit_price': 250000},
                {'amount': 1200000,
                 'description': 'Design sprint (per week)',
                 'quantity': 3,
                 'unit_price': 400000}]}

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

## See also

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