Extracting Detailed Data

This guide covers how to achieve seamless data extraction from Receipts and Invoices in minutes.

Key Features

  • Supported File Formats: PDF, JPG, PNG, GIF, HEIC
  • File Size: Maximum 20MB
  • Page Limit: Maximum 3 pages for PDF Files
  • Global Language Support: Extract data in multiple languages with options for region-specific enhancements. Explore global capabilities here.
  • Real-Time Processing: Fast results with high accuracy, plus options to improve results through feedback.
  • Extensive out-of-the-box data fields: See here for details.

Step-by-Step Guide

Step 1: Obtain Your API Key

To start, you'll need to authenticate your API requests using an API key. Get your free API key here.


Step 2: Visit the API Reference

Go to Taggun's API Reference


Step 3: Upload a file

Use the Verbose Upload File Endpoint to extract detailed data from your receipt or invoice.


Endpoint:

POST <https://api.taggun.io/api/receipt/v1/verbose/file>

Required Parameters:

  • file Receipt or invoice file (max 20MB). Accepted types: PDF, JPG, PNG, GIF, HEIC.
  • refresh (boolean) Set true to re-process if already stored, otherwise false.
  • incognito (boolean) Set true to avoid Taggun storing the receipt, otherwise false.
  • extractLineItems (boolean) Set true to include detailed product line items, otherwise false.

Example Request

curl --request POST  
     --url <https://api.taggun.io/api/receipt/v1/verbose/file>  
     --header 'accept: application/json'  
     --header 'apikey: YOUR_API_KEY' #UPDATE to your API Key 
     --header 'content-type: multipart/form-data'  
     --form 'file=@/path/to/receipt.jpg' #UPDATE for your file path 
     --form 'refresh=false'  
     --form 'incognito=false'  
     --form 'extractLineItems=true'

Example File


Step 4: Interpret Results

Taggun will return a JSON response with the extracted data.


Response Definitions

See page: Data Fields Taggun Extracts


Sample Response

