Receipt template

Convert receipts to JSON

Snap a receipt or upload a PDF and get back the merchant, date and time, each item, tax, tip, total and how it was paid, as typed JSON ready for an expense report or a ledger.

No account needed for the Playground. The receipt template is already picked for you.

At a glance

  • 20 fields, including items
  • PDF, PNG and JPEG, including scans and photos
  • Output: JSON, Excel (.xlsx), CSV
  • Built to return null instead of guessing
  • Documents are not stored after a request finishes
  • Good for: expense reports, personal finance and budgeting apps, reimbursement workflows

Fields

What gets extracted

The receipt template, exactly as it is saved in a new workspace. Every key comes back in the response. A value that is not on the document is null.

FieldType
merchant_namerequiredstring
merchant_addressstring
merchant_phonestring
merchant_tax_idVAT, GST, or other tax registration number.string
receipt_numberReceipt, transaction, or bill number.string
transaction_daterequireddate
transaction_time24-hour time as HH:MM.string
currencyISO 4217 code, for example USD, EUR, or LKR.string
subtotalnumber
discountnumber
tax_amountnumber
tipnumber
totalrequiredAmount paid.number
payment_methodFor example cash, card, or mobile wallet.string
card_last4Last four digits of the card, if printed.string
itemsrequiredOne entry per purchased item, in receipt order.object[]
└ descriptionrequiredstring
└ quantitynumber
└ unit_pricenumber
└ amountrequiredLine total.number

Key fields

Receipt fields worth knowing

What the trickier fields in the receipt template hold, and how they relate.

  • total

    The amount paid. subtotal, discount, tax_amount and tip are separate fields, each copied as printed, so a receipt with no tip line returns tip as null.

  • transaction_date and transaction_time

    The date comes back as yyyy-mm-dd and the time in 24-hour HH:MM, so 1:42 PM is 13:42.

  • payment_method and card_last4

    payment_method is how the receipt says it was paid, for example cash, card or a mobile wallet. card_last4 holds only the last four digits, and only when they are printed.

Example

From receipt to JSON

An illustrative receipt with a made-up company and numbers, and the JSON the receipt template returns for it. Fields that are not on the document come back as null.

Input: made-up example receipt
Phone photo of a crumpled Green Leaf Cafe thermal receipt on a wooden table: bill R-20931 on 28/10/2026 at 13:42, 2 iced lattes and a chicken sandwich, tip 335.00, total LKR 3,685.00 paid by Visa ending 4821
Output: values
{
  "merchant_name": "Green Leaf Cafe",
  "merchant_address": "88 Galle Road, Colombo 04",
  "merchant_phone": "+94 11 255 0199",
  "merchant_tax_id": null,
  "receipt_number": "R-20931",
  "transaction_date": "2026-10-28",
  "transaction_time": "13:42",
  "currency": "LKR",
  "subtotal": 3350,
  "discount": null,
  "tax_amount": null,
  "tip": 335,
  "total": 3685,
  "payment_method": "card",
  "card_last4": "4821",
  "items": [
    {
      "description": "Iced latte",
      "quantity": 2,
      "unit_price": 950,
      "amount": 1900
    },
    {
      "description": "Chicken sandwich",
      "quantity": 1,
      "unit_price": 1450,
      "amount": 1450
    }
  ]
}

Common gotchas

Where receipt extraction trips up

Things that often catch people out with receipt data, and how to handle them.

  • Abbreviated item names

    Tills often print short names such as CHKN SNDWCH. items[].description is copied as printed, not expanded, so map those names to your own products after extraction.

  • Photos at an angle

    Photos are turned upright from their EXIF orientation and scaled to at most 2048 pixels on the long edge before the model reads them. A flat, well-lit photo with the whole receipt in frame reads best.

  • Discounts and refunds

    A discount or refund printed in parentheses or with a trailing minus is read as a negative number. discount holds the printed discount total, if there is one.

How it works

