Structured Data Output
Structured data is essential for modern business operations, enabling seamless system integration and automated data processing. When receipt data is extracted, it needs to be organised in a standardised format that machines can easily read and process.
The Importance of Structured Data
Structured data provides three key benefits for businesses:
- System Integration: Enables automatic data flow between different software systems
- Data Analysis: Facilitates comprehensive analysis of receipt data for business insights
- Process Automation: Supports automated workflows for accounting, expense management, and other business processes
JSON Data Format
JSON (JavaScript Object Notation) is the standard format for structured receipt data output.
Here's an example of how a Receipt OCR API structures extracted receipt data in JSON format:
{
"totalAmount": {
"data": 14.42,
"confidenceLevel": 0.9199999999999999,
"text": "CP Card 14.42",
"index": 20,
"keyword": "-",
"currencyCode": "USD",
"regions": []
},
"taxAmount": {
"data": 0.82,
"confidenceLevel": 0.9199999999999999,
"text": "Tax 0.82",
"index": 18,
"keyword": "-",
"currencyCode": "USD",
"regions": []
},
"discountAmount": {
"confidenceLevel": 0
},
"paidAmount": {
"data": 14.42,
"confidenceLevel": 0.9199999999999999,
"text": "CP Card 14.42",
"index": 20,
"regions": []
},
"confidenceLevel": 0.898,
"date": {
"data": "2024-09-25T12:00:00.000Z",
"confidenceLevel": 0.9199999999999999,
"text": "Host: Cicily 09/25/2024",
"index": 6,
"regions": []
},
"dueDate": {
"confidenceLevel": 0
},
"text": {
"text": "CHIPOTLE\nMEVIC GRILL\nBUILD-YOUR-OWN HAPPINESS\n702 E Boise Avenue\nBoise, ID 83706\n208-509-4827\nHost: Cicily 09/25/2024\n7:16 PM\nORDER #409 10310\nChicken Bowl 9.10\nGuacamole\nChips 2.65\n1.85\nHow're we doing? Let us know at\nChipotleFeedback.com\nUnique Code:\n390 009 100 054 210 001 71\nSubtotal 13.60\nTax 0.82\nTAKE OUT Total 14.42\nCP Card 14.42\nAuthorizing. ..\nBalance Due 14.42\nLove Chipotle? Join Our Team\nGet great benefits like:\nFree Chipotle\nDebt-free college degrees\nBonus eligibility\nRapid career growth\nAnd more!\nVisit jobs.chipotle.com\nText \"CHIPJOBS\" to 97211",
"regions": []
},
"amounts": [
{
"data": 9.1,
"index": 9,
"regions": [],
"text": "Chicken Bowl 9.10"
},
{
"data": 2.65,
"index": 11,
"regions": [],
"text": "Chips 2.65"
},
{
"data": 1.85,
"index": 12,
"regions": [],
"text": "1.85"
},
{
"data": 13.6,
"index": 17,
"regions": [],
"text": "Subtotal 13.60"
},
{
"data": 0.82,
"index": 18,
"regions": [],
"text": "Tax 0.82"
},
{
"data": 14.42,
"index": 19,
"regions": [],
"text": "TAKE OUT Total 14.42"
},
{
"data": 14.42,
"index": 20,
"regions": [],
"text": "CP Card 14.42"
},
{
"data": 14.42,
"index": 22,
"regions": [],
"text": "Balance Due 14.42"
}
],
"numbers": [
{
"data": 702,
"text": "702 E Boise Avenue",
"regions": [],
"index": 3
},
{
"data": 83706,
"text": "Boise, ID 83706",
"regions": [],
"index": 4
},
{
"data": 409,
"text": "ORDER #409 10310",
"regions": [],
"index": 8,
"classifyResult": "primaryTotal"
},
],
"entities": {
"productLineItems": [
{
"data": {
"quantity": {
"data": 1,
"regions": [],
"text": "1"
},
"unitPrice": {
"data": 9.1,
"regions": [],
"text": "9.10"
},
"totalPrice": {
"data": 9.1,
"regions": [],
"text": "9.10"
},
"name": {
"data": "Chicken Bowl",
"regions": [],
"text": "Chicken Bowl"
}
},
"confidenceLevel": 0.65,
"text": "Chicken Bowl 9.10",
"index": 9,
"regions": []
},
{
"data": {
"quantity": {
"data": 1,
"regions": [],
"text": "1"
},
"unitPrice": {
"data": 1.85,
"regions": [],
"text": "1.85"
},
"totalPrice": {
"data": 1.85,
"regions": [],
"text": "1.85"
},
"name": {
"data": "Guacamole",
"regions": [],
"text": "Guacamole"
}
},
"confidenceLevel": 0.65,
"text": "Guacamole",
"index": 10,
"regions": []
},
],
"invoiceNumber": {
"confidenceLevel": 0
},
"receiptNumber": {
"data": "10310",
"confidenceLevel": 0.9199999999999999,
"text": "ORDER #409 10310",
"keyword": "-",
"index": 8,
"regions": []
},
"last4": {
"confidenceLevel": 0
},
"lineAmounts": [],
"itemsCount": {
"data": 0,
"confidenceLevel": 0
},
"paymentType": {
"confidenceLevel": 0
},
"trackingId": "T-20241008-6053437",
"merchantName": {
"data": "CHIPOTLE",
"confidenceLevel": 0.8100000000000002,
"text": "CHIPOTLE",
"index": 0,
"regions": []
},
"merchantAddress": {
"data": "702 E Boise Ave, Boise, Idaho, 83706",
"confidenceLevel": 0.99,
"text": "702 E Boise Avenue\nBoise, ID 83706",
"index": 4,
"regions": []
},
"merchantCity": {
"data": "Boise",
"confidenceLevel": 0.99,
"text": "702 E Boise Avenue\nBoise, ID 83706",
"index": 4,
"regions": []
},
"merchantState": {
"data": "Ada County, Idaho",
"confidenceLevel": 0.99,
"text": "702 E Boise Avenue\nBoise, ID 83706",
"index": 4,
"regions": []
},
"merchantCountryCode": {
"data": "US",
"confidenceLevel": 0.99,
"text": "702 E Boise Avenue\nBoise, ID 83706",
"index": 4,
"regions": []
},
"merchantPostalCode": {
"data": "83706",
"confidenceLevel": 0.99,
"text": "702 E Boise Avenue\nBoise, ID 83706",
"index": 4,
"regions": []
},
"targetRotation": 0,
"elapsed": 4538.480549000204
}
Benefits of structured receipt data:
- System Integration: The JSON output integrates seamlessly with the expense software, avoiding manual data entry.
- Process Automation: Employee reimbursements are processed automatically, saving time for both employees and administrators.
- Data Accuracy: Errors are minimized, as the structured data is machine-processed and verified for consistency (e.g., tax amounts match receipt totals).
- Insights: The company can analyze spending trends by merchant, category, or department, enabling better budget control.
Converting receipt data into structured formats like JSON helps businesses automate data entry and reduce errors. This process also unlocks valuable insights through data analysis, making tasks like accounting, expense management, and budgeting much easier.
Additional Consideration: Human Readability vs. Machine Readability
JSON provides powerful automation and integration capabilities. Its structure may appear intricate, and business users require accessible, actionable data. A well-designed receipt OCR API with intuitive endpoints will deliver data in a transparent, human-friendly format. This approach ensures teams stay focused on insights and decisions rather than deciphering code.