{
  "totalAmount": {
    "data": 14.42,
    "confidenceLevel": 0.9199999999999999,
    "text": "CP Card 14.42",
    "index": 19,
    "keyword": "-",
    "currencyCode": "USD",
    "regions": [
      [
        {
          "x": 232,
          "y": 936
        },
        {
          "x": 249,
          "y": 935
        },
        {
          "x": 250,
          "y": 951
        },
        {
          "x": 233,
          "y": 953
        }
      ],
      [
        {
          "x": 260,
          "y": 934
        },
        {
          "x": 301,
          "y": 933
        },
        {
          "x": 300,
          "y": 948
        },
        {
          "x": 260,
          "y": 950
        }
      ],
      [
        {
          "x": 588,
          "y": 922
        },
        {
          "x": 637,
          "y": 923
        },
        {
          "x": 636,
          "y": 941
        },
        {
          "x": 587,
          "y": 939
        }
      ]
    ]
  },
  "taxAmount": {
    "data": 0.82,
    "confidenceLevel": 0.9199999999999999,
    "text": "Tax 0.82",
    "index": 17,
    "keyword": "-",
    "currencyCode": "USD",
    "regions": [
      [
        {
          "x": 231,
          "y": 864
        },
        {
          "x": 258,
          "y": 864
        },
        {
          "x": 259,
          "y": 882
        },
        {
          "x": 231,
          "y": 883
        }
      ],
      [
        {
          "x": 596,
          "y": 858
        },
        {
          "x": 632,
          "y": 855
        },
        {
          "x": 634,
          "y": 872
        },
        {
          "x": 597,
          "y": 876
        }
      ]
    ]
  },
  "discountAmount": {
    "confidenceLevel": 0
  },
  "paidAmount": {
    "data": 14.42,
    "confidenceLevel": 0.9199999999999999,
    "text": "CP Card 14.42",
    "index": 19,
    "regions": [
      [
        {
          "x": 232,
          "y": 936
        },
        {
          "x": 249,
          "y": 935
        },
        {
          "x": 250,
          "y": 951
        },
        {
          "x": 233,
          "y": 953
        }
      ],
      [
        {
          "x": 260,
          "y": 934
        },
        {
          "x": 301,
          "y": 933
        },
        {
          "x": 300,
          "y": 948
        },
        {
          "x": 260,
          "y": 950
        }
      ],
      [
        {
          "x": 588,
          "y": 922
        },
        {
          "x": 637,
          "y": 923
        },
        {
          "x": 636,
          "y": 941
        },
        {
          "x": 587,
          "y": 939
        }
      ]
    ]
  },
  "confidenceLevel": 0.898,
  "date": {
    "data": "2024-09-25T12:00:00.000Z",
    "confidenceLevel": 0.9199999999999999,
    "text": "Host: Cicily 09/25/2024",
    "index": 6,
    "regions": [
      [
        {
          "x": 219,
          "y": 386
        },
        {
          "x": 272,
          "y": 388
        },
        {
          "x": 271,
          "y": 408
        },
        {
          "x": 218,
          "y": 406
        }
      ],
      [
        {
          "x": 276,
          "y": 388
        },
        {
          "x": 336,
          "y": 389
        },
        {
          "x": 335,
          "y": 409
        },
        {
          "x": 275,
          "y": 408
        }
      ],
      [
        {
          "x": 521,
          "y": 376
        },
        {
          "x": 621,
          "y": 374
        },
        {
          "x": 621,
          "y": 394
        },
        {
          "x": 521,
          "y": 398
        }
      ]
    ]
  },
  "dueDate": {
    "confidenceLevel": 0
  },
  "text": {
    "text": "CHIPOTLE\nTEXICAN GRIL\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 2.65\nChips 1.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 9721",
    "regions": [
      {
        "x": 215,
        "y": 88
      },
      {
        "x": 639,
        "y": 77
      },
      {
        "x": 638,
        "y": 1223
      },
      {
        "x": 215,
        "y": 1237
      }
    ]
  },
  "amounts": [
    {
      "data": 9.1,
      "index": 9,
      "regions": [
        [
          {
            "x": 218,
            "y": 529
          },
          {
            "x": 621,
            "y": 526
          },
          {
            "x": 620,
            "y": 544
          },
          {
            "x": 217,
            "y": 549
          }
        ]
      ],
      "text": "Chicken Bowl 9.10"
    },
    {
      "data": 2.65,
      "index": 10,
      "regions": [
        [
          {
            "x": 239,
            "y": 554
          },
          {
            "x": 621,
            "y": 548
          },
          {
            "x": 621,
            "y": 567
          },
          {
            "x": 239,
            "y": 572
          }
        ]
      ],
      "text": "Guacamole 2.65"
    },
    {
      "data": 1.85,
      "index": 11,
      "regions": [
        [
          {
            "x": 219,
            "y": 578
          },
          {
            "x": 622,
            "y": 571
          },
          {
            "x": 622,
            "y": 590
          },
          {
            "x": 219,
            "y": 595
          }
        ]
      ],
      "text": "Chips 1.85"
    },
    {
      "data": 13.6,
      "index": 16,
      "regions": [
        [
          {
            "x": 228,
            "y": 842
          },
          {
            "x": 632,
            "y": 830
          },
          {
            "x": 633,
            "y": 849
          },
          {
            "x": 228,
            "y": 860
          }
        ]
      ],
      "text": "Subtotal 13.60"
    },
    {
      "data": 0.82,
      "index": 17,
      "regions": [
        [
          {
            "x": 231,
            "y": 864
          },
          {
            "x": 632,
            "y": 855
          },
          {
            "x": 634,
            "y": 872
          },
          {
            "x": 231,
            "y": 883
          }
        ]
      ],
      "text": "Tax 0.82"
    },
    {
      "data": 14.42,
      "index": 18,
      "regions": [
        [
          {
            "x": 232,
            "y": 913
          },
          {
            "x": 636,
            "y": 901
          },
          {
            "x": 636,
            "y": 919
          },
          {
            "x": 233,
            "y": 932
          }
        ]
      ],
      "text": "TAKE OUT Total 14.42"
    },
    {
      "data": 14.42,
      "index": 19,
      "regions": [
        [
          {
            "x": 232,
            "y": 936
          },
          {
            "x": 637,
            "y": 923
          },
          {
            "x": 636,
            "y": 941
          },
          {
            "x": 233,
            "y": 953
          }
        ]
      ],
      "text": "CP Card 14.42"
    },
    {
      "data": 14.42,
      "index": 21,
      "regions": [
        [
          {
            "x": 236,
            "y": 976
          },
          {
            "x": 636,
            "y": 966
          },
          {
            "x": 635,
            "y": 983
          },
          {
            "x": 237,
            "y": 995
          }
        ]
      ],
      "text": "Balance Due 14.42"
    }
  ],
  "numbers": [
    {
      "data": 702,
      "text": "702 E Boise Avenue",
      "regions": [
        [
          {
            "x": 335,
            "y": 315
          },
          {
            "x": 501,
            "y": 306
          },
          {
            "x": 502,
            "y": 324
          },
          {
            "x": 336,
            "y": 336
          }
        ]
      ],
      "index": 3
    },
    {
      "data": 83706,
      "text": "Boise, ID 83706",
      "regions": [
        [
          {
            "x": 343,
            "y": 340
          },
          {
            "x": 481,
            "y": 330
          },
          {
            "x": 482,
            "y": 351
          },
          {
            "x": 345,
            "y": 359
          }
        ]
      ],
      "index": 4
    },
    {
      "data": 409,
      "text": "ORDER #409 10310",
      "regions": [
        [
          {
            "x": 221,
            "y": 411
          },
          {
            "x": 620,
            "y": 425
          },
          {
            "x": 620,
            "y": 445
          },
          {
            "x": 220,
            "y": 429
          }
        ]
      ],
      "index": 8,
      "classifyResult": "primaryTotal"
    },
    {
      "data": 10310,
      "text": "ORDER #409 10310",
      "regions": [
        [
          {
            "x": 221,
            "y": 411
          },
          {
            "x": 620,
            "y": 425
          },
          {
            "x": 620,
            "y": 445
          },
          {
            "x": 220,
            "y": 429
          }
        ]
      ],
      "index": 8,
      "classifyResult": "primaryTotal"
    },
    {
      "data": 390,
      "text": "390 009 100 054 210 001 71",
      "regions": [
        [
          {
            "x": 231,
            "y": 746
          },
          {
            "x": 488,
            "y": 739
          },
          {
            "x": 488,
            "y": 761
          },
          {
            "x": 232,
            "y": 766
          }
        ]
      ],
      "index": 15
    },
    {
      "data": 100,
      "text": "390 009 100 054 210 001 71",
      "regions": [
        [
          {
            "x": 231,
            "y": 746
          },
          {
            "x": 488,
            "y": 739
          },
          {
            "x": 488,
            "y": 761
          },
          {
            "x": 232,
            "y": 766
          }
        ]
      ],
      "index": 15
    },
    {
      "data": 210,
      "text": "390 009 100 054 210 001 71",
      "regions": [
        [
          {
            "x": 231,
            "y": 746
          },
          {
            "x": 488,
            "y": 739
          },
          {
            "x": 488,
            "y": 761
          },
          {
            "x": 232,
            "y": 766
          }
        ]
      ],
      "index": 15
    },
    {
      "data": 71,
      "text": "390 009 100 054 210 001 71",
      "regions": [
        [
          {
            "x": 231,
            "y": 746
          },
          {
            "x": 488,
            "y": 739
          },
          {
            "x": 488,
            "y": 761
          },
          {
            "x": 232,
            "y": 766
          }
        ]
      ],
      "index": 15
    },
    {
      "data": 9721,
      "text": "Text \"CHIPJOBS\" to 9721",
      "regions": [
        [
          {
            "x": 333,
            "y": 1222
          },
          {
            "x": 546,
            "y": 1210
          },
          {
            "x": 545,
            "y": 1221
          },
          {
            "x": 335,
            "y": 1238
          }
        ]
      ],
      "index": 30
    }
  ],
    "invoiceNumber": {
      "confidenceLevel": 0
    },
    "merchantVerification": {
      "data": {
        "verificationId": "390009100054",
        "vatNo": "390009100054",
        "vies": {
          "name": "---",
          "address": "---",
          "valid": false,
          "vatNumber": "390009100054",
          "error": "TAGGUN_COUNTRY_CODE_UNDEFINED"
        }
      },
      "confidenceLevel": 0.3466666666666667,
      "text": "390 009 100 054 210 001 71",
      "index": 15,
      "regions": [
        [
          {
            "x": 231,
            "y": 746
          },
          {
            "x": 261,
            "y": 745
          },
          {
            "x": 262,
            "y": 765
          },
          {
            "x": 232,
            "y": 766
          }
        ],
        [
          {
            "x": 268,
            "y": 744
          },
          {
            "x": 302,
            "y": 743
          },
          {
            "x": 302,
            "y": 763
          },
          {
            "x": 269,
            "y": 765
          }
        ],
        [
          {
            "x": 310,
            "y": 743
          },
          {
            "x": 342,
            "y": 742
          },
          {
            "x": 342,
            "y": 762
          },
          {
            "x": 311,
            "y": 763
          }
        ],
        [
          {
            "x": 348,
            "y": 742
          },
          {
            "x": 381,
            "y": 741
          },
          {
            "x": 381,
            "y": 761
          },
          {
            "x": 348,
            "y": 762
          }
        ],
        [
          {
            "x": 386,
            "y": 741
          },
          {
            "x": 418,
            "y": 740
          },
          {
            "x": 418,
            "y": 761
          },
          {
            "x": 387,
            "y": 761
          }
        ],
        [
          {
            "x": 425,
            "y": 740
          },
          {
            "x": 458,
            "y": 740
          },
          {
            "x": 458,
            "y": 761
          },
          {
            "x": 425,
            "y": 761
          }
        ],
        [
          {
            "x": 465,
            "y": 740
          },
          {
            "x": 488,
            "y": 739
          },
          {
            "x": 488,
            "y": 761
          },
          {
            "x": 465,
            "y": 761
          }
        ]
      ]
    },
    "receiptNumber": {
      "data": "10310",
      "confidenceLevel": 0.9199999999999999,
      "text": "ORDER #409 10310",
      "keyword": "-",
      "index": 8,
      "regions": [
        [
          {
            "x": 221,
            "y": 411
          },
          {
            "x": 268,
            "y": 412
          },
          {
            "x": 268,
            "y": 431
          },
          {
            "x": 220,
            "y": 429
          }
        ],
        [
          {
            "x": 277,
            "y": 413
          },
          {
            "x": 317,
            "y": 414
          },
          {
            "x": 317,
            "y": 432
          },
          {
            "x": 276,
            "y": 431
          }
        ],
        [
          {
            "x": 573,
            "y": 426
          },
          {
            "x": 620,
            "y": 425
          },
          {
            "x": 620,
            "y": 445
          },
          {
            "x": 573,
            "y": 446
          }
        ]
      ]
    },
    "last4": {
      "confidenceLevel": 0
    },
  "lineAmounts": [],
  "itemsCount": {
    "data": 0,
    "confidenceLevel": 0
  },
  "paymentType": {
    "confidenceLevel": 0
  },
  "trackingId": "T-20241001-8239784",
  "merchantName": {
    "data": "CHIPOTLE",
    "confidenceLevel": 0.8100000000000002,
    "text": "CHIPOTLE",
    "index": 0,
    "regions": [
      [
        {
          "x": 329,
          "y": 120
        },
        {
          "x": 483,
          "y": 104
        },
        {
          "x": 478,
          "y": 136
        },
        {
          "x": 348,
          "y": 151
        }
      ]
    ]
  },
  "merchantAddress": {
    "data": "702 E Boise Ave, Boise, Idaho, 83706",
    "confidenceLevel": 0.99,
    "text": "702 E Boise Avenue\nBoise, ID 83706",
    "index": 4,
    "regions": [
      [
        {
          "x": 343,
          "y": 340
        },
        {
          "x": 398,
          "y": 335
        },
        {
          "x": 399,
          "y": 356
        },
        {
          "x": 345,
          "y": 359
        }
      ],
      [
        {
          "x": 403,
          "y": 335
        },
        {
          "x": 423,
          "y": 334
        },
        {
          "x": 425,
          "y": 354
        },
        {
          "x": 404,
          "y": 355
        }
      ],
      [
        {
          "x": 430,
          "y": 333
        },
        {
          "x": 481,
          "y": 330
        },
        {
          "x": 482,
          "y": 351
        },
        {
          "x": 431,
          "y": 354
        }
      ]
    ]
  },
  "merchantCity": {
    "data": "Boise",
    "confidenceLevel": 0.99,
    "text": "702 E Boise Avenue\nBoise, ID 83706",
    "index": 4,
    "regions": [
      [
        {
          "x": 343,
          "y": 340
        },
        {
          "x": 398,
          "y": 335
        },
        {
          "x": 399,
          "y": 356
        },
        {
          "x": 345,
          "y": 359
        }
      ],
      [
        {
          "x": 403,
          "y": 335
        },
        {
          "x": 423,
          "y": 334
        },
        {
          "x": 425,
          "y": 354
        },
        {
          "x": 404,
          "y": 355
        }
      ],
      [
        {
          "x": 430,
          "y": 333
        },
        {
          "x": 481,
          "y": 330
        },
        {
          "x": 482,
          "y": 351
        },
        {
          "x": 431,
          "y": 354
        }
      ]
    ]
  },
  "merchantState": {
    "data": "Ada County, Idaho",
    "confidenceLevel": 0.99,
    "text": "702 E Boise Avenue\nBoise, ID 83706",
    "index": 4,
    "regions": [
      [
        {
          "x": 343,
          "y": 340
        },
        {
          "x": 398,
          "y": 335
        },
        {
          "x": 399,
          "y": 356
        },
        {
          "x": 345,
          "y": 359
        }
      ],
      [
        {
          "x": 403,
          "y": 335
        },
        {
          "x": 423,
          "y": 334
        },
        {
          "x": 425,
          "y": 354
        },
        {
          "x": 404,
          "y": 355
        }
      ],
      [
        {
          "x": 430,
          "y": 333
        },
        {
          "x": 481,
          "y": 330
        },
        {
          "x": 482,
          "y": 351
        },
        {
          "x": 431,
          "y": 354
        }
      ]
    ]
  },
  "merchantCountryCode": {
    "data": "US",
    "confidenceLevel": 0.99,
    "text": "702 E Boise Avenue\nBoise, ID 83706",
    "index": 4,
    "regions": [
      [
        {
          "x": 343,
          "y": 340
        },
        {
          "x": 398,
          "y": 335
        },
        {
          "x": 399,
          "y": 356
        },
        {
          "x": 345,
          "y": 359
        }
      ],
      [
        {
          "x": 403,
          "y": 335
        },
        {
          "x": 423,
          "y": 334
        },
        {
          "x": 425,
          "y": 354
        },
        {
          "x": 404,
          "y": 355
        }
      ],
      [
        {
          "x": 430,
          "y": 333
        },
        {
          "x": 481,
          "y": 330
        },
        {
          "x": 482,
          "y": 351
        },
        {
          "x": 431,
          "y": 354
        }
      ]
    ]
  },
  "merchantTypes": {
    "confidenceLevel": 0
  },
  "merchantPostalCode": {
    "data": "83706",
    "confidenceLevel": 0.99,
    "text": "702 E Boise Avenue\nBoise, ID 83706",
    "index": 4,
    "regions": [
      [
        {
          "x": 343,
          "y": 340
        },
        {
          "x": 398,
          "y": 335
        },
        {
          "x": 399,
          "y": 356
        },
        {
          "x": 345,
          "y": 359
        }
      ],
      [
        {
          "x": 403,
          "y": 335
        },
        {
          "x": 423,
          "y": 334
        },
        {
          "x": 425,
          "y": 354
        },
        {
          "x": 404,
          "y": 355
        }
      ],
      [
        {
          "x": 430,
          "y": 333
        },
        {
          "x": 481,
          "y": 330
        },
        {
          "x": 482,
          "y": 351
        },
        {
          "x": 431,
          "y": 354
        }
      ]
    ]
  },
  "targetRotation": 0,
  "elapsed": 5691.020163998008
}

Step 5: Explore Advanced and Region-Specific Features

Taggun offers global capabilities for region-specific needs, as well as a range of advanced features including:


ℹ️

For regional or advanced features, reach out to us at [email protected]


Fine-Tuning Results

For improvement tips, visit Optimising Performance.


How to manage data not being returned / empty data.

What happens when data isn't found? What is returned? ASK CK HOW ABOUT THIS.


Understanding Confidence Levels

Taggun provides confidence levels for each extracted data point. These levels range from 0 to 1, with 1 representing the highest confidence. Explore how to interpret and use these confidence levels here.


Understanding X and Y Coordinates

The API also provides X and Y coordinates for each extracted field, representing the position of the data on the image:

  • X: Horizontal distance from the left edge of the image (in pixels)
  • Y: Vertical distance from the top edge of the image (in pixels)

These coordinates can be useful for verifying the extracted data against the original image.


Conclusion

Designed to scale with your needs, whether you're a startup or an enterprise, Taggun’s API offers a powerful foundation for innovation in receipt processing and data analysis.

This guide helps you unlock the full potential of the API. For advanced features or customisation options, explore the complete API documentation.