POST /text
Extract data from provided receipts or invoices text.
Authorization
API key required in the Authorization header.
Request Parameters
Headers
Name | Required | Description |
---|---|---|
Authorization | Yes | Your API key |
Content-Type | Yes | application/json |
Request Body
{
"text": "RECEIPT OR INVOICE TEXT",
"skipItems": false
}
Field | Type | Required | Description |
---|---|---|---|
text | string | Yes | Text content of the receipt or invoice |
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 ) |
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 | No receipt text provided | {"error": "No receipt text provided"} |
400 Bad Request | Provided text is not a receipt | {"error": "This is not a receipt"} |
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/text \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "RECEIPT OR INVOICE TEXT"
}'
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 file uploads if you have receipt images
- Learn about extracting data from URLs if you have receipt image URLs
- Return to API basics