agency-time
POST /v1/agency/time/billing-runs
Bill now — turn unbilled time into a draft invoice.
Authentification
Envoyez une clé d'API en tant que jeton du porteur (bearer token). Cet endpoint n'indique pas de permission spécifique dans la spécification, attribuez donc à votre clé le minimum requis et vérifiez la réponse plutôt que de faire des suppositions.
Où insérer l'ID de votre organisation
Cet endpoint prend org_id comme champ dans le corps JSON.
L'identifiant de votre organisation se trouve sur l'écran des clés API de votre tableau de bord, à côté de la clé elle-même. Il s'agit du même identifiant pour chaque appel que vous effectuez.
Essayer
Remplacez tout ce qui se trouve entre crochets par vos propres valeurs, et le espace réservé à la clé par une clé de votre tableau de bord.
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> }'Connecté ? La console d'API de votre tableau de bord saisit votre véritable ID d'organisation ainsi que votre propre clé, et exécute la requête sur l'API de production afin que vous puissiez voir la réponse réelle. Ouvrir ce point de terminaison dans la console API
Détails
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.
Corps de la requête
| Nom | Type | Obligatoire | Qu'est-ce que c'est |
|---|---|---|---|
client_id | string | Oui | — |
currency | string | Oui | — |
until | string | Non | Bill work up to and including this date — "everything to the end of last month". |
notes | string | Non | — |
org_id | string | Non | — |
Réponse
| Nom | Type | Obligatoire | Qu'est-ce que c'est |
|---|---|---|---|
id | string | Oui | — |
client_id | string | Non | — |
currency | string | Oui | — |
period_start | string | Non | — |
period_end | string | Non | — |
trigger | string<manual, on_log, day_of_month, threshold> | Oui | — |
status | string<claimed, invoiced, failed, released> | Oui | `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 | Oui | Our own exact arithmetic, before tax. What the invoice is reconciled against. |
minutes_total | integer | Oui | — |
duration_label | string | Non | — |
entry_count | integer | Non | — |
fixed_line_count | integer | Non | — |
invoice_id | string | Non | — |
invoice_number | string | Non | — |
invoice_created | boolean | Non | 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> | Non | 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 | Non | — |
invoiced_at | string | Non | — |
released_at | string | Non | — |
last_error | string | Non | — |
created_at | string | Oui | — |
actual | object | Non | 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. |
Erreurs que cet point de terminaison peut renvoyer
401 · 403 · 422