---
title: "Analyze an expense receipt"
method: POST
path: "/v1/expenses/ocr"
tags: ["Expenses"]
---

# Analyze an expense receipt

`POST /v1/expenses/ocr`

## Request

- Base URL: `https://api.paymongo.com`
- URL: `https://api.paymongo.com/v1/expenses/ocr`
- Auth: HTTP basic

Extracts merchant, amount, currency, date, category, and line-item details from a receipt.

## Request body `multipart/form-data`

- object
  - `file` string, binary, required: Receipt file
  - `expiration` integer: Temporary file expiration in minutes

## Response `200`

Receipt analyzed

- object: Standard response containing data and its metadata if any
  - `approved_count` integer
  - `approved_total_amount` integer
  - `data` ExpenseOCRResource
    - `amount` integer
    - `category` string
    - `created` string
    - `currency` string
    - `id` string
    - `items` ExpenseItemResponse[]
      - `amount` integer
      - `category` string
      - `currency` string
      - `id` string
      - `line_no` integer
      - `metadata` object
      - `name` string
      - `quantity` number
      - `tax_amount` integer
    - `merchant` string
    - `ocr_extracted` object
    - `rates` object
    - `tax` integer
    - `type` string
  - `has_more` boolean
  - `pending_count` integer
  - `rejected_count` integer
  - `total_amount` integer

## Other responses

- `400`: Invalid receipt file
- `401`: Missing or invalid secret key
- `500`: Internal server error
- `502`: OCR service failed

---

[API](https://skmtc.dev/paymongo/apis/expense-api.md) - [All operations](https://skmtc.dev/paymongo/apis/expense-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paymongo/apis/expense-api/revisions/521ade5edadd?raw)
