---
title: "Finalize Report"
method: POST
path: "/api/v1/consumer/report/{report_id}/finalize"
tags: ["consumer"]
---

# Finalize Report

`POST /api/v1/consumer/report/{report_id}/finalize`

## Request

- Base URL: `https://api.casaintelligence.com.au` (the document declares no server; this is the origin it was published from)
- URL: `https://api.casaintelligence.com.au/api/v1/consumer/report/{report_id}/finalize`
- Auth: none declared

Verify Stripe payment + mark report as ready.

Called by the frontend after Stripe redirects the user back to
/report/{id}?session=cs_xxx. We:
  1. Look up the ci_reports row (must exist, must match Stripe session.metadata.report_id)
  2. Fetch the Stripe session and verify payment_status == 'paid'
  3. Update ci_reports.paid=true, status='ready', completed_at=NOW
  4. Return current status

Idempotent — calling twice is safe.

The actual report content is rendered at view time using build_deal_sheet
against the property_id — no PDF generation needed. The customer paid for
permanent access to the live intelligence on this property.

## Path parameters

- `report_id` string, required

## Request body

- AppApiV1ConsumerFinalizeRequest
  - `stripe_session_id` string, required

## Response `200`

Successful Response

- ReportStatusResponse
  - `id` string, required
  - `property_id` string, required
  - `status` string, required
  - `paid` boolean, required
  - `download_url` string, nullable, required
  - `requested_email` string, nullable, required
  - `generation_time_ms` integer, nullable, required
  - `created_at` string, required
  - `completed_at` string, nullable, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/casaintelligence/apis/casa-intelligence-engine.md) · [All operations](https://skmtc.dev/casaintelligence/apis/casa-intelligence-engine/llms.txt) · [OpenAPI document](https://skmtc.dev/casaintelligence/apis/casa-intelligence-engine/revisions/71d711039de0?raw)
