> This documentation belongs to Invofox, an AI-powered document processing
> platform. The API extracts structured data (fields) from unstructured
> documents (invoices, contracts, forms, bank statements, and more).
> Key concepts: Account, Environment, Document Type, Field, File, Import,
> and Document. When answering, prefer the exact terminology defined in the
> Glossary and cite the relevant API Reference endpoint when applicable.

# Get document info

GET https://api.invofox.com/documents/{id}

Reference: https://developers.invofox.com/api-reference/main-reference/documents/get-document-info

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `id` (string, required) — id of the document to retrieve

## Response

### 200

Get documento info

- `_id` (string, optional)
- `account` (string, optional) — Account the document belongs to.
- `environment` (string, optional) — Environment the document belongs to.
- `company` (string, optional) — Company the document belongs to.
- `creator` (string, optional) — User that uploaded the document
- `clientData` (DocumentClientData, optional) — "Additional data to be added to each document. Must be an object or an array of objects. If data to be specified to each document is different, this parameter should have the following format: `[ \{ _filename: \<name of the file to which attach this data>, <key>: <value> }, ... \{ _filename: \<name of the file to which attach this data>, <key>: <value> } ]`."
- `type` (enum, optional)
  - Allowed values: `invoice`, `deliveryNote`, `promissoryNote`, `ticket`, `supplyInvoice`
- `name` (string, optional) — Original name of the uploaded file
- `isGroundTruth` (boolean, optional) — Indicates the document is marked as Ground Truth (GT)
- `creation` (string, optional) — Upload timestamp
- `images` (list of string, optional) — Array of Azure Storage URLs (SAS) to access the document extracted images
- `original` (string, optional) — Azure Storage URL (SAS) to access the original file
- `mimetype` (string, optional)
- `data` (map from string to any, optional) — Extracted document data. Structure varies by document type.
- `publicState` (enum, optional, default: processing)
  - Allowed values: `processing`, `pendingCorrection`, `discarded`, `approved`, `exported`, `error`
- `confidence` (enum, optional)
  - Allowed values: `high`, `medium`, `low`
- `processInfo` (DocumentProcessInfo, optional)
- `validationInfo` (DocumentValidationInfo, optional)
- `approvalInfo` (DocumentApprovalInfo, optional)
- `import` (DocumentImport, optional)
- `exports` (list of DocumentExportsItems, optional)
- `geometry` (DocumentGeometry, optional)
- `deleted` (boolean, optional) — Indicates whether the document has been logically deleted
- `duplicated` (boolean, optional, deprecated)

## Errors

### 400 Bad Request Error

Missing some or all parameters

- `code` (string, optional)
- `additionalInfo` (ErrMissingParamsAdditionalInfo, optional)

### 410 Gone Error

The document has expired and is no longer accessible or modifiable

- `code` (string, optional)

### 429 Too Many Requests Error

