> For the complete documentation index, see [llms.txt](https://typless.gitbook.io/typless-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://typless.gitbook.io/typless-user-guide/sl/api-dokumentacija/api-shema.md).

# API shema

All endpoints have the base URL set to: <https://tapp-api.typless.com>

## Process Invoice

> Process a single invoice document using V1 format. The V1 format is the legacy format and is deprecated.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"ProcessInvoiceRequest":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the invoice file to be processed"},"base64file":{"type":"string","format":"binary","title":"Base64file","description":"File content as base64 encoded string"},"business_unit_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Unit Id","description":"ID of the business unit processing the invoice. If not provided (i.e. when using API key), the invoice will be processed for the processing business unit of that API key."}},"type":"object","required":["file_name","base64file"],"title":"ProcessInvoiceRequest"},"PollKeyWithMessageResponse":{"properties":{"poll_key":{"type":"string","title":"Poll key","description":"ID used for polling."},"message":{"type":"string","title":"Message"}},"type":"object","required":["poll_key","message"],"title":"PollKeyWithMessageResponse"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/process-invoice":{"post":{"summary":"Process Invoice","description":"Process a single invoice document using V1 format. The V1 format is the legacy format and is deprecated.","operationId":"process_invoice_api_v1_process_invoice_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessInvoiceRequest"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollKeyWithMessageResponse"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Process Invoice V2

> Process a single invoice document using V2 format. The V2 format contains more information about the document compared to the V1 format.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"ProcessInvoiceRequest":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the invoice file to be processed"},"base64file":{"type":"string","format":"binary","title":"Base64file","description":"File content as base64 encoded string"},"business_unit_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Unit Id","description":"ID of the business unit processing the invoice. If not provided (i.e. when using API key), the invoice will be processed for the processing business unit of that API key."}},"type":"object","required":["file_name","base64file"],"title":"ProcessInvoiceRequest"},"PollKeyWithMessageResponse":{"properties":{"poll_key":{"type":"string","title":"Poll key","description":"ID used for polling."},"message":{"type":"string","title":"Message"}},"type":"object","required":["poll_key","message"],"title":"PollKeyWithMessageResponse"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v2/process-invoice":{"post":{"summary":"Process Invoice V2","description":"Process a single invoice document using V2 format. The V2 format contains more information about the document compared to the V1 format.","operationId":"process_invoice_v2_api_v2_process_invoice_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessInvoiceRequest"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollKeyWithMessageResponse"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Batch Process Document

> Start processing a batch of documents. Documents should be in a single PDF file and should be split using the Typless stamp.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"BatchProcessDocumentRequest":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the file to be processed"},"file":{"type":"string","format":"binary","title":"File","description":"File content as base64 encoded string"},"file_url":{"type":"string","format":"uri","title":"File Url","description":"URL to download the file"},"business_unit_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Unit Id","description":"ID of the business unit processing the document"}},"type":"object","required":["file_name"],"title":"BatchProcessDocumentRequest"},"PollKeyResponse":{"properties":{"poll_key":{"type":"string","title":"Poll key","description":"ID used for polling."}},"type":"object","required":["poll_key"],"title":"PollKeyResponse"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/batch/process-document":{"post":{"summary":"Batch Process Document","description":"Start processing a batch of documents. Documents should be in a single PDF file and should be split using the Typless stamp.","operationId":"batch_process_document_api_v1_batch_process_document_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchProcessDocumentRequest"}}},"required":true},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollKeyResponse"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Poll Invoice V1

> Poll invoice processing status and get results in V1 format

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"PollInvoiceV1Response":{"type":"object","properties":{"file_name":{"type":"string","description":"Name of the processed file"},"details":{"$ref":"#/components/schemas/InvoiceDetails","description":"Invoice details in V1 format"},"number_of_pages":{"type":"integer","description":"Number of pages in the document (returned when number_of_pages=true)"}},"required":["file_name","details"],"title":"PollInvoiceV1Response"},"InvoiceDetails":{"type":"object","properties":{"iban":{"$ref":"#/components/schemas/V1FieldValue","description":"IBAN field"},"inv_num":{"$ref":"#/components/schemas/V1FieldValue","description":"Invoice number"},"purpose_code":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment purpose code"},"reference":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment reference"},"vat_id_buyer":{"$ref":"#/components/schemas/V1FieldValue","description":"Buyer VAT ID"},"vat_id_publisher":{"$ref":"#/components/schemas/V1FieldValue","description":"Publisher/Supplier VAT ID"},"inv_date":{"$ref":"#/components/schemas/V1FieldValue","description":"Invoice date"},"pay_until":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment due date"},"service_provided_at":{"$ref":"#/components/schemas/V1FieldValue","description":"Service provided date"},"gross":{"$ref":"#/components/schemas/V1FieldValue","description":"Gross/Total amount"},"net":{"$ref":"#/components/schemas/V1FieldValue","description":"Net amount"},"vat":{"$ref":"#/components/schemas/V1FieldValue","description":"VAT amount"},"vat_id_details":{"type":"array","items":{"$ref":"#/components/schemas/VatIdDetail"},"description":"VAT ID details for buyer and supplier"},"vats":{"type":"array","items":{"$ref":"#/components/schemas/VatRateEntry"},"description":"List of VAT rates"},"products":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"List of line items/products"}},"title":"InvoiceDetails"},"V1FieldValue":{"type":"object","properties":{"value":{"type":"string","description":"Field value"},"found":{"type":"boolean","description":"Whether the field was found in the document"},"validated":{"type":"boolean","description":"Whether the field was validated"}},"required":["value","found","validated"],"title":"V1FieldValue"},"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"},"VatRateEntry":{"type":"object","properties":{"gross":{"$ref":"#/components/schemas/V1FieldValue"},"net":{"$ref":"#/components/schemas/V1FieldValue"},"vat":{"allOf":[{"$ref":"#/components/schemas/V1FieldValue"},{"type":"object","properties":{"percentage":{"type":"string","description":"VAT percentage"},"type":{"type":"string","description":"VAT type (base, low, zero)","enum":["base","low","zero"]}},"required":["percentage","type"]}]}},"required":["gross","net","vat"],"title":"VatRateEntry"},"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/poll-invoice":{"get":{"summary":"Poll Invoice V1","description":"Poll invoice processing status and get results in V1 format","operationId":"poll_invoice_v1_api_v1_poll_invoice_get","parameters":[{"name":"inv_key","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Inv Key","description":"Unique identifier for the invoice"}},{"name":"eslog","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Eslog","description":"Whether to return eSlog XML in the response"}},{"name":"number_of_pages","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Number Of Pages","description":"Whether to include the number of pages in the response"}},{"name":"add_candidates","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Add Candidates","description":"Whether to include candidate matches in the response"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollInvoiceV1Response"}},"application/xml":{"schema":{"type":"string","description":"eSlog XML format (returned when eslog=true)"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Poll Invoice V2

> Poll invoice processing status and get results in V2 format with enhanced features

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"PollInvoiceV2Response":{"type":"object","properties":{"file_name":{"type":"string","description":"Name of the processed file"},"details":{"$ref":"#/components/schemas/InvoiceDetailsV2","description":"Invoice details in V2 format with enhanced features"},"number_of_pages":{"type":"integer","description":"Number of pages in the document (returned when number_of_pages=true)"}},"required":["file_name","details"],"title":"PollInvoiceV2Response"},"InvoiceDetailsV2":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Invoice metadata with field names and values"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"List of invoice line items"},"vat_id_details":{"type":"object","properties":{"buyer":{"$ref":"#/components/schemas/VatIdDetail"},"supplier":{"$ref":"#/components/schemas/VatIdDetail"}},"description":"VAT ID details for buyer and supplier"}},"required":["metadata","line_items","vat_id_details"],"title":"InvoiceDetailsV2"},"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"},"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v2/poll-invoice":{"get":{"summary":"Poll Invoice V2","description":"Poll invoice processing status and get results in V2 format with enhanced features","operationId":"poll_invoice_v2_api_v2_poll_invoice_get","parameters":[{"name":"inv_key","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Inv Key","description":"Unique identifier for the invoice"}},{"name":"eslog","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Eslog","description":"Whether to return eSlog XML in the response"}},{"name":"number_of_pages","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Number Of Pages","description":"Whether to include the number of pages in the response"}},{"name":"add_candidates","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Add Candidates","description":"Whether to include candidate matches in the response"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollInvoiceV2Response"}},"application/xml":{"schema":{"type":"string","description":"eSlog XML format (returned when eslog=true)"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Poll Invoice Blocks

> Get text blocks from a processed invoice

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"PollInvoiceBlocksResponse":{"type":"object","properties":{"file_name":{"type":"string","description":"Name of the processed file"},"details":{"type":"object","additionalProperties":true,"description":"Invoice details with blocks instead of simple values. Each field has 'found', 'validated', and 'blocks' properties."}},"required":["file_name","details"],"title":"PollInvoiceBlocksResponse"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/poll-invoice/blocks":{"get":{"summary":"Poll Invoice Blocks","description":"Get text blocks from a processed invoice","operationId":"poll_invoice_blocks_api_v1_poll_invoice_blocks_get","parameters":[{"name":"inv_key","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Inv Key","description":"Unique identifier for the invoice"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PollInvoiceBlocksResponse"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## GET /api/v1/invoice/text-blocks

> Invoice Text Blocks

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"InvoiceTextBlocksResponse":{"properties":{"text_blocks":{"items":{"$ref":"#/components/schemas/V1TextBlock"},"type":"array","title":"Text Blocks","description":"List of extracted text blocks"},"id":{"type":"string","format":"uuid","title":"Id","description":"Unique identifier for the text blocks"},"page_number":{"type":"integer","title":"Page Number","description":"Page number of the extracted text blocks"}},"type":"object","required":["text_blocks","id","page_number"],"title":"InvoiceTextBlocksResponse"},"V1TextBlock":{"type":"object","properties":{"num":{"type":"integer","description":"Text block number"},"original_coordinates":{"$ref":"#/components/schemas/Coordinates","description":"Original coordinates of the text block"},"text":{"type":"string","description":"Text content of the block"},"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"},"width":{"type":"number","description":"Width"},"height":{"type":"number","description":"Height"},"page_number":{"type":"integer","description":"Page number"},"doc_height":{"type":"number","description":"Document height"},"doc_width":{"type":"number","description":"Document width"}},"required":["num","original_coordinates","text","x","y","width","height","page_number","doc_height","doc_width"],"title":"V1TextBlock"},"Coordinates":{"type":"object","properties":{"height":{"type":"number","description":"Height of the text block"},"width":{"type":"number","description":"Width of the text block"},"x":{"type":"number","description":"X coordinate of the text block"},"y":{"type":"number","description":"Y coordinate of the text block"}},"required":["height","width","x","y"],"title":"Coordinates"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/invoice/text-blocks":{"get":{"summary":"Invoice Text Blocks","operationId":"invoice_text_blocks_api_v1_invoice_text_blocks_get","parameters":[{"name":"inv_key","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Inv Key","description":"Unique identifier for the invoice"}},{"name":"page_number","in":"query","required":true,"schema":{"type":"integer","maximum":100,"exclusiveMinimum":0,"title":"Page Number","description":"Page number of the invoice to retrieve text blocks from"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceTextBlocksResponse"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Batch Poll Document

> Check the status of a batch document processing job and get the extracted data for all invoices in the batch when processing is complete.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"BatchPollDocumentQueryResult":{"properties":{"status":{"$ref":"#/components/schemas/BatchTaskStatus","description":"Current status of the batch processing task"},"results":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceInBatchDetailsDto"},"type":"array"},{"type":"null"}],"title":"Results","description":"List of processed invoice details"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if processing failed"}},"type":"object","required":["status"],"title":"BatchPollDocumentQueryResult"},"BatchTaskStatus":{"type":"string","enum":["IN_PROGRESS","ERROR","SUCCESS"],"title":"BatchTaskStatus","description":"Status of a batch processing task"},"InvoiceInBatchDetailsDto":{"properties":{"extraction_id":{"type":"string","format":"uuid","title":"Extraction Id","description":"Unique identifier for the extraction"},"results":{"type":"object","title":"Results","description":"Extracted invoice details"}},"type":"object","required":["extraction_id","results"],"title":"InvoiceInBatchDetailsDto"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/batch/poll-document":{"get":{"summary":"Batch Poll Document","description":"Check the status of a batch document processing job and get the extracted data for all invoices in the batch when processing is complete.","operationId":"batch_poll_document_api_v1_batch_poll_document_get","parameters":[{"name":"poll_key","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Poll Key","description":"Unique identifier for the batch processing job"}}],"responses":{"200":{"description":"Successful Response - Processing complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPollDocumentQueryResult"}}}},"202":{"description":"Processing in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchPollDocumentQueryResult"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Batch Upload Url

> Get a pre-signed URL for uploading a batch of documents. The uploaded documents are in a single PDF file and are split using the Typless stamp.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"BatchUploadUrlDto":{"properties":{"url":{"type":"string","title":"Url","description":"Pre-signed URL for uploading the file"},"poll_key":{"type":"string","format":"uuid","title":"Poll Key","description":"Unique identifier for tracking the upload"}},"type":"object","required":["url","x-amz-tagging","poll_key"],"title":"BatchUploadUrlDto"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/batch/upload-url":{"post":{"summary":"Batch Upload Url","description":"Get a pre-signed URL for uploading a batch of documents. The uploaded documents are in a single PDF file and are split using the Typless stamp.","operationId":"batch_upload_url_api_v1_batch_upload_url_post","parameters":[{"name":"file_name","in":"query","required":true,"schema":{"type":"string","title":"File Name","description":"Name of the file to be uploaded"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchUploadUrlDto"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Batch Download Url

> Get download URLs for split batch documents.

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"servers":[{"url":"https://tapp-api.typless.com","description":"Production server"}],"security":[{"apiKeyAuth":[]}],"components":{"securitySchemes":{"apiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key","description":"API key authentication"}},"schemas":{"BatchDownloadUrlDto":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the processed file"},"status":{"$ref":"#/components/schemas/BatchTaskStatus","description":"Current status of the batch processing task"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if processing failed"},"documents_in_file":{"anyOf":[{"items":{"$ref":"#/components/schemas/DocumentInFileDto"},"type":"array"},{"type":"null"}],"title":"Documents In File","description":"List of documents found in the processed file"}},"type":"object","required":["file_name","status"],"title":"BatchDownloadUrlDto"},"BatchTaskStatus":{"type":"string","enum":["IN_PROGRESS","ERROR","SUCCESS"],"title":"BatchTaskStatus","description":"Status of a batch processing task"},"DocumentInFileDto":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the document file"},"url":{"type":"string","title":"Url","description":"URL to download the document"}},"type":"object","required":["file_name","url"],"title":"DocumentInFileDto"},"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}},"paths":{"/api/v1/batch/download-urls":{"get":{"summary":"Batch Download Url","description":"Get download URLs for split batch documents.","operationId":"batch_download_url_api_v1_batch_download_urls_get","parameters":[{"name":"poll_key","in":"query","required":true,"schema":{"type":"string","format":"uuid","title":"Poll Key","description":"Unique identifier for the batch processing job"}}],"responses":{"200":{"description":"Successful Response - Processing complete","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDownloadUrlDto"}}}},"202":{"description":"Processing in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDownloadUrlDto"}}}},"400":{"description":"Bad request response. Check your input data.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden. Check the URL and your authentication token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## The BatchDownloadUrlDto object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"BatchDownloadUrlDto":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the processed file"},"status":{"$ref":"#/components/schemas/BatchTaskStatus","description":"Current status of the batch processing task"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if processing failed"},"documents_in_file":{"anyOf":[{"items":{"$ref":"#/components/schemas/DocumentInFileDto"},"type":"array"},{"type":"null"}],"title":"Documents In File","description":"List of documents found in the processed file"}},"type":"object","required":["file_name","status"],"title":"BatchDownloadUrlDto"},"BatchTaskStatus":{"type":"string","enum":["IN_PROGRESS","ERROR","SUCCESS"],"title":"BatchTaskStatus","description":"Status of a batch processing task"},"DocumentInFileDto":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the document file"},"url":{"type":"string","title":"Url","description":"URL to download the document"}},"type":"object","required":["file_name","url"],"title":"DocumentInFileDto"}}}}
```

## The BatchPollDocumentQueryResult object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"BatchPollDocumentQueryResult":{"properties":{"status":{"$ref":"#/components/schemas/BatchTaskStatus","description":"Current status of the batch processing task"},"results":{"anyOf":[{"items":{"$ref":"#/components/schemas/InvoiceInBatchDetailsDto"},"type":"array"},{"type":"null"}],"title":"Results","description":"List of processed invoice details"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error","description":"Error message if processing failed"}},"type":"object","required":["status"],"title":"BatchPollDocumentQueryResult"},"BatchTaskStatus":{"type":"string","enum":["IN_PROGRESS","ERROR","SUCCESS"],"title":"BatchTaskStatus","description":"Status of a batch processing task"},"InvoiceInBatchDetailsDto":{"properties":{"extraction_id":{"type":"string","format":"uuid","title":"Extraction Id","description":"Unique identifier for the extraction"},"results":{"type":"object","title":"Results","description":"Extracted invoice details"}},"type":"object","required":["extraction_id","results"],"title":"InvoiceInBatchDetailsDto"}}}}
```

## The BatchProcessDocumentRequest object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"BatchProcessDocumentRequest":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the file to be processed"},"file":{"type":"string","format":"binary","title":"File","description":"File content as base64 encoded string"},"file_url":{"type":"string","format":"uri","title":"File Url","description":"URL to download the file"},"business_unit_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Unit Id","description":"ID of the business unit processing the document"}},"type":"object","required":["file_name"],"title":"BatchProcessDocumentRequest"}}}}
```

## The BatchTaskStatus object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"BatchTaskStatus":{"type":"string","enum":["IN_PROGRESS","ERROR","SUCCESS"],"title":"BatchTaskStatus","description":"Status of a batch processing task"}}}}
```

## The BatchUploadUrlDto object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"BatchUploadUrlDto":{"properties":{"url":{"type":"string","title":"Url","description":"Pre-signed URL for uploading the file"},"poll_key":{"type":"string","format":"uuid","title":"Poll Key","description":"Unique identifier for tracking the upload"}},"type":"object","required":["url","x-amz-tagging","poll_key"],"title":"BatchUploadUrlDto"}}}}
```

## The Block object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"Block":{"properties":{"height":{"type":"integer","title":"Height","description":"Height of the text block in pixels","default":-1},"page":{"type":"string","title":"Page","description":"Page number where the block is located","default":"0"},"value":{"type":"string","title":"Value","description":"Text content of the block"},"width":{"type":"integer","title":"Width","description":"Width of the text block in pixels","default":-1},"x":{"type":"integer","title":"X","description":"X coordinate of the block's top-left corner","default":-1},"y":{"type":"integer","title":"Y","description":"Y coordinate of the block's top-left corner","default":-1}},"type":"object","required":["value"],"title":"Block"}}}}
```

## The BlockField object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"BlockField":{"properties":{"blocks":{"items":{"$ref":"#/components/schemas/Block"},"type":"array","title":"Blocks","description":"List of text blocks for this field"},"found":{"type":"boolean","title":"Found","description":"Whether the field was found in the document"},"validated":{"type":"boolean","title":"Validated","description":"Whether the field value has been validated"}},"type":"object","required":["blocks","found","validated"],"title":"BlockField"},"Block":{"properties":{"height":{"type":"integer","title":"Height","description":"Height of the text block in pixels","default":-1},"page":{"type":"string","title":"Page","description":"Page number where the block is located","default":"0"},"value":{"type":"string","title":"Value","description":"Text content of the block"},"width":{"type":"integer","title":"Width","description":"Width of the text block in pixels","default":-1},"x":{"type":"integer","title":"X","description":"X coordinate of the block's top-left corner","default":-1},"y":{"type":"integer","title":"Y","description":"Y coordinate of the block's top-left corner","default":-1}},"type":"object","required":["value"],"title":"Block"}}}}
```

## The Coordinates object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"Coordinates":{"type":"object","properties":{"height":{"type":"number","description":"Height of the text block"},"width":{"type":"number","description":"Width of the text block"},"x":{"type":"number","description":"X coordinate of the text block"},"y":{"type":"number","description":"Y coordinate of the text block"}},"required":["height","width","x","y"],"title":"Coordinates"}}}}
```

## The DocumentInFileDto object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"DocumentInFileDto":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the document file"},"url":{"type":"string","title":"Url","description":"URL to download the document"}},"type":"object","required":["file_name","url"],"title":"DocumentInFileDto"}}}}
```

## The InvoiceDetails object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"InvoiceDetails":{"type":"object","properties":{"iban":{"$ref":"#/components/schemas/V1FieldValue","description":"IBAN field"},"inv_num":{"$ref":"#/components/schemas/V1FieldValue","description":"Invoice number"},"purpose_code":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment purpose code"},"reference":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment reference"},"vat_id_buyer":{"$ref":"#/components/schemas/V1FieldValue","description":"Buyer VAT ID"},"vat_id_publisher":{"$ref":"#/components/schemas/V1FieldValue","description":"Publisher/Supplier VAT ID"},"inv_date":{"$ref":"#/components/schemas/V1FieldValue","description":"Invoice date"},"pay_until":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment due date"},"service_provided_at":{"$ref":"#/components/schemas/V1FieldValue","description":"Service provided date"},"gross":{"$ref":"#/components/schemas/V1FieldValue","description":"Gross/Total amount"},"net":{"$ref":"#/components/schemas/V1FieldValue","description":"Net amount"},"vat":{"$ref":"#/components/schemas/V1FieldValue","description":"VAT amount"},"vat_id_details":{"type":"array","items":{"$ref":"#/components/schemas/VatIdDetail"},"description":"VAT ID details for buyer and supplier"},"vats":{"type":"array","items":{"$ref":"#/components/schemas/VatRateEntry"},"description":"List of VAT rates"},"products":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"List of line items/products"}},"title":"InvoiceDetails"},"V1FieldValue":{"type":"object","properties":{"value":{"type":"string","description":"Field value"},"found":{"type":"boolean","description":"Whether the field was found in the document"},"validated":{"type":"boolean","description":"Whether the field was validated"}},"required":["value","found","validated"],"title":"V1FieldValue"},"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"},"VatRateEntry":{"type":"object","properties":{"gross":{"$ref":"#/components/schemas/V1FieldValue"},"net":{"$ref":"#/components/schemas/V1FieldValue"},"vat":{"allOf":[{"$ref":"#/components/schemas/V1FieldValue"},{"type":"object","properties":{"percentage":{"type":"string","description":"VAT percentage"},"type":{"type":"string","description":"VAT type (base, low, zero)","enum":["base","low","zero"]}},"required":["percentage","type"]}]}},"required":["gross","net","vat"],"title":"VatRateEntry"},"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"}}}}
```

## The InvoiceTextBlocksResponse object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"InvoiceTextBlocksResponse":{"properties":{"text_blocks":{"items":{"$ref":"#/components/schemas/V1TextBlock"},"type":"array","title":"Text Blocks","description":"List of extracted text blocks"},"id":{"type":"string","format":"uuid","title":"Id","description":"Unique identifier for the text blocks"},"page_number":{"type":"integer","title":"Page Number","description":"Page number of the extracted text blocks"}},"type":"object","required":["text_blocks","id","page_number"],"title":"InvoiceTextBlocksResponse"},"V1TextBlock":{"type":"object","properties":{"num":{"type":"integer","description":"Text block number"},"original_coordinates":{"$ref":"#/components/schemas/Coordinates","description":"Original coordinates of the text block"},"text":{"type":"string","description":"Text content of the block"},"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"},"width":{"type":"number","description":"Width"},"height":{"type":"number","description":"Height"},"page_number":{"type":"integer","description":"Page number"},"doc_height":{"type":"number","description":"Document height"},"doc_width":{"type":"number","description":"Document width"}},"required":["num","original_coordinates","text","x","y","width","height","page_number","doc_height","doc_width"],"title":"V1TextBlock"},"Coordinates":{"type":"object","properties":{"height":{"type":"number","description":"Height of the text block"},"width":{"type":"number","description":"Width of the text block"},"x":{"type":"number","description":"X coordinate of the text block"},"y":{"type":"number","description":"Y coordinate of the text block"}},"required":["height","width","x","y"],"title":"Coordinates"}}}}
```

## The InvoiceInBatchDetailsDto object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"InvoiceInBatchDetailsDto":{"properties":{"extraction_id":{"type":"string","format":"uuid","title":"Extraction Id","description":"Unique identifier for the extraction"},"results":{"type":"object","title":"Results","description":"Extracted invoice details"}},"type":"object","required":["extraction_id","results"],"title":"InvoiceInBatchDetailsDto"}}}}
```

## The PollInvoiceBlocksResponse object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"PollInvoiceBlocksResponse":{"type":"object","properties":{"file_name":{"type":"string","description":"Name of the processed file"},"details":{"type":"object","additionalProperties":true,"description":"Invoice details with blocks instead of simple values. Each field has 'found', 'validated', and 'blocks' properties."}},"required":["file_name","details"],"title":"PollInvoiceBlocksResponse"}}}}
```

## The V1TextBlock object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"V1TextBlock":{"type":"object","properties":{"num":{"type":"integer","description":"Text block number"},"original_coordinates":{"$ref":"#/components/schemas/Coordinates","description":"Original coordinates of the text block"},"text":{"type":"string","description":"Text content of the block"},"x":{"type":"number","description":"X coordinate"},"y":{"type":"number","description":"Y coordinate"},"width":{"type":"number","description":"Width"},"height":{"type":"number","description":"Height"},"page_number":{"type":"integer","description":"Page number"},"doc_height":{"type":"number","description":"Document height"},"doc_width":{"type":"number","description":"Document width"}},"required":["num","original_coordinates","text","x","y","width","height","page_number","doc_height","doc_width"],"title":"V1TextBlock"},"Coordinates":{"type":"object","properties":{"height":{"type":"number","description":"Height of the text block"},"width":{"type":"number","description":"Width of the text block"},"x":{"type":"number","description":"X coordinate of the text block"},"y":{"type":"number","description":"Y coordinate of the text block"}},"required":["height","width","x","y"],"title":"Coordinates"}}}}
```

## The VatDetailBlockField object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"VatDetailBlockField":{"properties":{"blocks":{"items":{"$ref":"#/components/schemas/Block"},"type":"array","title":"Blocks","description":"List of text blocks for this VAT detail"},"found":{"type":"boolean","title":"Found","description":"Whether the VAT detail was found"},"validated":{"type":"boolean","title":"Validated","description":"Whether the VAT detail has been validated"},"percentage":{"type":"string","title":"Percentage","description":"VAT percentage rate"},"type":{"type":"string","title":"Type","description":"Type of VAT"}},"type":"object","required":["blocks","found","validated","percentage","type"],"title":"VatDetailBlockField"},"Block":{"properties":{"height":{"type":"integer","title":"Height","description":"Height of the text block in pixels","default":-1},"page":{"type":"string","title":"Page","description":"Page number where the block is located","default":"0"},"value":{"type":"string","title":"Value","description":"Text content of the block"},"width":{"type":"integer","title":"Width","description":"Width of the text block in pixels","default":-1},"x":{"type":"integer","title":"X","description":"X coordinate of the block's top-left corner","default":-1},"y":{"type":"integer","title":"Y","description":"Y coordinate of the block's top-left corner","default":-1}},"type":"object","required":["value"],"title":"Block"}}}}
```

## The VatIdDetail object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"}}}}
```

## The VatRateEntry object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"VatRateEntry":{"type":"object","properties":{"gross":{"$ref":"#/components/schemas/V1FieldValue"},"net":{"$ref":"#/components/schemas/V1FieldValue"},"vat":{"allOf":[{"$ref":"#/components/schemas/V1FieldValue"},{"type":"object","properties":{"percentage":{"type":"string","description":"VAT percentage"},"type":{"type":"string","description":"VAT type (base, low, zero)","enum":["base","low","zero"]}},"required":["percentage","type"]}]}},"required":["gross","net","vat"],"title":"VatRateEntry"},"V1FieldValue":{"type":"object","properties":{"value":{"type":"string","description":"Field value"},"found":{"type":"boolean","description":"Whether the field was found in the document"},"validated":{"type":"boolean","description":"Whether the field was validated"}},"required":["value","found","validated"],"title":"V1FieldValue"}}}}
```

## The ErrorResponse object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"ErrorResponse":{"properties":{"details":{"items":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"object"}]},"type":"array","title":"Details","description":"Detailed error information"},"code":{"type":"string","title":"Exception code","description":"Error code indicating the type of error"},"message":{"type":"string","title":"Message","description":"Human-readable error message"}},"type":"object","required":["details","code","message"],"title":"ErrorResponse"}}}}
```

## The PollInvoiceV1Response object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"PollInvoiceV1Response":{"type":"object","properties":{"file_name":{"type":"string","description":"Name of the processed file"},"details":{"$ref":"#/components/schemas/InvoiceDetails","description":"Invoice details in V1 format"},"number_of_pages":{"type":"integer","description":"Number of pages in the document (returned when number_of_pages=true)"}},"required":["file_name","details"],"title":"PollInvoiceV1Response"},"InvoiceDetails":{"type":"object","properties":{"iban":{"$ref":"#/components/schemas/V1FieldValue","description":"IBAN field"},"inv_num":{"$ref":"#/components/schemas/V1FieldValue","description":"Invoice number"},"purpose_code":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment purpose code"},"reference":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment reference"},"vat_id_buyer":{"$ref":"#/components/schemas/V1FieldValue","description":"Buyer VAT ID"},"vat_id_publisher":{"$ref":"#/components/schemas/V1FieldValue","description":"Publisher/Supplier VAT ID"},"inv_date":{"$ref":"#/components/schemas/V1FieldValue","description":"Invoice date"},"pay_until":{"$ref":"#/components/schemas/V1FieldValue","description":"Payment due date"},"service_provided_at":{"$ref":"#/components/schemas/V1FieldValue","description":"Service provided date"},"gross":{"$ref":"#/components/schemas/V1FieldValue","description":"Gross/Total amount"},"net":{"$ref":"#/components/schemas/V1FieldValue","description":"Net amount"},"vat":{"$ref":"#/components/schemas/V1FieldValue","description":"VAT amount"},"vat_id_details":{"type":"array","items":{"$ref":"#/components/schemas/VatIdDetail"},"description":"VAT ID details for buyer and supplier"},"vats":{"type":"array","items":{"$ref":"#/components/schemas/VatRateEntry"},"description":"List of VAT rates"},"products":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"List of line items/products"}},"title":"InvoiceDetails"},"V1FieldValue":{"type":"object","properties":{"value":{"type":"string","description":"Field value"},"found":{"type":"boolean","description":"Whether the field was found in the document"},"validated":{"type":"boolean","description":"Whether the field was validated"}},"required":["value","found","validated"],"title":"V1FieldValue"},"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"},"VatRateEntry":{"type":"object","properties":{"gross":{"$ref":"#/components/schemas/V1FieldValue"},"net":{"$ref":"#/components/schemas/V1FieldValue"},"vat":{"allOf":[{"$ref":"#/components/schemas/V1FieldValue"},{"type":"object","properties":{"percentage":{"type":"string","description":"VAT percentage"},"type":{"type":"string","description":"VAT type (base, low, zero)","enum":["base","low","zero"]}},"required":["percentage","type"]}]}},"required":["gross","net","vat"],"title":"VatRateEntry"},"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"}}}}
```

## The InvoiceDetailsV2 object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"InvoiceDetailsV2":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Invoice metadata with field names and values"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"List of invoice line items"},"vat_id_details":{"type":"object","properties":{"buyer":{"$ref":"#/components/schemas/VatIdDetail"},"supplier":{"$ref":"#/components/schemas/VatIdDetail"}},"description":"VAT ID details for buyer and supplier"}},"required":["metadata","line_items","vat_id_details"],"title":"InvoiceDetailsV2"},"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"},"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"}}}}
```

## The PollInvoiceV2Response object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"PollInvoiceV2Response":{"type":"object","properties":{"file_name":{"type":"string","description":"Name of the processed file"},"details":{"$ref":"#/components/schemas/InvoiceDetailsV2","description":"Invoice details in V2 format with enhanced features"},"number_of_pages":{"type":"integer","description":"Number of pages in the document (returned when number_of_pages=true)"}},"required":["file_name","details"],"title":"PollInvoiceV2Response"},"InvoiceDetailsV2":{"type":"object","properties":{"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Invoice metadata with field names and values"},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"},"description":"List of invoice line items"},"vat_id_details":{"type":"object","properties":{"buyer":{"$ref":"#/components/schemas/VatIdDetail"},"supplier":{"$ref":"#/components/schemas/VatIdDetail"}},"description":"VAT ID details for buyer and supplier"}},"required":["metadata","line_items","vat_id_details"],"title":"InvoiceDetailsV2"},"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"},"VatIdDetail":{"properties":{"address":{"type":"string","title":"Address","description":"Registered address","default":""},"capital":{"type":"string","title":"Capital","description":"Registered capital","default":"0"},"country":{"type":"string","title":"Country","description":"Country code"},"date_reg":{"type":"string","title":"Date Reg","description":"Registration date","default":""},"iban":{"items":{"type":"string"},"type":"array","title":"Iban","description":"List of IBAN numbers"},"mat_id":{"type":"string","title":"Mat Id","description":"Material ID","default":""},"name":{"type":"string","title":"Name","description":"Company name"},"name_long":{"type":"string","title":"Name Long","description":"Full company name","default":""},"post":{"type":"string","title":"Post","description":"Postal code","default":""},"vat_id":{"type":"string","title":"Vat Id","description":"VAT identification number"}},"type":"object","required":["country","name","vat_id"],"title":"VatIdDetail"}}}}
```

## The LineItem object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"LineItem":{"type":"object","properties":{"text":{"type":"string","description":"Line item description"},"ident":{"type":"string","description":"Line item identifier"},"value":{"type":"string","description":"Value amount"},"price":{"type":"string","description":"Unit price"},"quantity":{"type":"string","description":"Quantity"},"discount":{"type":"string","description":"Discount amount"},"gross":{"type":"string","description":"Gross amount"},"net":{"type":"string","description":"Net amount"},"vat":{"type":"string","description":"VAT amount"},"unit":{"type":"string","description":"Unit of measure"},"vat_percentage":{"type":"string","description":"VAT percentage"},"discount_percentage":{"type":"string","description":"Discount percentage"},"id":{"type":"integer","description":"Line item ID"}},"title":"LineItem"}}}}
```

## The V1FieldValue object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"V1FieldValue":{"type":"object","properties":{"value":{"type":"string","description":"Field value"},"found":{"type":"boolean","description":"Whether the field was found in the document"},"validated":{"type":"boolean","description":"Whether the field was validated"}},"required":["value","found","validated"],"title":"V1FieldValue"}}}}
```

## The PollKeyWithMessageResponse object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"PollKeyWithMessageResponse":{"properties":{"poll_key":{"type":"string","title":"Poll key","description":"ID used for polling."},"message":{"type":"string","title":"Message"}},"type":"object","required":["poll_key","message"],"title":"PollKeyWithMessageResponse"}}}}
```

## The PollKeyResponse object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"PollKeyResponse":{"properties":{"poll_key":{"type":"string","title":"Poll key","description":"ID used for polling."}},"type":"object","required":["poll_key"],"title":"PollKeyResponse"}}}}
```

## The ProcessInvoiceRequest object

```json
{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"components":{"schemas":{"ProcessInvoiceRequest":{"properties":{"file_name":{"type":"string","title":"File Name","description":"Name of the invoice file to be processed"},"base64file":{"type":"string","format":"binary","title":"Base64file","description":"File content as base64 encoded string"},"business_unit_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Business Unit Id","description":"ID of the business unit processing the invoice. If not provided (i.e. when using API key), the invoice will be processed for the processing business unit of that API key."}},"type":"object","required":["file_name","base64file"],"title":"ProcessInvoiceRequest"}}}}
```
