Check if a PDF is an invoice
curl --request POST \
--url https://api.partner.cubee.cz/api/v1/invoice-extraction/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileusing RestSharp;
var options = new RestClientOptions("https://api.partner.cubee.cz/api/v1/invoice-extraction/validate");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("Authorization", "Bearer <token>");
request.FormBoundary = "---011000010111000001101001";
request.AddFile("file", "example-file");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.partner.cubee.cz/api/v1/invoice-extraction/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.partner.cubee.cz/api/v1/invoice-extraction/validate"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"fileName": "vyuctovani-elektrina.pdf",
"isEnergyInvoice": true,
"confidence": 0.98,
"supplier": "innogy Energie, s.r.o.",
"energyType": "electricity",
"method": "text"
}InvoiceExtraction
Check if a PDF is an invoice
Cheap pre-flight check: is the uploaded PDF an energy invoice? Runs only the gate (no extraction), so a caller can reject obviously-wrong uploads before paying for a full extraction.
POST
/
api
/
v1
/
invoice-extraction
/
validate
Check if a PDF is an invoice
curl --request POST \
--url https://api.partner.cubee.cz/api/v1/invoice-extraction/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@example-fileusing RestSharp;
var options = new RestClientOptions("https://api.partner.cubee.cz/api/v1/invoice-extraction/validate");
var client = new RestClient(options);
var request = new RestRequest("");
request.AlwaysMultipartFormData = true;
request.AddHeader("Authorization", "Bearer <token>");
request.FormBoundary = "---011000010111000001101001";
request.AddFile("file", "example-file");
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);
const form = new FormData();
form.append('file', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.partner.cubee.cz/api/v1/invoice-extraction/validate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.partner.cubee.cz/api/v1/invoice-extraction/validate"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"fileName": "vyuctovani-elektrina.pdf",
"isEnergyInvoice": true,
"confidence": 0.98,
"supplier": "innogy Energie, s.r.o.",
"energyType": "electricity",
"method": "text"
}Authorizations
Response
OK
Result of the cheap pre-flight check on an uploaded PDF — "is this actually a Czech energy invoice?" — without running the full extraction. Lets a caller (e.g. the eshop) reject obviously-wrong uploads before paying for extraction.
Was this page helpful?