Too many requests were sent to the server in a short period of time. The response contains headers conforming to the [ratelimit standardization draft adopted by the IETF](https://github.com/ietf-wg-httpapi/ratelimit-headers/blob/main/draft-ietf-httpapi-ratelimit-headers.md/) * RateLimit-Limit - Limit of requests per window * RateLimit-Remaining - Remaining requests for current window * RateLimit-Reset - Seconds until window resets * Retry-After - Seconds caller should wait before retrying

- `code` (string, optional)

### 500 Internal Server Error

Unkown server error

- `code` (string, optional)

## Types

### DocumentClientData

"Additional data to be added to each document. Must be an object or an array of objects. If data to be specified to each document is different, this parameter should have the following format: `[ \{ _filename: \<name of the file to which attach this data>, <key>: <value> }, ... \{ _filename: \<name of the file to which attach this data>, <key>: <value> } ]`."

### DocumentProcessInfo

- `result` (enum, optional)
  - Allowed values: `verified`, `not verified`, `discarded`

### DocumentValidationInfo

- `errors` (list of Error, optional) — Array of validation errors
- `result` (enum, optional)
  - Allowed values: `valid`, `discarded`
- `comments` (string, optional) — Comments added by the validator user (if any)
- `validator` (string, optional) — The user that added the validation (if any)

### DocumentApprovalInfo

- `beginning` (string, optional)
- `result` (enum, optional)
  - Allowed values: `approved`, `processing`
- `comments` (string, optional)
- `appliedWorkflow` (DocumentApprovalInfoAppliedWorkflow, optional)
- `steps` (list of DocumentApprovalInfoStepsItems, optional)

### DocumentImport

- `ref` (string, optional)
- `channel` (string, optional)
- `info` (DocumentImportInfo, optional)

### DocumentExportsItems

- `timestamp` (string, optional)
- `ref` (string, optional)
- `summary` (list of DocumentExportsItemsSummaryItems, optional)

### DocumentGeometry

- `pages` (list of DocumentGeometryPagesItems, optional)
- `boxes` (DocumentGeometryBoxes, optional) — "Keys replicate structure of field `data` whereas values are objects of the form \ \{ \ page: number, \ box: array(number) \ } \ where \ `page` is the index of the page where the box is located. \ `box` has 8 coordinates representing the vertices of the box \ \[p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y] \ "

### ErrMissingParamsAdditionalInfo

- `param` (string, optional) — Name of missing parameter, if there is only one
- `params` (list of string, optional) — Names of missing parameters, if there are several

### Error

- `severity` (enum, optional) — Error severity
  - Allowed values: `high`, `medium`, `low`
- `code` (enum, optional) — Descriptive error code * `ERR_FILE_TOO_BIG` - The uploaded file is too big (max 50 MB) * `ERR_TOO_MANY_PAGES` - Document has too many pages (max. 10) * `ERR_UNSUPPORTED_FILE_FORMAT` - Document's format not supported * `ERR_EMPTY_VALUE` - No value extracted * `ERR_INVALID_FORMAT` - Extracted value has an invalid format * `ERR_LOW_CONFIDENCE` - Extracted value has low confidence * `ERR_HANDWRITTEN_DOC` - Document is handwritten * `ERR_INVALID_DOC_TYPE` - Document type is unknown (not invoice, ticket, etc) * `ERR_CROPPED_DOC` - Document is cropped hence has missing information * `ERR_MULTI_DOC_PAGE_FOUND` - File contains multiple documents * `ERR_PAGES_MISSING` - Document has missing pages hence is incomplete * `ERR_DUPLICATED_DOCUMENT` - Document is duplicated * `ERR_MISSING_INFO` - Document is missing required information * `ERR_BAD_QUALITY` - Document has bad quality * `ERR_OTHER` - Generic error
  - Allowed values: `ERR_FILE_TOO_BIG`, `ERR_TOO_MANY_PAGES`, `ERR_UNSUPPORTED_FILE_FORMAT`, `ERR_EMPTY_VALUE`, `ERR_INVALID_FORMAT`, `ERR_LOW_CONFIDENCE`, `ERR_HANDWRITTEN_DOC`, `ERR_INVALID_DOC_TYPE`, `ERR_CROPPED_DOC`, `ERR_MULTI_DOC_PAGE_FOUND`, `ERR_PAGES_MISSING`, `ERR_BAD_QUALITY`, `ERR_OTHER`
- `timestamp` (string, optional) — Timestamp when the error happened
- `user` (string, optional) — User that reported the error (if any)
- `info` (ErrorInfo, optional) — Additional information related to the error (if any)
- `fields` (list of ErrorFieldsItems, optional) — document data fields related to the error (if any)

### DocumentApprovalInfoAppliedWorkflow

### DocumentApprovalInfoStepsItems

- `date` (string, optional)
- `type` (string, optional)
- `info` (DocumentApprovalInfoStepsItemsInfo, optional)

### DocumentImportInfo

### DocumentExportsItemsSummaryItems

### DocumentGeometryPagesItems

- `width` (double, optional) — Page width in units
- `height` (double, optional) — Page height in units
- `unit` (enum, optional) — Unit measure of width and height
  - Allowed values: `inch`, `pixel`
- `angle` (double, optional) — Rotation of the page

### DocumentGeometryBoxes

"Keys replicate structure of field `data` whereas values are objects of the form \ \{ \ page: number, \ box: array(number) \ } \ where \ `page` is the index of the page where the box is located. \ `box` has 8 coordinates representing the vertices of the box \ \[p1x, p1y, p2x, p2y, p3x, p3y, p4x, p4y] \ "

### ErrorInfo

Additional information related to the error (if any)

### ErrorFieldsItems

- `name` (string, optional) — field name
- `prefix` (string, optional) — If the field is an array, the key of the array in data
- `index` (double, optional) — If the field belongs to an array, the index in the array
- `groupIndex` (double, optional) — If the field is an additional data, the first index in data.additionalData array
- `splitIndex` (double, optional) — If the field is an additional data, the second index in data.additionalData array

### DocumentApprovalInfoStepsItemsInfo

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "_id": "52543ec6d13ac7000bb90823",
  "company": "54aadbb7e79e2aba5d25f3e3",
  "clientData": {},
  "type": "invoice",
  "name": "Invoice_INVCZ4761199.pdf",
  "isGroundTruth": false,
  "creation": "2022-04-11T14:44:22.785Z",
  "images": [
    "https://kinequo.blob.core.windows.net/midas/invoices/images/63f34163e8a7430008b38007-1.png",
    "https://kinequo.blob.core.windows.net/midas/invoices/images/63f34163e8a7430008b38007-2.png",
    "https://kinequo.blob.core.windows.net/midas/invoices/images/63f34163e8a7430008b38007-3.png",
    "https://kinequo.blob.core.windows.net/midas/invoices/images/63f34163e8a7430008b38007-4.png",
    "https://kinequo.blob.core.windows.net/midas/invoices/images/63f34163e8a7430008b38007-5.png",
    "https://kinequo.blob.core.windows.net/midas/invoices/images/63f34163e8a7430008b38007-6.png"
  ],
  "original": "https://kinequo.blob.core.windows.net/midas/invoices/originals/52543ec6d13ac7000bb90823?st=2022-04-29T07%3A16%3A58Z&se=2022-04-29T07%3A46%3A58Z&sp=r&sv=2018-03-28&sr=b&sig=%2FmjG8fY516G2E5qrKhGhg269uuNdq94CJKznssYYxDvI%3D",
  "mimetype": "application/pdf",
  "data": {
    "IBAN": {},
    "SWIFT": {},
    "additionalChargesAmount": {
      "confidence": 0.7916666666666666,
      "value": 0
    },
    "additionalData": [
      {
        "_id": {
          "$oid": "63f341716985fe00080a925f",
          "values": {}
        }
      }
    ],
    "additionalDataMode": "global",
    "additionalDiscountsAmount": {
      "confidence": 0.7916666666666666,
      "value": 0
    },
    "additionalNotes": {
      "confidence": 0,
      "value": null
    },
    "bankAccountName": {
      "confidence": 0,
      "value": null
    },
    "bankAccountNumber": {
      "confidence": 0,
      "value": null
    },
    "bankRoutingNumber": {
      "confidence": 0,
      "value": null
    },
    "bankSortCode": {
      "confidence": 0,
      "value": null
    },
    "breakdowns": {
      "REAmount": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "RERate": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "discountAmount": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "discountBaseAmount": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "discountRate": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "feesAmount": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "feesBaseAmount": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "feesRate": {
        "confidence": 0.7916666666666666,
        "value": 0
      },
      "grossAmount": {
        "confidence": 0.7916666666666666,
        "value": 99.56
      },
      "taxAmount": {
        "confidence": 0.7916666666666666,
        "value": 20.91
      },
      "taxBaseAmount": {
        "confidence": 0.7916666666666666,
        "value": 99.56
      },
      "taxRate": {
        "confidence": 0.7916666666666666,
        "value": 21
      },
      "totalAmount": {
        "confidence": 0.7916666666666666,
        "value": 120.47
      }
    },
    "clientCode": {
      "confidence": 0,
      "value": null
    },
    "companyActsLike": {
      "confidence": 1,
      "value": "recipient"
    },
    "contractRef": {
      "confidence": 0,
      "value": null
    },
    "currency": {
      "confidence": 1,
      "value": "EUR"
    },
    "deliveryNoteRef": {
      "confidence": 0,
      "value": null
    },
    "documentNumber": {
      "confidence": 1,
      "value": "ZI20-002898113"
    },
    "documentReference": {},
    "documentSeries": {
      "confidence": 0,
      "value": null
    },
    "documentType": {
      "confidence": 1,
      "value": "normal"
    },
    "dues": {
      "amount": {
        "confidence": 0,
        "value": null
      },
      "date": {
        "confidence": 1,
        "value": "2023-01-31"
      }
    },
    "exchangeRate": {},
    "incoterms": {
      "confidence": 0,
      "value": null
    },
    "invoiceRef": {
      "confidence": 0,
      "value": ""
    },
    "isCreditNote": {},
    "issueDate": {
      "confidence": 1,
      "value": "2023-01-31"
    },
    "issuerAddress": {
      "confidence": 1,
      "value": "Avenida de América 115, 28042, Madrid"
    },
    "issuerAddressDetails": {
      "confidence": 1,
      "value": {
        "addressNumber": "115",
        "country": "ES",
        "municipality": "Madrid",
        "neighborhood": "Alameda de Osuna",
        "postalCode": "28042",
        "region": "Comunidad de Madrid",
        "street": "Avenida de América",
        "subRegion": "Madrid",
        "text": "Avenida de América 115, 28042, Alameda de Osuna, Madrid, Comunidad de Madrid, ESP"
      }
    },
    "issuerCountry": {
      "confidence": 1,
      "value": "ES"
    },
    "issuerEmail": {
      "confidence": 0,
      "value": null
    },
    "issuerFax": {
      "confidence": 0,
      "value": null
    },
    "issuerName": {
      "confidence": 0.9318181818181819,
      "value": "VODAFONE SERVICIOS SLU"
    },
    "issuerPhoneNumber": {
      "confidence": 0,
      "value": null
    },
    "issuerTaxId": {
      "confidence": 0.9318181818181819,
      "value": "ESB87539284"
    },
    "issuerWebsite": {
      "confidence": 1,
      "value": "vodafone.es"
    },
    "language": {
      "confidence": 1,
      "value": "es"
    },
    "legalNotes": {
      "confidence": 0,
      "value": null
    },
    "lines": {
      "date": {
        "confidence": 0,
        "value": null
      },
      "description": {
        "confidence": 1,
        "value": "Vodafone One Ilimitada Super (Fibra 600Mb) (681166545 - 912873472) Jun. a 21 Jul.)"
      },
      "discountAmount": {
        "confidence": 0,
        "value": null
      },
      "discountRate": {
        "confidence": 0,
        "value": null
      },
      "feesAmount": {
        "confidence": 0,
        "value": null
      },
      "feesRate": {
        "confidence": 0,
        "value": null
      },
      "grossAmount": {
        "confidence": 0,
        "value": null
      },
      "grossUnitPrice": {
        "confidence": 1,
        "value": 70.24
      },
      "group": {
        "confidence": 0,
        "value": ""
      },
      "identifier": {
        "confidence": 0,
        "value": ""
      },
      "quantity": {
        "confidence": 1,
        "value": 0.82
      },
      "taxAmount": {
        "confidence": 0.85625,
        "value": 12.15
      },
      "taxBaseAmount": {
        "confidence": 1,
        "value": 57.84
      },
      "taxBaseUnitPrice": {
        "confidence": 0,
        "value": null
      },
      "taxRate": {
        "confidence": 0.7125,
        "value": 21
      },
      "totalAmount": {
        "confidence": 0.928125,
        "value": 69.99
      },
      "totalUnitPrice": {
        "confidence": 0,
        "value": null
      },
      "unitOfMeasurement": {
        "confidence": 0,
        "value": ""
      }
    },
    "meterNumber": {
      "confidence": 0,
      "value": 0
    },
    "numberFormat": {
      "confidence": 1,
      "value": [
        ".,"
      ]
    },
    "orderRef": {
      "confidence": 0,
      "value": null
    },
    "paymentMethod": {
      "confidence": 1,
      "value": "Domiciliación bancaria"
    },
    "paymentTerms": {
      "confidence": 0,
      "value": null
    },
    "readings": {
      "current": {
        "confidence": 0,
        "value": 0
      },
      "previous": {
        "confidence": 0,
        "value": 0
      },
      "usage": {
        "confidence": 0,
        "value": 0
      }
    },
    "recipientAddress": {
      "confidence": 1,
      "value": "CL BRAVO MURILLO 102 2º IZ 28020 MADRID MADRID España"
    },
    "recipientAddressDetails": {
      "confidence": 0.9909,
      "value": {
        "addressNumber": "102",
        "country": "ES",
        "municipality": "Madrid",
        "neighborhood": "Cuatro Caminos",
        "postalCode": "28020",
        "region": "Comunidad de Madrid",
        "street": "Calle de Bravo Murillo",
        "subRegion": "Madrid",
        "text": "Calle de Bravo Murillo 102, 28020, Cuatro Caminos, Madrid, Comunidad de Madrid, ESP"
      }
    },
    "recipientCountry": {
      "confidence": 0.9909,
      "value": "ES"
    },
    "recipientEmail": {
      "confidence": 0,
      "value": null
    },
    "recipientFax": {
      "confidence": 0,
      "value": null
    },
    "recipientName": {
      "confidence": 1,
      "value": "KINEQUO SL"
    },
    "recipientPhoneNumber": {
      "confidence": 0,
      "value": null
    },
    "recipientTaxId": {
      "confidence": 1,
      "value": "ESB87334876"
    },
    "recipientWebsite": {
      "confidence": 0,
      "value": null
    },
    "reimbursableExpensesAmount": {
      "confidence": 0.7916666666666666,
      "value": 0
    },
    "seriesCode": {
      "confidence": 0,
      "value": ""
    },
    "serviceAddress": {
      "confidence": 0,
      "values": ""
    },
    "shippingAddress": {
      "confidence": 0,
      "value": null
    },
    "supplyNumber": {
      "confidence": 0,
      "value": 0
    },
    "taxClass": {
      "confidence": 1,
      "value": "IGIC"
    },
    "totalAmount": {
      "confidence": 0.7916666666666666,
      "value": 120.47
    },
    "totalDiscountAmount": {
      "confidence": 0.7916666666666666,
      "value": 0
    },
    "totalDueAmount": {
      "confidence": 0.7916666666666666,
      "value": 120.47
    },
    "totalFeesAmount": {
      "confidence": 0.7916666666666666,
      "value": 0
    },
    "totalGrossAmount": {
      "confidence": 0.7916666666666666,
      "value": 99.56
    },
    "totalTaxAmount": {
      "confidence": 0.7916666666666666,
      "value": 20.91
    },
    "totalTaxBaseAmount": {
      "confidence": 0.7916666666666666,
      "value": 99.56
    },
    "totalUsage": {
      "confidence": 0,
      "value": "0,"
    },
    "usageUnitOfMeasurement": {
      "confidence": 0,
      "value": 0
    },
    "withholdingTaxAmount": {
      "confidence": 0.7916666666666666,
      "value": 0
    },
    "withholdingTaxRate": {
      "confidence": 0.7916666666666666,
      "value": 0
    }
  },
  "publicState": "approved",
  "confidence": "high",
  "validationInfo": {
    "errors": []
  },
  "approvalInfo": {
    "beginning": "2024-01-15T09:30:00Z",
    "result": "approved",
    "steps": []
  },
  "import": {
    "_id": "62547ec6d13ac7000b590822"
  },
  "exports": [],
  "deleted": true,
  "user": null
}
```

**SDK Code**

```python
import requests

url = "https://api.invofox.com/documents/id"

payload = {}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.get(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.invofox.com/documents/id';
const options = {
  method: 'GET',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.invofox.com/documents/id"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("GET", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.invofox.com/documents/id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.invofox.com/documents/id")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.invofox.com/documents/id', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.invofox.com/documents/id");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.invofox.com/documents/id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```