Three steps, no setup.

  1. Step 1

    Upload the document

    Drop a receipt into the Playground, or send it base64 encoded to the API. PDF, PNG and JPEG all work.

  2. Step 2

    Pick the template

    Choose the receipt schema. It is already in every new workspace and guest browser, and you can edit its fields.

  3. Step 3

    Get typed JSON

    The model fills exactly the schema's keys, with numbers as numbers and dates as yyyy-mm-dd. Copy it or use it from your code.

API

Parse a receipt with one request

Send the file to POST /api/v1/parse with "schema": "receipt". The saved template is used by name, so there is nothing else to send.

Create an API key in your workspace after you sign up. If you deleted or renamed the template, pass the schema definition inline instead of its name. The same call is available to AI agents through the MCP server.

Read the API docs
POST /api/v1/parse
curl -X POST https://doc2json.manoonlabs.com/api/v1/parse \
  -H "Authorization: Bearer $DOC2JSON_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"file_base64\": \"$(base64 -w0 receipt.pdf)\", \"schema\": \"receipt\"}"

Schema

The receipt schema

The JSON Schema behind the receipt template. Paste it into the schema editor as a starting point, or send it inline as "schema" in an API request if you deleted or renamed the template.

{
  "type": "object",
  "description": "A sales receipt from a shop, restaurant, or other merchant.",
  "properties": {
    "merchant_name": {
      "type": "string"
    },
    "merchant_address": {
      "type": "string"
    },
    "merchant_phone": {
      "type": "string"
    },
    "merchant_tax_id": {
      "type": "string",
      "description": "VAT, GST, or other tax registration number."
    },
    "receipt_number": {
      "type": "string",
      "description": "Receipt, transaction, or bill number."
    },
    "transaction_date": {
      "type": "date"
    },
    "transaction_time": {
      "type": "string",
      "description": "24-hour time as HH:MM."
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 code, for example USD, EUR, or LKR."
    },
    "subtotal": {
      "type": "number"
    },
    "discount": {
      "type": "number"
    },
    "tax_amount": {
      "type": "number"
    },
    "tip": {
      "type": "number"
    },
    "total": {
      "type": "number",
      "description": "Amount paid."
    },
    "payment_method": {
      "type": "string",
      "description": "For example cash, card, or mobile wallet."
    },
    "card_last4": {
      "type": "string",
      "description": "Last four digits of the card, if printed."
    },
    "items": {
      "type": "array",
      "description": "One entry per purchased item, in receipt order.",
      "items": {
        "type": "object",
        "properties": {
          "description": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "unit_price": {
            "type": "number"
          },
          "amount": {
            "type": "number",
            "description": "Line total."
          }
        },
        "required": [
          "description",
          "amount"
        ]
      }
    }
  },
  "required": [
    "merchant_name",
    "transaction_date",
    "total",
    "items"
  ]
}

FAQ

Receipt to JSON, answered.

Can I send a photo straight from my phone?

Yes. JPEG and PNG photos are supported. Images are turned upright and scaled down before they go to the model, so large phone photos are fine within the upload size limit.

Can I download receipts as a spreadsheet?

Yes. Download the result as Excel (.xlsx) or CSV from the Playground, or add export=xlsx or export=csv to the API request. The CSV has one row per item with the merchant, date and totals on every row, ready for an expense sheet.

Do you store my receipt documents?

No. The file is processed in memory for the request and then dropped. Neither the document nor the extracted JSON is saved. Only a usage record is kept, with things like the time, page count and credits used.

Can I change the fields?

Yes. Every new workspace, and every guest browser, starts with the receipt template as a normal schema. Edit it, rename keys, add fields or delete it. Changes are yours, and a deleted template does not come back.

What happens when a value is not on the document?

It comes back as null. doc2json is built to return null instead of guessing, so you can tell missing data from real data.

Is it free to try?

Yes. The Playground works without an account, using a small guest allowance. A free account adds monthly credits, saved schemas and an API key. One credit is one page.

Try it on your own receipt.

Open the Playground with the receipt template picked, drop in a file, and see the JSON. Sign up free when you want an API key.