Skip to content
Sign in Sign up

Buy a building's report

POSTapi.baseray.ai/v1/public/building-reports/checkout

Starts a Stripe Checkout for one building's report, at its final price (tax included) in the currency of the page's language (locale): en EUR 4.99, ro RON 24.99, cs CZK 119, da DKK 37 (the answer gives amount and currency), without an account. Sold only for a building whose public page is indexable (enough register facts) and only while Stripe takes live charges. Before paying, Stripe's payment page has the buyer ask for immediate delivery, acknowledge losing the right of withdrawal on delivery and accept the terms (a required box, in the page's language); the order records that consent when it is paid. consent is optional: when sent, both must be true. After paying, Checkout returns to the report's page in the app; when abandoned, to returnPath on baseray.tech. Limited per visitor (the website names the visitor).

Request body

buildingIdstring (uuid)required
The building's baseray id.
localeen | ro | cs | darequired
The building page's language: Checkout's, the delivery email's, and the currency the report is sold in (en EUR, ro RON, cs CZK, da DKK).
returnPathstringrequired
The building's page on baseray.tech 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.
consentobject or null
Optional: Stripe's payment page asks for both before paying. When sent (a box ticked on the website), both must be true.
withdrawalWaiverbooleanrequired
The buyer asks for the report to be delivered at once and acknowledges losing the 14-day right of withdrawal on delivery.
termsbooleanrequired
The buyer accepts the terms.
attributionobject or null
Where the buyer came from before buying (first touch), as a sign-up keeps it.
utmSourcestring or null0–200 characters
utmMediumstring or null0–200 characters
utmCampaignstring or null0–200 characters
utmContentstring or null0–200 characters
utmTermstring or null0–200 characters
gclidstring or null0–200 characters
referrerHoststring or null0–255 characters
landingPathstring or null0–500 characters
callToActionstring or null0–200 characters
analyticsAnonymousIdstring or null
The visit's product analytics anonymous id (letters, digits, dashes, up to 64); dropped in another shape.
analyticsSessionIdstring or null
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, and what it charges.

checkoutUrlstring (uri)required
The Stripe Checkout page to send the buyer to; it expires after an hour.
amountintegerrequired≥ 1
The total the buyer pays, tax included, in the currency's minor units (11900 is CZK 119.00).
currencyeur | ron | czk | dkkrequired
The currency of the page's language, lower-case ISO 4217: en eur, ro ron, cs czk, da dkk.

Errors

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
consent sent without both boxes 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).

Every error has the same shape. Error codes.