agency-time

POST /v1/agency/time/schedules

Set a client's billing trigger.

すべての agency-time エンドポイント

認証

ベアラー トークンとして API キーを送信します。このエンドポイントでは仕様に特定の権限が記載されていないため、キーに必要な最小限の権限を付与し、推測するのではなくレスポンスを確認してください。

組織 ID を入力する場所

このエンドポイントは、JSONボディのフィールドとして org_id を受け取ります。

組織IDは、ダッシュボードのAPIキー画面にキーのすぐ横に表示されています。これは、実行するすべての呼び出しで同じIDになります。

試してみる

アングルブラケット内のすべてをご自身の値に置き換え、キーのプレースホルダーをご利用中のダッシュボードのキーに置き換えてください。

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