agency-time

POST /v1/agency/time/schedules

Set a client's billing trigger.

Све agency-time крајње тачке

Сва документација за програмере →

Аутентификација

Пошаљите API кључ као bearer токен. Ова крајња тачка не наводи конкретну дозволу у спецификацији, па свом кључу доделите најмања неопходна овлашћења и проверите одговор уместо да претпостављате.

Где се уноси ID ваше организације

Ова крајња тачка узима org_id као поље у JSON телу.

Идентификатор ваше организације се налази на екрану са API кључевима на вашој контролној табли, поред самог кључа. То је исти идентификатор у сваком позиву који упутите.

Испробајте

Замените све што је у угластим заградама сопственим вредностима, а чувар места кључа кључем са своје контролне табле.

curl -X POST https://api.zinndigital.com/v1/agency/time/schedules \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "trigger": <string<manual, on_log, day_of_month, threshold>> }'

Пријављени сте? API конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом API-ју како бисте могли да видите стварни одговор. Отворите ову крајњу тачку у API конзоли

Детаљи

Idempotent by (org, client) — a second POST updates rather than creating a second row, because two schedules for one client is the arrangement that bills them twice. Four triggers: manual (on demand only), on_log (immediately, as time is logged), day_of_month, and threshold (when unbilled work reaches an amount). ⛔ day_of_month is 1–28, and that is not a limitation of the storage. A schedule set to the 31st would silently skip February, April, June, September and November — seven months a year in which the agency is not paid and nothing is red. "The end of the month" is expressed as 28.

Тело захтева

НазивТипОбавезноШта је ово
client_idstringНе—
triggerstring<manual, on_log, day_of_month, threshold>Да—
day_of_monthintegerНе—
threshold_minorintegerНе—
currencystringНе—
activebooleanНе—
org_idstringНе—

Одговор

НазивТипОбавезноШта је ово
idstringДа—
client_idstringНеnull is the organisation-wide DEFAULT, covering every client without a row of its own. A per-client row replaces it rather than layering on it.
triggerstring<manual, on_log, day_of_month, threshold>Да—
day_of_monthintegerНе⛔ 1–28. The 29th to the 31st do not exist in every month, so a schedule set to the 31st would silently skip five of them a year.
threshold_minorintegerНе—
currencystringДа—
activebooleanДа—
next_run_atstringНе—
last_attempted_atstringНеStamped for every schedule the sweep REACHES, before its result is read — so a client whose invoice fails still leaves the front of the queue.
last_succeeded_atstringНеA SECOND column, deliberately: one column cannot serve as both the cursor the sweep advances and the signal a staleness alarm reads.
last_errorstringНе—

Грешке које ова крајња тачка може вратити

401 · 403 · 422