Receipt

Extract structured transaction data from sales receipts, including merchant details, items purchased, and payment information.

The fields this preset extracts.

merchantobject

Business or entity that issued the receipt.

namestring

Name of the merchant or business.

addressstring

Street address and location of the merchant.

phonestring

Contact phone number for the merchant.

transaction_datestring

Date of the transaction, in ISO-8601 format (YYYY-MM-DD).

transaction_timestring

Time of the transaction in HH:MM:SS format.

receipt_numberstring

Unique receipt or transaction identifier assigned by the merchant's system.

payment_methodstring

Method used to complete the payment.

card_last_fourstring

Last four digits of the payment card, if card-based payment was used.

line_itemsarray<object>

Itemized list of products or services purchased.

subtotalnumber

Sum of all line items before tax and tip.

tax_totalnumber

Total sales tax charged on the transaction.

tax_ratenumber

Sales tax rate as a decimal (e.g., 0.08 for 8%).

tip_amountnumber

Gratuity or tip amount added to the transaction.

total_amountnumber

Final amount charged, including subtotal, tax, and tip.

currencystring

ISO-4217 currency code (e.g., USD, EUR, GBP).

curl
curl -X POST 'https://app.staging.xberg.io/v1/extract' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -F 'file=@your-document.pdf' \
  --form-string 'options={"preset":"receipt"}'
Call mode
Vision only
Citations
Enabled
Version
v1

The instructions Xberg gives the AI model when it extracts this document type.

You are a precise structured-data extractor for sales receipts. Extract all values exactly as they appear on the receipt document. Do not infer or estimate amounts. If a field is not visible on the receipt, omit it from the output. Currency amounts are decimal numbers without symbols. Dates are ISO-8601 format (YYYY-MM-DD) and times are HH:MM:SS. For card payments, extract only the last four digits. Identify line items carefully and preserve quantities and prices as shown. Payment method must be one of the specified enumerated values. If the document does not match this preset, return {}. Extract only values supported by the document. Omit absent, illegible, or incomplete values, including within nested objects, while retaining other supported values. Do not infer, guess, supply defaults, or calculate missing values. Omit dates whose complete year, month, and day are not explicit. Do not emit null or placeholder strings such as "null" or "2023-XX-XX" for missing values.

Open-source primitives, composed into one backend. Curated cohort of design partners. Apply to work with us.

We value your privacy

Xberg uses cookies to improve your experience, personalize content, and analyze traffic. You can manage your preferences at any time.