Convert
Receipts
to
JSON

Simple API to extract all relevant receipt information (line-items included) into a JSON object.

Usage based pricing

0.05
/ receipt

Perfect for on demand usage

Includes 3 free receipts

Need More?

Contact Me

I'm super happy to learn from you!

I'm pretty friendly :)

Please show don't tell!


1. Get an image of a receipt

Tip: Scroll down to see the ouput json

Lolli Park Receipt image

2. Send the receipt to our API

Our API expects the image to be in base64 format.
So let's load it and convert it to base64.

import fs from "fs";

// use {encoding: "base64"} to load the image already as base64
const base64_image = fs.readFileSync("receipt.jpg", { encoding: "base64" });

Next we need to send it to our api.

  • API: https://www.line-items.com/api/scanner
  • Headers
    • Content-Type: application/json
    • x-api-key: <api-key>
  • Body: {"receipt64":base64_image}

const response = await fetch("https://www.line-items.com/api/scanner", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": "<api-key>",
  },
  body: JSON.stringify({
    receipt64: base64_image,
  }),
});

const scannedReceipt = await response.json();
console.log("scannedReceipt", scannedReceipt);

3. 🥳 Success. We received a wonderful JSON

Tip: Our api always returns a JSON. Even if something fails.

{
    "receipt": {
        "storeName": "Lollipop Park",
        "storeAddress": "Tennispointstraße 1, 4061 Pasching",
        "storePhoneNumber": null,
        "storeWebpage": "www.lollipark.at",
        "storeType": "Amusement Park/Recreation Center",
        "lineItems": [
          {
            "description": "TK Erwachsene",
            "unitPrice": 6,
            "totalPrice": 12,
            "currency": "EUR",
            "quantity": 2,
            "productType": "Ticket for Adults"
          },
          {
            "description": "TK Kind",
            "unitPrice": 12,
            "totalPrice": 12,
            "currency": "EUR",
            "quantity": 1,
            "productType": "Ticket for Child"
          }
        ],
        "date": "2023-10-28T10:43:36"
      },
      "error": false,
      "status": 200,
      "message": "Success. Looks like everything was working nicely!"
}