agency-time

POST /v1/agency/time/schedules

Set a client's billing trigger.

అన్ని agency-time ఎండ్‌పాయింట్లు

ప్రమాణీకరణ

ఒక API కీని బేరర్ టోకెన్‌గా పంపండి. ఈ ఎండ్‌పాయింట్ స్పెసిఫికేషన్‌లో నిర్దిష్ట అనుమతిని పేర్కొనలేదు, కాబట్టి ఊహించడం కంటే మీ కీకి అవసరమైన కనిష్ట అనుమతిని ఇవ్వండి మరియు ప్రతిస్పందనను తనిఖీ చేయండి.

మీ సంస్థ ఐడీ ఎక్కడ ఉందో అక్కడ

ఈ ఎండ్‌పాయింట్ JSON బాడీలో ఫీల్డ్‌గా org_id ని తీసుకుంటుంది.

మీ సంస్థ ఐడి (organisation id) మీ డాష్‌బోర్డ్‌లోని 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