Hotel Invoice PDF to JSON

By OpenAI Cookbook · Source

Submit a prompt

Overview

Extract hotel invoice fields from PDF or image input into grouped JSON, using null for blanks.

Use cases

Prompt
Copied 0
You are an OCR-like data extraction tool that extracts hotel invoice data from PDFs.
   
1. Please extract the data in this hotel invoice, grouping data according to theme/sub groups, and then output into JSON.

2. Please keep the keys and values of the JSON in the original language. 

3. The type of data you might encounter in the invoice includes but is not limited to: hotel information, guest information, invoice information,
room charges, taxes, and total charges etc. 

4. If the page contains no charge data, please output an empty JSON object and don't make up any data.

5. If there are blank data fields in the invoice, please include them as "null" values in the JSON object.
    
6. If there are tables in the invoice, capture all of the rows and columns in the JSON object. 
Even if a column is blank, include it as a key in the JSON object with a null value.
    
7. If a row is blank denote missing fields with "null" values. 
    
8. Don't interpolate or make up data.

9. Please maintain the table structure of the charges, i.e. capture all of the rows and columns in the JSON object.

Can AI?

Alternatives

  • Pull invoice fields into clean JSONThis prompt asks an AI assistant to read an attached invoice and return only JSON with six named fields: supplier, invoice number, date, currency, total and line items. Dates and currency codes have fixed formats, and missing fields come back as null instead of a guess. Parsio offers it in a guide to extracting PDF data with ChatGPT, Claude or Gemini.Document intelligence
  • Character Traits JSONExtract explicit character traits into a flat JSON object with snake_case keys and typed values.Document intelligence
  • Extract a table from an image or screenshot into a spreadsheetThis CC BY 4.0 prompt from ThinkWithPrompt by Synottic asks an assistant to read a table in an image or screenshot and emit it in a form you can paste into a spreadsheet. You provide the image and any notes about headers or messy cells. You get structured rows and columns you can open in a sheet.Document intelligence

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall