---
title: "Buy a building's report"
method: POST
path: "/public/building-reports/checkout"
tags: ["Building reports"]
---

# Buy a building's report

`POST /public/building-reports/checkout`

## Request

- Base URL: `https://api.baseray.ai/v1`
- URL: `https://api.baseray.ai/v1/public/building-reports/checkout`
- Auth: none required

Starts a Stripe Checkout for one building's report, at its final price (tax included), without an account. Sold only for a building whose public page is indexable (enough register facts) and only while Stripe takes live charges. The buyer must ask for immediate delivery and accept losing the right of withdrawal on delivery, and accept the terms (`consent`). After paying, Checkout returns to the report's page in the app; when abandoned, to `returnPath` on baseray.ai. Limited per visitor (the website names the visitor).

## Request body

- BuildingReportCheckoutRequest: A building report bought from its building's page.
  - `buildingId` string, uuid, required: The building's baseray id.
  - `locale` 'en' | 'ro' | 'cs' | 'da', required: The building page's language: Checkout's and the delivery email's.
  - `returnPath` string, required: The building's page on baseray.ai in that language, where an abandoned Checkout returns: `/building/`, `/ro/cladire/`, `/cs/budova/` or `/da/bygning/`, then an optional slug and the building's id.
  - `consent` object, required: Both must be true.
    - `withdrawalWaiver` boolean, required: The buyer asks for the report to be delivered at once and acknowledges losing the 14-day right of withdrawal on delivery.
    - `terms` boolean, required: The buyer accepts the terms.
  - `attribution` object, nullable: Where the buyer came from before buying (first touch), as a sign-up keeps it.
    - `utmSource` string, nullable
    - `utmMedium` string, nullable
    - `utmCampaign` string, nullable
    - `utmContent` string, nullable
    - `utmTerm` string, nullable
    - `gclid` string, nullable
    - `referrerHost` string, nullable
    - `landingPath` string, nullable
    - `callToAction` string, nullable
  - `analyticsAnonymousId` string, nullable: The visit's product analytics anonymous id (letters, digits, dashes, up to 64); dropped in another shape.
  - `analyticsSessionId` string, nullable: The visit's product analytics session id (letters, digits, dashes, up to 64); dropped in another shape. With both ids, the report's link carries them (`br_ph`), so its page continues the visit.

## Response `201`

The Checkout to send the buyer to.

- BuildingReportCheckout: A started report Checkout.
  - `checkoutUrl` string, uri, required: The Stripe Checkout page to send the buyer to; it expires after an hour.

## Other responses

- `404`: No building with a public page has this id (`not_found`).
- `409`: The building's public page is not indexable: too few register facts for a report (`report_unavailable`).
- `422`: Both boxes not ticked (`consent_required`), or a field missing, malformed or unknown (`invalid_parameter`); `parameter` names it.
- `429`: Too many report checkouts from this visitor in an hour (`rate_limited`); retry after `Retry-After` seconds.
- `503`: Stripe takes no live charges now (`payments_unavailable`), or the building catalogue or Stripe cannot be reached (`upstream_unavailable`).

---

[API](https://skmtc.dev/baseray/apis/baseray-api.md) · [All operations](https://skmtc.dev/baseray/apis/baseray-api/llms.txt) · [OpenAPI document](https://skmtc.dev/baseray/apis/baseray-api/revisions/2dc2808717f7?raw)
