{"openapi":"3.1.0","info":{"title":"PerDiemo Developer API","description":"Official B2B REST API (`v1`) for statutory Czech & European per diem travel allowance calculations, AI itinerary extraction, receipt OCR, and accounting PDF generation.\n\n**Authentication:** Click **Authorize** and provide either your `X-API-Key` (`pd_live_...`) generated in [PerDiemo Settings → API Keys](https://www.perdiemo.eu/cz/app/settings) or a Supabase JWT `Bearer` token.","version":"1.1.30"},"paths":{"/version":{"get":{"tags":["System"],"summary":"Get Version","description":"Returns the current backend version. Useful for health checks and monitoring.","operationId":"get_version_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/country-mappings":{"get":{"tags":["Reference Data"],"summary":"Get Country Mappings","description":"Returns statutory ISO 3166-1 alpha-3 / alpha-2 country code mappings and localized Czech/English country names.","operationId":"get_country_mappings_api_v1_country_mappings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/estimate-route-leg":{"get":{"tags":["Routing & Geocoding"],"summary":"Estimate Route Leg","description":"Calculates estimated routing distance, travel duration, intermediate border crossings, \nand statutory flight offsets (3-hour departure buffer) between two itinerary locations.","operationId":"estimate_route_leg_api_v1_estimate_route_leg_get","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"origin","in":"query","required":true,"schema":{"type":"string","description":"Origin municipality, city or IATA airport code (e.g. 'Praha' or 'VIE').","title":"Origin"},"description":"Origin municipality, city or IATA airport code (e.g. 'Praha' or 'VIE')."},{"name":"destination","in":"query","required":true,"schema":{"type":"string","description":"Destination municipality, city or IATA airport code (e.g. 'Wien' or 'TFS').","title":"Destination"},"description":"Destination municipality, city or IATA airport code (e.g. 'Wien' or 'TFS')."},{"name":"departure_time","in":"query","required":true,"schema":{"type":"string","description":"Departure ISO 8601 timestamp (e.g. '2026-05-12T07:00').","title":"Departure Time"},"description":"Departure ISO 8601 timestamp (e.g. '2026-05-12T07:00')."},{"name":"transport_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Transport mode: 'company_car', 'private_vehicle', 'plane', 'train', 'bus', 'ferry', 'hyperloop', 'rocket'.","title":"Transport Type"},"description":"Transport mode: 'company_car', 'private_vehicle', 'plane', 'train', 'bus', 'ferry', 'hyperloop', 'rocket'."},{"name":"origin_country","in":"query","required":true,"schema":{"type":"string","description":"Mandatory 3-letter ISO country code of origin (e.g. 'CZE') per Rule 14.","title":"Origin Country"},"description":"Mandatory 3-letter ISO country code of origin (e.g. 'CZE') per Rule 14."},{"name":"destination_country","in":"query","required":true,"schema":{"type":"string","description":"Mandatory 3-letter ISO country code of destination (e.g. 'AUT') per Rule 14.","title":"Destination Country"},"description":"Mandatory 3-letter ISO country code of destination (e.g. 'AUT') per Rule 14."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calculate":{"post":{"tags":["Calculation Engine"],"summary":"Calculate Allowances","description":"Exposes travel allowance calculations by running the underlying ProcesCesty engine.\nStrictly protected behind require_identity (X-API-Key or Supabase JWT Bearer token).","operationId":"calculate_allowances_api_v1_calculate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}]}},"/api/v1/ocr-receipt":{"post":{"tags":["AI Extraction"],"summary":"Ocr Receipt","description":"Receives an uploaded receipt/invoice image or PDF, sends it to Google Gemini, \nand returns parsed details matching our structured database fields.","operationId":"ocr_receipt_api_v1_ocr_receipt_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_ocr_receipt_api_v1_ocr_receipt_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractedReceipt"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}]}},"/api/v1/parse-itinerary":{"post":{"tags":["AI Extraction"],"summary":"Parse Itinerary With Ai","description":"Receives a natural language text description of a business trip, \npasses it to Google Gemini, and returns a structured itinerary.","operationId":"parse_itinerary_with_ai_api_v1_parse_itinerary_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseItineraryRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedTrip"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}]}},"/api/v1/export/pdf":{"post":{"tags":["Reporting & Exports"],"summary":"Export Pdf","description":"Generates a text-selectable PDF travel allowance report using WeasyPrint.","operationId":"export_pdf_api_v1_export_pdf_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportPDFPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}]}},"/api/v1/complete-business-allowance-from-text":{"post":{"tags":["Business Travel Engine"],"summary":"Complete Business Allowance From Text","description":"All-in-one 'One-Shot' endpoint: processes a natural language trip description,\nestimates all route legs and intermediate border crossings, computes Czech statutory travel allowances\n(including meal reductions, vehicle amortizations, and ČNB rates), and optionally compiles an official PDF report.","operationId":"complete_business_allowance_from_text_api_v1_complete_business_allowance_from_text_post","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"format","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Output format: 'json' (default, contains calculation totals and base64 PDF) or 'pdf' (direct binary application/pdf stream).","default":"json","title":"Format"},"description":"Output format: 'json' (default, contains calculation totals and base64 PDF) or 'pdf' (direct binary application/pdf stream)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteBusinessAllowanceRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompleteBusinessAllowanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/trips/{trip_code}/pdf":{"get":{"tags":["Reporting & Exports"],"summary":"Get Trip Pdf Export","description":"Downloads the official WeasyPrint PDF travel allowance report for a stored trip.\nAuthenticated via:\n1. Valid capability share token query parameter (?token=sec_...), OR\n2. Valid API key (X-API-Key) or Supabase JWT Bearer token.\nUses the centralized Python PDF enricher for 100% visual parity with the Web UI.","operationId":"get_trip_pdf_export_api_v1_trips__trip_code__pdf_get","security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}],"parameters":[{"name":"trip_code","in":"path","required":true,"schema":{"type":"string","title":"Trip Code"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Cryptographically secure URL-safe share token (optional if authenticated).","title":"Token"},"description":"Cryptographically secure URL-safe share token (optional if authenticated)."},{"name":"lang","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Language mutation ('cs' or 'en').","default":"cs","title":"Lang"},"description":"Language mutation ('cs' or 'en')."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/user/usage":{"get":{"tags":["Account & Quotas"],"summary":"Get User Usage","operationId":"get_user_usage_api_v1_user_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"ApiKeyAuth":[]},{"BearerAuth":[]}]}}},"components":{"schemas":{"Body_ocr_receipt_api_v1_ocr_receipt_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_ocr_receipt_api_v1_ocr_receipt_post"},"CalculationRequest":{"properties":{"year":{"type":"integer","title":"Year","default":2025},"trips":{"items":{"$ref":"#/components/schemas/TripInput"},"type":"array","title":"Trips"},"include_routes":{"type":"boolean","title":"Include Routes","default":true}},"type":"object","required":["trips"],"title":"CalculationRequest"},"CompleteBusinessAllowanceRequest":{"properties":{"text":{"type":"string","title":"Text","description":"Natural language description of the business travel itinerary."},"year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year","description":"Statutory calculation year (defaults to itinerary date or current year)."},"legislation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legislation","description":"Statutory jurisdiction ('CZ' for Czech Labor Code).","default":"CZ"},"vlastnictvi_vozidla":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vlastnictvi Vozidla","description":"Vehicle ownership mode: 'SLUZEBNI' (company fleet / air / transit) or 'OSOBNI' (private car with mileage reimbursement).","default":"SLUZEBNI"},"bezplatna_strava":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Bezplatna Strava","description":"Optional explicit overrides for free/provided meals per date (e.g. {'2026-10-27': ['snidane']})."},"generate_pdf":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Generate Pdf","description":"Whether to compile and attach a statutory PDF report.","default":false},"pdf_options":{"anyOf":[{"$ref":"#/components/schemas/PDFMetadataOptions"},{"type":"null"}],"description":"Optional header metadata for PDF export."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Optional Gemini model override."},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"User ID if executing on behalf of a specific user."}},"type":"object","required":["text"],"title":"CompleteBusinessAllowanceRequest"},"CompleteBusinessAllowanceResponse":{"properties":{"trip_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trip Id","description":"Unique identifier for the created trip (e.g. 'C-2026-EA16')."},"share_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Share Token","description":"Cryptographically secure capability token for direct link access."},"report_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Report Url","description":"Direct web URL to view and manage the trip in PerDiemo dashboard."},"pdf_download_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Download Url","description":"Direct authenticated API endpoint to download the official PDF."},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Summary calculation totals, year, and cryptographic verification SHA-256 signature."},"trip_reports":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Trip Reports","description":"Legislative daily calculation reports including routes, meal deductions, and ČNB exchange rates."},"parsed_itinerary":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Parsed Itinerary","description":"Refined chronological itinerary with resolved OSRM routing and border crossing legs."},"bezplatna_strava":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Bezplatna Strava","description":"Parsed free meals provided per date."},"ucel_cesty":{"type":"string","title":"Ucel Cesty","description":"Extracted purpose of the business trip."},"typ_vozidla":{"type":"string","title":"Typ Vozidla","description":"Vehicle ownership type applied."},"pdf_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Base64","description":"Base64-encoded binary PDF report if generate_pdf=True."},"pdf_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Filename","description":"Filename for the generated PDF."}},"type":"object","required":["metadata","trip_reports","parsed_itinerary","ucel_cesty","typ_vozidla"],"title":"CompleteBusinessAllowanceResponse"},"ExportDayItem":{"properties":{"datum":{"type":"string","title":"Datum"},"dep_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dep Time"},"arr_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arr Time"},"transport_icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Icon"},"transport_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Label"},"layover_icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layover Icon"},"layover_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layover Label"},"trasa":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trasa","default":"-"},"border_crossings":{"items":{"type":"string"},"type":"array","title":"Border Crossings","default":[]},"hodiny":{"type":"number","title":"Hodiny","default":0.0},"strava":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Strava","default":"-"},"pasmo":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pasmo","default":"-"},"kraceni":{"type":"number","title":"Kraceni","default":0.0},"zaklad":{"type":"number","title":"Zaklad","default":0.0},"stravne":{"type":"number","title":"Stravne","default":0.0},"kapesne":{"type":"number","title":"Kapesne","default":0.0},"km":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Km"},"miles":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Miles"},"nahrada_auto":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Nahrada Auto"}},"type":"object","required":["datum"],"title":"ExportDayItem"},"ExportPDFPayload":{"properties":{"language":{"type":"string","title":"Language","default":"cs"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"active_tier_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Tier Override"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"company_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Address"},"company_ico":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Ico"},"client_timestamp":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Timestamp"},"client_timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Timezone"},"trips":{"items":{"$ref":"#/components/schemas/ExportTripItem"},"type":"array","title":"Trips"}},"type":"object","required":["trips"],"title":"ExportPDFPayload"},"ExportTripItem":{"properties":{"id_cesty":{"type":"string","title":"Id Cesty"},"ucel_cesty":{"type":"string","title":"Ucel Cesty"},"zamestnanec_jednatel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zamestnanec Jednatel","default":"Neznámý"},"spolecnost":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spolecnost","default":"Neznámá"},"perioda_od":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Perioda Od","default":""},"perioda_do":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Perioda Do","default":""},"vlastnictvi_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vlastnictvi Label","default":"Firemní"},"kurz_cnb":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kurz Cnb"},"days":{"items":{"$ref":"#/components/schemas/ExportDayItem"},"type":"array","title":"Days","default":[]},"total_stravne":{"type":"number","title":"Total Stravne","default":0.0},"total_kapesne":{"type":"number","title":"Total Kapesne","default":0.0},"total_nahrada":{"type":"number","title":"Total Nahrada","default":0.0},"trip_total":{"type":"number","title":"Trip Total","default":0.0},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"}},"type":"object","required":["id_cesty","ucel_cesty"],"title":"ExportTripItem"},"ExtractedReceipt":{"properties":{"date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date","description":"Date of the transaction or invoice issue date (YYYY-MM-DD)"},"supplier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Supplier","description":"Name of the merchant, hotel, or restaurant"},"total_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total Amount","description":"Total amount paid including tax"},"currency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Currency","description":"Currency of the transaction (e.g., CZK, EUR, USD)"},"breakfast_included":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Breakfast Included","description":"True if breakfast (snídaně) was explicitly included in the price (e.g. hotel room rate includes breakfast)","default":false},"lunch_or_dinner_included":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Lunch Or Dinner Included","description":"True if lunch (oběd) or dinner (večeře) was explicitly included for free","default":false},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary","description":"Brief description of the purchase (e.g., Hotel accommodation, client dinner)"}},"type":"object","title":"ExtractedReceipt"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ItineraryItem":{"properties":{"typ":{"type":"string","title":"Typ"},"datum":{"type":"string","title":"Datum"},"misto":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Misto"},"kam":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kam"},"poznama":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Poznama"},"vzdalenost_km":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Vzdalenost Km","default":0.0},"confirmed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Confirmed"},"transport_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Type"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"},"layover_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layover Type"},"do_zeme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Do Zeme"},"z_zeme":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Z Zeme"}},"type":"object","required":["typ","datum"],"title":"ItineraryItem"},"PDFMetadataOptions":{"properties":{"employee_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Employee Name","description":"Employee or director full name for the PDF header."},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name","description":"Company name for the PDF header."},"company_ico":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Ico","description":"Company identification number (IČO)."},"company_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Address","description":"Registered office address of the company."},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","description":"Language mutation for the PDF ('cs' or 'en').","default":"cs"}},"type":"object","title":"PDFMetadataOptions"},"ParseItineraryRequest":{"properties":{"text":{"type":"string","title":"Text","description":"The natural language text description of the travel route."},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id","description":"The authenticated user's profile ID if logged in."},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model","description":"Specific Gemini model to use for this request."}},"type":"object","required":["text"],"title":"ParseItineraryRequest"},"ParsedItineraryItem":{"properties":{"typ":{"type":"string","title":"Typ","description":"Activity type: 'ODJEZD' (departure), 'PRIJEZD' (arrival), 'HRANICE_PRECHOD' (border crossing out of CZE), 'HRANICE_NAVRAT' (border crossing back into CZE), 'NÁVRAT_ODJEZD' (departure of return trip), or 'KREUZ_NAVRAT' (final arrival home)."},"datum":{"type":"string","title":"Datum","description":"ISO datetime format YYYY-MM-DDTHH:MM"},"misto":{"type":"string","title":"Misto","description":"Name of the city, town, or border location (e.g. 'Praha', 'Mnichov', 'Rozvadov')"},"vzdalenost_km":{"type":"number","title":"Vzdalenost Km","description":"Estimated distance in km for this leg if vehicle is used, otherwise 0.0","default":0.0},"transport_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transport Type","description":"Transportation type used to travel to this location. Must be one of: 'private_vehicle', 'company_car', 'rented_car', 'train', 'bus', 'plane', 'ferry', 'hyperloop', 'rocket', or None."},"layover_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Layover Type","description":"Activity type during layovers/stays. Must be one of: 'office' (office work/HQ), 'bed' (sleeping/hotel/night stay), 'relax' (leisure/coffee/rest), 'beach' (holiday/beach/resort), 'meeting' (client meeting/presentation), or 'default' (standard stay/layover). Set based on text context if mentioned."},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code","description":"The ISO 3-letter country code (e.g. 'CZE', 'SVK', 'AUT', 'DEU', 'FRA', 'ESP', 'CHE', 'GBR', 'USA', 'COL', 'VEN') matching the country of this location. Differentiate duplicate city names (e.g., 'Valencia, Spain' -> 'ESP', 'Valencia, Venezuela' -> 'VEN')."}},"type":"object","required":["typ","datum","misto"],"title":"ParsedItineraryItem"},"ParsedTrip":{"properties":{"ucel_cesty":{"type":"string","title":"Ucel Cesty","description":"Brief summary of the business purpose (e.g. 'Siemens Client Meeting in Munich')"},"typ_vozidla":{"type":"string","title":"Typ Vozidla","description":"Type of vehicle used. MUST be 'OSOBNI' (private vehicle, user's own car) or 'SLUZEBNI' (company car, fleet). Determine from context if mentioned.","default":"SLUZEBNI"},"itinerary":{"items":{"$ref":"#/components/schemas/ParsedItineraryItem"},"type":"array","title":"Itinerary","description":"Chronological list of all legs, crossings, departures, and arrivals of the trip."},"bezplatna_strava":{"anyOf":[{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"},{"type":"null"}],"title":"Bezplatna Strava","description":"A dictionary mapping YYYY-MM-DD dates to a list of free/provided meals on that day (e.g. {'2026-02-02': ['snidane']} if breakfast was provided/included). Use 'snidane' for breakfast, 'obed' for lunch, and 'vecer' for dinner. Determine from the text if any meals are mentioned as provided, free, or included in hotel/stay."},"log_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Log Id","description":"The DB logging ID for this parsing session (set by backend)."},"funny_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Funny Message","description":"Funny fallback warning message if model failover occurred."},"model_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model Used","description":"The model that successfully processed the request."}},"type":"object","required":["ucel_cesty","itinerary"],"title":"ParsedTrip"},"TripInput":{"properties":{"id_cesty":{"type":"string","title":"Id Cesty"},"ucel_cesty":{"type":"string","title":"Ucel Cesty"},"vlastnictvi_vozidla":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vlastnictvi Vozidla","default":"SLUZEBNI"},"zamestnanec_jednatel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zamestnanec Jednatel","default":"UNKNOWN"},"spolecnost":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spolecnost","default":"UNKNOWN"},"bezplatna_strava":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Bezplatna Strava"},"itinerar":{"items":{"$ref":"#/components/schemas/ItineraryItem"},"type":"array","title":"Itinerar"}},"type":"object","required":["id_cesty","ucel_cesty","itinerar"],"title":"TripInput"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","description":"PerDiemo API Key (`pd_live_...`) generated in Settings -> API Keys.","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","description":"Supabase JWT Bearer token (`Authorization: Bearer <token>`) or API Key (`Authorization: Bearer pd_live_...`).","scheme":"bearer"}}},"tags":[{"name":"Calculation Engine","description":"Deterministic statutory travel allowance calculations under the Czech Labor Code (§§ 151–189 ZP) with SHA-256 cryptographic audit signatures."},{"name":"AI Extraction","description":"Natural language itinerary parsing and receipt/ticket OCR powered by Google Gemini AI."},{"name":"Reporting & Exports","description":"Statutory accounting PDF report compilation."},{"name":"Account & Quotas","description":"Subscription tier limits and remaining annual quota inspection."},{"name":"Reference Data","description":"Statutory ISO country codes and localized country name mappings."},{"name":"System","description":"API version and service health status."}]}