agency-time
POST /v1/agency/time/billing-runs
Bill now — turn unbilled time into a draft invoice.
Authentifizierung
Senden Sie einen API-Schlüssel als Bearer-Token. Dieser Endpunkt gibt in der Spezifikation keine spezifische Berechtigung an. Versehen Sie Ihren Schlüssel daher mit den minimal erforderlichen Rechten und prüfen Sie die Antwort, anstatt Annahmen zu treffen.
Hier kommt Ihre Organisations-ID hin
Dieser Endpunkt akzeptiert org_id als Feld im JSON-Body.
Die ID Ihrer Organisation finden Sie im Dashboard auf dem Bildschirm für API-Schlüssel direkt neben dem Schlüssel selbst. Sie ist bei jedem Ihrer Aufrufe dieselbe.
Ausprobieren
Ersetzen Sie alles in spitzen Klammern durch Ihre eigenen Werte und den Platzhalter für den Schlüssel durch einen Schlüssel aus Ihrem Dashboard.
curl -X POST https://api.zinndigital.com/v1/agency/time/billing-runs \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "client_id": <string>, "currency": <string> }'Angemeldet? Die API-Konsole in Ihrem Dashboard trägt automatisch Ihre echte Organisations-ID sowie Ihren eigenen Schlüssel ein und führt die Anfrage gegen die Live-API aus, sodass Sie die tatsächliche Antwort sehen können. Öffnen Sie diesen Endpunkt in der API-Konsole
Details
The owner's *"as well as sending on demand invoices"*. Claims the client's unbilled, priced work, hands it to the agency invoicing suite as a **draft**, and records what came back. ⛔ The entries are claimed in a committed transaction **before** the invoicing suite is called, so no other trigger can select them while the call is in flight. The idempotency key handed to the suite is derived from the sorted entry ids rather than minted, so a retry after a crash is given back the invoice that already exists instead of raising a second one for the same hours. `reconcile_state` is `ok` only when the invoice's total for these lines equals our own exact arithmetic. `mismatch` means do not send it.
Anfragekörper
| Name | Typ | Erforderlich | Was es ist |
|---|---|---|---|
client_id | string | Ja | — |
currency | string | Ja | — |
until | string | Nein | Bill work up to and including this date — "everything to the end of last month". |
notes | string | Nein | — |
org_id | string | Nein | — |
Antwort
| Name | Typ | Erforderlich | Was es ist |
|---|---|---|---|
id | string | Ja | — |
client_id | string | Nein | — |
currency | string | Ja | — |
period_start | string | Nein | — |
period_end | string | Nein | — |
trigger | string<manual, on_log, day_of_month, threshold> | Ja | — |
status | string<claimed, invoiced, failed, released> | Ja | `claimed` is the state between claiming the time and the invoicing suite's reply — a process that dies there leaves one, and the recovery pass finishes it with the same derived… |
subtotal_minor | integer | Ja | Our own exact arithmetic, before tax. What the invoice is reconciled against. |
minutes_total | integer | Ja | — |
duration_label | string | Nein | — |
entry_count | integer | Nein | — |
fixed_line_count | integer | Nein | — |
invoice_id | string | Nein | — |
invoice_number | string | Nein | — |
invoice_created | boolean | Nein | FALSE means the invoicing suite's idempotency key fired and handed back an invoice an earlier attempt had already raised. Surfaced rather than hidden: it is the observable that… |
reconcile_state | string<pending, ok, mismatch, unavailable> | Nein | Whether the invoice's total for these lines equals our own arithmetic **exactly**. There is no "close enough": both sides compute from the same two integers, so any difference i… |
reconcile_detail | string | Nein | — |
invoiced_at | string | Nein | — |
released_at | string | Nein | — |
last_error | string | Nein | — |
created_at | string | Ja | — |
actual | object | Nein | What this run actually consumed, derived from the time entries rather than read off the run's stored columns — so a divergence is visible on the screen. |
Fehler, die dieser Endpunkt zurückgeben kann
401 · 403 · 422