Skip to main content
POST
Upload a receipt

Uploading a receipt

Send the request as multipart/form-data with the file contents in the file field. For example, the following request uploads a receipt PDF and attaches it to an existing ledger entry:
If transactionId is omitted, the document lands in the organisation’s document inbox, where it can be processed later — just like a manual upload in the app.

Supported file types

Files can be at most 10 MB in size, and must be one of the following types:
The actual contents of the uploaded file are validated. Files whose content does not match one of the supported types are rejected with a 415 Unsupported Media Type response and the error code files/unsupported-file-type, even if a supported content type or file extension is claimed in the request.

Live Capture analysis

If Live Capture is enabled for the organisation and analysis quota is available, an automatic document analysis starts after the upload, similar to uploading a receipt manually in the app. The analysis runs in the background and does not delay the response. To skip the automatic analysis for an upload, set the suppressAnalysis field to true.

Rate limits

Because uploads are materially more expensive to process than other requests, this endpoint has a stricter rate limit than the rest of the API: at most 100 requests per hour. When the limit is exceeded, you’ll receive a 429 Too Many Requests response with error code general/too-many-requests. Uploads are also processed in a background queue, so bursts of uploads within the rate limit (for example, an automation submitting dozens of receipts in a short window) are handled gracefully. Analyses from a large batch are processed a few at a time, so it can take several minutes until every document in the batch has finished analysing.

Authorizations

x-api-token
string
header
required

API token for authentication. Obtain from your Infinity account settings.

Body

multipart/form-data

The receipt file and its metadata as multipart/form-data.

file
file
required

The file to upload (maximum 10 MB). Supported content types:

  • application/pdf
  • image/png
  • image/jpeg
  • image/gif
  • image/tiff
  • image/heic
  • image/heif

The actual file content is validated, so the file must really be one of these types regardless of the declared content type or file extension.

title
string
required

A title or file name for the document.

Maximum string length: 200
Example:

"Coffee receipt 2025-01-30"

note
string

An optional note to store with the document.

Maximum string length: 1000
transactionId
string

The id of an existing ledger entry transaction to attach the receipt to. If set, the document is filed to the receipts location. If unset, the document lands in the inbox.

Example:

"682338d9e9500b3ffe4baa5a"

suppressAnalysis
enum<string>

If true, no automatic Live Capture document analysis is started for this upload. By default, analysis starts after upload if Live Capture is enabled for the organisation and analysis quota is available.

Available options:
true,
false

Response

The receipt was uploaded successfully.

receipt
Receipt · object
required

A receipt document that was uploaded to the organisation.