billing
PATCH /v1/cdn/credit
Set the spend cap, or turn auto-top-up on or off.
Упълномощаване
Изпратете API ключ като токен за носене. Ключът трябва да притежава разрешението billing.payment.manage; ключ без него се отхвърля с 403, а не с 404.
Този ендпойнт не изисква идентификатор на организация. Вашият ключ вече идентифицира организацията, към която принадлежи, и отговорът е ограничен до нея.
Опитайте
Заменете всичко в квадратни скоби със собствени стойности, а ключовия заместващ символ – с ключ от вашето табло за управление.
curl -X PATCH https://api.zinndigital.com/v1/cdn/credit \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'Влязохте ли в профила си? API конзолата във вашето табло за управление попълва действителното идентификационно число на вашата организация и вашия собствен ключ и изпълнява заявката спрямо реалното API, за да можете да видите действителния отговор. Отворете този крайpoint в API конзолата
Детайли
The spend cap is the customer's and it is enforced, not advisory: reaching it pauses metered serving. It has a platform minimum, below which a cap would pause an account before it could do anything useful. Auto-top-up refills the balance so serving continues below the ceiling. It never raises the ceiling — a top-up that moved the cap would make the cap unreachable and turn a spending limit into a delay. Raising the cap above current spend resumes an account paused by that cap. It does not resume one paused by staff, or one paused because the account is not in good standing; those need the thing that actually caused them. Reading the balance is billing.view; changing a ceiling is a money change and requires billing.payment.manage.
Тяло на заявката
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
spend_cap_minor | integer | Не | — |
auto_top_up | boolean | Не | — |
auto_top_up_amount_minor | integer | Не | — |
Отговор
| Име | Тип | Задължително | Какво представлява |
|---|---|---|---|
currency | string | Да | — |
balance_minor | integer | Да | — |
spend_cap_minor | integer | Да | The customer's own ceiling. Enforced, not advisory. |
spent_period_minor | integer | Да | — |
min_spend_cap_minor | integer | Да | The lowest cap the platform accepts. |
auto_top_up | boolean | Да | On by default. Refills the balance so serving continues below the cap; it never raises the cap. |
auto_top_up_amount_minor | integer | Да | — |
state | string<active, paused_cap, paused_standing, paused_admin> | Да | — |
paused_reason | string | Не | — |
worst_case_overshoot_minor | integer | Не | How far past the cap spending can run before the next usage sample stops it. Reported rather than hidden: the cap cannot be exact, and a product promising a ceiling it cannot hold… |
Грешки, които този крайpoint може да върне
401 · 403 · 404 · 422 · 429