DocsGuides

Files you can send

Send whatever the customer has. The type is read from the file itself, and every type returns the same document object.

FileContent-Type for a raw bodyPages counted
A PDF from the bankapplication/pdfIts page count.
A scanned PDFapplication/pdfIts page count.
A photo of one pageimage/jpeg or image/pngOne.
A CSV, OFX or QIF exporttext/csv, application/x-ofx, application/qif or text/plainOne per 40 rows.

application/octet-stream works for any of them. Other accepted spellings are application/csv, application/vnd.ms-excel, application/ofx and application/vnd.intu.qbo. In a multipart request the part's own type does not matter.

A file the API does not read, such as an Excel workbook or a Word document, returns 415 unsupported_media_type whatever type you declare. Nothing is charged.

PDFs#

The PDF the bank issued, downloaded from online banking or attached to an email, is the best input there is: its amounts are read from its own text. A statement saved through the browser's print dialog is the same. Pages that are pictures inside a text PDF, such as a pasted-in table, are read from their images.

Scans and photos#

  • A scanned PDF, or a PDF with no text layer, is read from its page images.
  • A JPEG or PNG is one page of a statement. Send one photo per request; for a statement photographed page by page, combine the photos into one PDF first so its accounts and balances are read together.
  • Flat, well lit and in focus. A page cut off at the edge loses the rows on it.
  • Every document read from images carries the image_only authenticity signal.

Exports#

  • CSV, OFX and QIF files downloaded from online banking.
  • Rows the export marks as pending, declined, failed or cancelled are left out.
  • An export whose account column holds several accounts returns one entry per account in accounts.
  • Most exports print no balances, so there is less to check them against. See Verification.
  • An export has no file history, so authenticity.producer and its dates are null.

Password-protected PDFs#

Send the password in a multipart part named password, beside the file part. A raw body cannot carry one. Without it the response is 422 password_required; with the wrong one, 422 incorrect_password. Neither is charged. The password opens that one file and is not kept once the read is done.

curl -X POST https://statementbear.com/api/v1/documents \
  -H "Authorization: Bearer $STATEMENTBEAR_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -F file=@statement.pdf \
  -F password=01011990 \
  -F 'metadata={"applicationId":"app_8841"}'

Statements uploaded through a collection's hosted page cannot carry a password. The page asks the uploader to remove it.

Filenames and metadata#

  • The multipart part's filename becomes filename on the document. With a raw body, send it in an X-Filename header.
  • metadata is a JSON object of your own strings, sent as a multipart part, or as a metadata query parameter with a raw body. It comes back on the document and on its webhooks. Up to 20 keys of 1 to 40 characters, each value up to 500.
Something wrong or missing on this page? [email protected]