Skip to main content

POST /text

Extract data from provided receipts or invoices text.

Authorization

API key required in the Authorization header.

Request Parameters

Headers

NameRequiredDescription
AuthorizationYesYour API key
Content-TypeYesapplication/json

Request Body

{
"text": "RECEIPT OR INVOICE TEXT",
"skipItems": false
}
FieldTypeRequiredDescription
textstringYesText content of the receipt or invoice
skipItemsbooleanNoControls 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"
}
}
FieldTypeDescription
vendorstringName of the business issuing the receipt
timestringDate and time of purchase (ISO format)
currencystringCurrency code
itemsarrayList of purchased items
totalstringTotal amount of the purchase

Errors

Status CodeDescriptionExample
400 Bad RequestNo receipt text provided{"error": "No receipt text provided"}
400 Bad RequestProvided text is not a receipt{"error": "This is not a receipt"}
401 UnauthorizedAPI key missing{"error": "Missing token"}
401 UnauthorizedAPI key invalid{"error": "Invalid token"}
402 Payment RequiredInsufficient account balance{"error": "You don't have enough credits"}
500 Internal Server ErrorServer-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?