Your product.
Our invoice capture.

Build invoice and receipt capture into your SaaS product or internal workflow. Send documents to Datamolino and retrieve structured fields your application can use.

How the capture API works.

Upload invoices and receipts

Send PDFs and receipt images from your application into a Datamolino folder through the API.

Receive a completion webhook

Let a webhook notify your integration when processing finishes. Use polling as a fallback, then retrieve the result.

Use the extracted fields

Retrieve structured invoice fields, totals and the agreed line-item data for your application.

Your first request in the sandbox.

Get an access token, upload one invoice and fetch its captured data. The values are the demo values from the API documentation: replace them with your sandbox credentials, folder ID (agenda_id) and document ID.

Request (cURL)
# Sandbox host (see Getting started)
HOST=https://beta.datamolino.com

# 1. Get an OAuth access token (valid for 2 hours)
curl --request POST "$HOST/oauth/token" \
  --header 'Content-Type: application/json' \
  --data '{
    "client_id": "demo_client_id",
    "client_secret": "demo_client_secret",
    "username": "integrator@example.com",
    "password": "demo_password",
    "grant_type": "password"
  }'

# 2. Upload one invoice as URL-safe base64 and store the returned document id
curl --request POST "$HOST/api/v1_2/documents" \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer demo_access_token' \
  --data '{
    "documents": [{
      "files": [{
        "filename": "demo-supplier-invoice.pdf",
        "content_type": "application/pdf",
        "content": "JVBERi0xLjQgZGF0YW1vbGluby1kZW1v"
      }],
      "agenda_id": 12345,
      "file_split": false,
      "type": "PurchaseInvoice"
    }]
  }'

# 3. After the EXTRACTION_FINISHED webhook (or a backup poll), fetch the result
curl --request GET "$HOST/api/v1_2/documents/315940" \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer demo_access_token'
Response excerpt (Fetch Document, 200 OK, trimmed)
{
  "documents": [
    {
      "id": 315940,
      "type": "PurchaseInvoice",
      "state": "ready",
      "verificator_response": "ok",
      "data": {
        "header": {
          "invoice_no": "INV-2026-00039",
          "issue_date": "2017-02-28",
          "currency": "EUR"
        }
      },
      "supplier": { "name": "Demo Supplier Ltd", "vat_id": "IE6388047V" },
      "summary": { "sub_total": 102, "vat_total": 0, "total": 102 },
      "items": [
        { "id": 389633, "name": "Demo Supplier Ltd", "subtotal": 96 },
        { "id": 389634, "name": "Demo Supplier Ltd", "subtotal": 6 }
      ]
    }
  ]
}

Agree the output your application needs.

Tell us which document types and fields you need, how many documents you process and what should happen when information is missing. We’ll confirm the capture output and review arrangements.

Start in the sandbox with OAuth authentication. Agree the data contract, completion mechanism and commercial terms before processing production documents.

The API supports invoice and receipt capture. It does not provide bank statement conversion, invoice coding or approval workflow controls.

Connect an authorised inbox to capture.

Your authorised application can select invoice attachments from a mailbox, upload them to Datamolino and retrieve the capture result for its next step.

Mailbox access, document selection, record matching and downstream actions belong to your integration. There is no built-in mailbox or agent connector in this workflow.

Invoice OCR API questions.

Which file formats can I upload?

PDF (text or scanned, one or many pages), TIFF, JPEG and PNG images, and ZIP, RAR or 7ZIP archives of those files. Send each file as a URL-safe base64 string with its content type, one file per document, and keep each request under about 20 MB. Automatic splitting turns a multipage file into separate documents, up to 200 pages.

How do I get sandbox access and authenticate?

Contact us to agree the integration scope and the fields you need: API access is enabled per integration. You develop against the sandbox at https://beta.datamolino.com/api/v1_2 and move the same workflow to https://app.datamolino.com/api/v1_2 for production. Exchange your client credentials for an OAuth access token, valid for 2 hours, and store the refresh token that comes with it. The reference covers the password, authorisation code and PKCE flows. Keep the client secret and tokens on your server.

Should I use webhooks or polling?

Use a webhook as the completion signal and register it before you upload. Each client app has one HTTPS endpoint, you choose the event types (for example EXTRACTION_FINISHED), and each payload is signed with HMAC-SHA256 using the key returned when you create the webhook. Delivery is attempted up to 10 times, the last about 7 hours after the first. As a backup, list documents with modified_since every few hours to catch anything missed while your endpoint was down.

What does the API return for each document?

Fetch Document returns the document state and the captured data: header fields such as invoice number, issue date, due date and currency; supplier and customer name and VAT ID; the summary with subtotal, VAT and total; tax lines; and line items with code, name, quantity, unit price, tax rate and amounts. The exact fields are agreed for your integration, and some, such as supplier address and bank details, are not provided by default. A not_ready state comes with the reason in verificator_response.

What is outside the API scope?

The API supports invoice and receipt capture. It does not provide bank statement conversion, invoice coding or approval workflow controls. Mailbox access, document selection, record matching and downstream actions belong to your integration.

Explore the capture API.

Use the request examples, webhook flow and response fields to plan the integration. Contact our team to agree access and test representative documents.