DueBuddy
← DueBuddy

DueBuddy APIDueBuddy API

Разбор входящих счетов по API: загружаете счёт — получаете поля и файл для бухгалтерии. Балансовая модель, без подписки.Parse incoming invoices over REST: upload a document, get structured fields and an accounting-ready export. Prepaid balance, no subscription.

Что делает APIWhat the API does

Принимает чужой входящий счёт (от поставщика) и возвращает структурированные данные плюс файл для бухгалтерии. Мы не выставляем счета и не принимаем платежи по счетам ваших клиентов — только разбор.Takes an incoming supplier invoice and returns structured fields plus an accounting-ready file. We do not issue invoices and do not accept payments — parsing only.

Электронные счета читаем кодом — точно и без тарификации. Платите только за сканы и фото.Electronic invoices are parsed by code — exact and not charged. You pay only for scans and photos.

Быстрый стартQuick start

  1. Пополните баланс в кабинете (вход от 8 € / 790 ₽).Top up your balance in the dashboard (from €8 / ₽790).
  2. Создайте API-ключ. Ключ показывается один раз — сохраните его.Create an API key. The key is shown once — store it safely.
  3. Передавайте ключ в заголовке X-Api-Key.Send the key in the X-Api-Key header.

АвторизацияAuthentication

X-Api-Key: your_api_key_here

ЭндпоинтыEndpoints

МетодMethodPathЧто делаетPurpose
POST/v1/parseЗагрузить счёт (multipart: file, country)Upload an invoice (multipart: file, country)
GET/v1/parse/{job_id}Результат разбора и поляJob status and parsed fields
GET/v1/usageРасход и остаток балансаUsage and remaining balance
GET/v1/priceЦена (публично, без ключа)Price (public, no key)
GET/v1/countriesСтраны и форматы (публично)Countries and formats (public)

Интерактивная документация: /docs · /redoc · openapi.jsonInteractive reference: /docs · /redoc · openapi.json

ПримерыExamples

curl

curl -X POST https://duebuddy.work/v1/parse \
  -H "X-Api-Key: your_api_key_here" \
  -F "country=de" \
  -F "[email protected]"

# {"ok":true,"job_id":41,"status":"queued","charged":true}

curl https://duebuddy.work/v1/parse/41 \
  -H "X-Api-Key: your_api_key_here"

Python

import requests, time

BASE = "https://duebuddy.work/v1"
HEAD = {"X-Api-Key": "your_api_key_here"}

def parse(path, country="de"):
    with open(path, "rb") as f:
        r = requests.post(f"{BASE}/parse", headers=HEAD,
                          files={"file": f}, data={"country": country}, timeout=60)
    r.raise_for_status()
    job = r.json()
    for _ in range(30):                      # ждём результат
        time.sleep(2)
        out = requests.get(f"{BASE}/parse/{job['job_id']}", headers=HEAD, timeout=30).json()
        if out.get("status") in ("done", "failed"):
            return out
    raise TimeoutError("parse timeout")

res = parse("invoice.pdf", "de")
print(res["fields"])                          # поля счёта

JavaScript / Node

const fd = new FormData();
fd.append("country", "us");
fd.append("file", fileInput.files[0]);

const r = await fetch("https://duebuddy.work/v1/parse", {
  method: "POST",
  headers: { "X-Api-Key": API_KEY },
  body: fd
});
const { job_id } = await r.json();
const out = await fetch(`https://duebuddy.work/v1/parse/${job_id}`,
  { headers: { "X-Api-Key": API_KEY } }).then(r => r.json());
console.log(out.fields);

Оболочка для рабочего столаDesktop shell (drag & drop)

Сохраните как parse.html и откройте в браузере — перетащите файл, получите результат. Ключ хранится только в вашем браузере.Save as parse.html, open in a browser, drop a file in. The key stays in your browser only.

<!doctype html>
<meta charset="utf-8">
<title>DueBuddy parse</title>
<style>body{font:15px system-ui;margin:40px;max-width:640px}
#d{border:2px dashed #999;border-radius:12px;padding:40px;text-align:center}
pre{background:#f4f4f5;padding:14px;border-radius:8px;overflow:auto}</style>

<input id="k" placeholder="API key" style="width:100%;padding:8px">
<div id="d">Drop an invoice here (PDF / JPG / PNG / XML)</div>
<pre id="o">—</pre>

<script>
const d = document.getElementById("d"), o = document.getElementById("o");
d.ondragover = e => e.preventDefault();
d.ondrop = async e => {
  e.preventDefault();
  const f = e.dataTransfer.files[0];
  const fd = new FormData();
  fd.append("country", "de");
  fd.append("file", f);
  const head = { "X-Api-Key": document.getElementById("k").value };
  const j = await fetch("https://duebuddy.work/v1/parse",
              { method: "POST", headers: head, body: fd }).then(r => r.json());
  o.textContent = JSON.stringify(j, null, 2);
  for (let i = 0; i < 30; i++) {
    await new Promise(r => setTimeout(r, 2000));
    const out = await fetch("https://duebuddy.work/v1/parse/" + j.job_id,
                  { headers: head }).then(r => r.json());
    o.textContent = JSON.stringify(out, null, 2);
    if (out.status === "done" || out.status === "failed") break;
  }
};
</script>

Что читаемWhat we read

Что отдаёмWhat we return

{
  "ok": true,
  "job_id": 41,
  "status": "done",
  "fields": {
    "invoice_number": "RE-2026-04871",
    "invoice_date": "2026-09-14",
    "due_date": "2026-10-14",
    "vendor_name": "Hartmann GmbH",
    "net_amount": "1048.74",
    "vat_amount": "199.26",
    "gross_amount": "1248.00",
    "currency": "EUR"
  },
  "fields_detailed": [{"key": "gross_amount", "value": "1248.00", "edited": false}]
}

Набор полей зависит от страны (country). Дополнительно доступна выгрузка в формат страны: XRechnung, ZUGFeRD, DATEV, 1С, UBL, FatturaPA и др.Field set depends on country. Country-specific exports are also available: XRechnung, ZUGFeRD, DATEV, 1C, UBL, FatturaPA and more.

ОшибкиErrors

КодCodedetailПричинаReason
400unsupported_countryСтрана не поддерживаетсяCountry not supported
400unsupported_file_typeНе PDF/JPG/PNG/XMLNot PDF/JPG/PNG/XML
400empty_fileПустой файлEmpty file
413file_too_largeФайл больше лимитаFile exceeds the limit
429rate_limitedБольше 120 запросов в минутуOver 120 requests per minute

Лимиты и тарификацияLimits and billing

Смотрите такжеSee also

Мы обрабатываем входящие счета. Мы не выставляем счета от вашего имени и не принимаем платежи за вас.We process incoming invoices. We do not issue invoices on your behalf and do not accept payments for you.

MCP server: connect your AI assistant →