> ## Documentation Index
> Fetch the complete documentation index at: https://hellasdirect.ask-wire.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Calculate reconstruction cost

> Calculate the as-new reconstruction cost of a property. Optionally returns the as-is (depreciated) value when a construction year is provided.

## Overview

Calculates the as-new reconstruction cost of a property based on its postal-code prefix, property type, and build area. When a construction year is supplied, the response also includes the as-is (depreciated) value.

Only the first two digits of the postal code are used for the cost lookup.

Authentication is not enforced at the schema level, but a valid Bearer token is recommended for production integrations.

***

## Query parameters

| Parameter           | Type    | Required | Description                                                                                  |
| ------------------- | ------- | -------- | -------------------------------------------------------------------------------------------- |
| `postal_code`       | string  | Yes      | Full postal code. Only the first two digits are used. Must be numeric, at least two digits.  |
| `property_type`     | string  | Yes      | Property type. One of: `apartment`, `house`, `maisonette`.                                   |
| `build_area`        | number  | Yes      | Build area in m². Must be greater than 0.                                                    |
| `construction_year` | integer | No       | Construction year. When provided, the as-is value is also returned. Cannot be in the future. |

***

## Response fields

| Field                        | Type   | Description                                                                    |
| ---------------------------- | ------ | ------------------------------------------------------------------------------ |
| `reconstruction_cost.as_new` | number | As-new reconstruction cost. Always returned.                                   |
| `reconstruction_cost.as_is`  | number | As-is (depreciated) value. Only present when `construction_year` was supplied. |

***

## Error responses

| Status | Description                                                                               |
| ------ | ----------------------------------------------------------------------------------------- |
| `400`  | Invalid input parameters.                                                                 |
| `422`  | No reconstruction cost mapping exists for the given postal-code prefix and property type. |

***

## Example request

```bash theme={null}
curl -X GET "https://pandora.ask-wire.com/api/reconstruction-cost/?postal_code=1010&property_type=apartment&build_area=95&construction_year=2005" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Example response

```json theme={null}
{
  "reconstruction_cost": {
    "as_new": 145000.0,
    "as_is": 112000.0
  }
}
```


## OpenAPI

````yaml GET /api/reconstruction-cost/
openapi: 3.1.0
info:
  title: Properties API
  version: 1.0.0
  description: Public properties and foreclosure listings API
servers:
  - url: https://pandora.ask-wire.com
    description: Main API (Properties)
  - url: https://zeus.ask-wire.com
    description: Auth API
security:
  - bearerAuth: []
paths:
  /api/reconstruction-cost/:
    get:
      summary: Calculate reconstruction cost
      description: >-
        Calculates the as-new reconstruction cost of a property from its
        postal-code prefix, property type, and build area. If a construction
        year is supplied, the as-is (depreciated) value is also returned.
      operationId: getReconstructionCost
      parameters:
        - name: postal_code
          in: query
          required: true
          description: >-
            Full postal code. Only the first two digits are used for the cost
            lookup. Numeric, at least two digits.
          schema:
            type: string
        - name: property_type
          in: query
          required: true
          description: Property type.
          schema:
            type: string
            enum:
              - apartment
              - house
              - maisonette
        - name: build_area
          in: query
          required: true
          description: Build area in m². Must be greater than 0.
          schema:
            type: number
            exclusiveMinimum: 0
        - name: construction_year
          in: query
          required: false
          description: >-
            Construction year. When provided, the response also includes the
            as-is (depreciated) value. Cannot be in the future.
          schema:
            type: integer
      responses:
        '200':
          description: Reconstruction cost result.
          content:
            application/json:
              schema:
                $ref: f4f7a25b-77d2-4b6e-910b-235b54d06de1
              example:
                reconstruction_cost:
                  as_new: 145000
                  as_is: 112000
        '400':
          description: Invalid input parameters.
        '422':
          description: >-
            No reconstruction cost mapping exists for the given postal-code
            prefix and property type.
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````