# POST /api/v1/credit/underwriting/assessments/{assessment_id}/completion

> Complete an underwriting assessment

- **Tag:** credit
- **Operation ID:** `complete_underwriting_assessment_api_v1_credit_underwriting_assessments__assessment_id__completion_post`

## Description

Scores measured figures against the program's criteria set and closes the assessment. Returns per-criterion value, threshold, pass or fail, and source, plus roll-up counts and a weighted score. A criterion we could not measure comes back `passed: null` rather than false — those call for opposite actions. No recommendation is returned at any point.

## Authentication

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

## Parameters

- `assessment_id` (path, string, required)

## Request body

Schema: `UnderwritingCompletionRequest`

- `measured_values` (object · required) — Criterion key to measured figure.
- `financials` (object) — Income statement, balance sheet, debt facilities, cash flow.
- `evidence` (object) — Per-criterion evidence trail.
- `segment` (string) — Merchant segment for threshold overrides.

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_UnderwritingAssessmentResponse_`

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

### 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/credit/underwriting/assessments/{assessment_id}/completion' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "measured_values": {}
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/credit/underwriting/assessments/{assessment_id}/completion', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "measured_values": {}
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "measured_values": {}
}

response = httpx.post("https://api.ondayzero.com/api/v1/credit/underwriting/assessments/{assessment_id}/completion", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/credit/complete-underwriting-assessment
- OpenAPI slice: https://www.ondayzero.com/docs/reference/credit/complete-underwriting-assessment/openapi.json
- Other endpoints in **credit**: https://www.ondayzero.com/docs/reference/credit
