https://api.visionparser.com/parse/image/file
Upload Image
POSThttps://api.visionparser.com/parse/image/file
Request
Headers
Content-TypestringRequired
Allowed value: multipart/form-data
api_keystringRequired
Header for api authentication
Body
filefileRequired
The image is uploaded as a file (PNG or JPEG only)
response_typestringRequired
The type of response format desired.
- Allowed values:
- •
simple: Provides basic parsing details. - •
advanced: Provides detailed parsing including detailed metadata.
simpleSuccess Response
HTTP Status200 OK
Content-Typeapplication/json
Body
{
"data": {
"totalAmount": {
"value": 45.99,
"conf_score": 0.98
},
"taxAmount": {
"value": 3.99,
"conf_score": 0.95
},
// Other response fields based on the response type
}
}Click here to learn more about confidence score
Response fields (Simple)
| Field Name | Short Description | Data Type | Path in JSON |
|---|---|---|---|
| totalAmount | Total amount of the transaction | float | data.totalAmount |
| taxAmount | Tax amount for the transaction | float | data.taxAmount |
| dateTime | Date and time of the transaction in ISO format (yyyy-MM-dd'T'HH:mm:ss) | DateTime | data.dateTime |
| merchantName | Name of the merchant | string | data.merchantName |
| merchantAddress | Merchant's physical address | string | data.merchantAddress |
| currencyCode | Currency code used in the transaction | string | data.currencyCode |
| merchantCountry | Merchant's country | string | data.merchantCountry |
| merchantState | Merchant's state or region | string | data.merchantState |
| merchantCity | Merchant's city | string | data.merchantCity |
| merchantPostalCode | Merchant's postal or ZIP code | string | data.merchantPostalCode |
| merchantPhone | Merchant's contact phone number | string | data.merchantPhone |
| merchantEmail | Merchant's email address | string | data.merchantEmail |
| requestId | Unique request ID for the transaction | string | data.requestId |
Note:
- If the time is not specified in the
dateTimefield,00:00:00(midnight) will be assumed as the default time. - If a field is not available in the image, its
valuewill benull.
Response fields (Advanced)
The response when the response_type is set to advanced.
The fields in addition to all the fields in the simple response.
| Field Name | Short Description | Data Type | Path in JSON |
|---|---|---|---|
| invoiceReceiptNumber | The invoice or receipt number | string | data.invoiceReceiptNumber |
| paidAmount | The amount paid by the customer | float | data.paidAmount |
| discountAmount | Any discount applied to the transaction | float | data.discountAmount |
| serviceCharge | Any service charge paid for the transaction | float | data.serviceCharge |
| productLineItems | List of products/services with detailed breakdown | array | data.productLineItems[] |
Error Response
| HTTP Status | Description | Example Response |
|---|---|---|
| 400 Bad Request | Invalid or missing image_source, image, or response_type. | { "detail": "Invalid value for image_source. Please use 'file', 'bytes', or 'url'." } |
| 401 Unauthorized | Missing API key. | { "detail": "API key missing" } |
| 403 Forbidden | Invalid API key. | { "detail": "Invalid API key" } |
| 429 Too Many Requests | Exceeded rate limit. | { "detail": "Rate limit exceeded. Try again later." } |
| 500 Internal Server Error | General error in processing the request. | { "detail": "Internal Server Error" } |