POST /file
Extract data from receipts or invoices uploaded as images or PDF files.
Authorization
API key required in the Authorization header.
Request Parameters
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | Your API key |
Content-Type | Yes | multipart/form-data |
Request Body
multipart/form-data
with the following fields:
Field | Type | Required | Description |
---|---|---|---|
file | File | Yes | Receipt image or PDF file |
skipItems | boolean | No | Controls whether to skip the detailed item extraction process. When set to true , significantly accelerates the extraction process by omitting individual line item details. (default: false ) |
Supported File Types
- Images (
image/*
) - PDF (
application/pdf
)
Responses
Success (200 OK)
{
"data": {
"vendor": "string",
"time": "YYYY-MM-DDTHH:mm",
"currency": "string",
"items": [
{
"name": "string",
"quantity": "string",
"unitPrice": "string",
"priceBeforeDiscount": "string",
"discount": "string",
"price": "string"
}
],
"total": "string"
}
}
Field | Type | Description |
---|---|---|
vendor | string | Name of the business issuing the receipt |
time | string | Date and time of purchase (ISO format) |
currency | string | Currency code |
items | array | List of purchased items |
total | string | Total amount of the purchase |
Errors
Status Code | Description | Example |
---|---|---|
400 Bad Request | Invalid file format or content | {"error": "Unsupported file format: {format}"} |
400 Bad Request | No readable text in image | {"error": "No text found in the image"} |
400 Bad Request | File is not a receipt | {"error": "This is not a receipt"} |
400 Bad Request | The dimensions of the image must be greater than 50 x 50 pixels and less than 16,000 x 16,000 pixels | {"error": "Image resolution must be between 50px and 16000px in both dimensions"} |
401 Unauthorized | API key missing | {"error": "Missing token"} |
401 Unauthorized | API key invalid | {"error": "Invalid token"} |
402 Payment Required | Insufficient account balance | {"error": "You don't have enough credits"} |
500 Internal Server Error | Server-side error | {"error": "Internal Server Error"} |
Examples
Request Example
curl -X POST https://api.wiseocr.com/v1/file \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@receipt.jpg"
Response Example
{
"data": {
"vendor": "Grocery Store",
"time": "2025-02-15T14:30",
"currency": "USD",
"items": [
{
"name": "Apples",
"quantity": "1 kg",
"unitPrice": "3.99",
"priceBeforeDiscount": "3.99",
"discount": "0.00",
"price": "3.99"
},
{
"name": "Milk",
"quantity": "1",
"unitPrice": "2.50",
"priceBeforeDiscount": "2.50",
"discount": "0.50",
"price": "2.00"
}
],
"total": "5.99"
}
}
Credit System
- Requires available credits in user's account
- Consumes 1 credit per successful request
What's next?
- Learn about extracting data from URLs instead of file uploads
- Learn about extracting data from text if you already have the receipt text
- Return to API basics