billing

PUT /v1/billing/payment-preferences

Elect (or stop) paying by crypto.

Усі кінцеві точки billing

Уся документація для розробників

Автентифікація

Надішліть ключ API як маркер носія (bearer token). Ключ повинен мати дозвіл billing.payment.manage; ключ без нього відхиляється з кодом 403, а не 404.

Де вказується ідентифікатор вашої організації

Цей ендпоїнт приймає org_id як параметр запиту. Залиште його порожнім, і виклик охопить увесь ваше дерево орендарів; надішліть його, щоб звузити виклик до однієї організації.

Ідентифікатор вашої організації знаходиться на екрані API-ключів у вашій панелі керування, поруч із самим ключем. Це той самий ідентифікатор у кожному вашому запиті.

Спробувати

Замініть усе в кутових дужках власними значеннями, а заповнювач ключа — ключем із вашої панелі керування.

curl -X PUT https://api.zinndigital.com/v1/billing/payment-preferences \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "pays_by_crypto": <boolean> }'

Увійшли в систему? Консоль API у вашій панелі керування автоматично підставляє ваш реальний ідентифікатор організації та ваш власний ключ, а також виконує запит до робочого API, щоб ви могли побачити справжню відповідь. Відкрийте цю кінцеву точку в консолі API

Деталі

Requires billing.payment.manage — the same key that gates adding and removing a payment method, because this is a payment-method decision. ⛔ Not billing.invoice.manage: it changes what we can charge, not what prints on an invoice. Turning crypto off answers 409 when it is currently the only way the account can be charged and something is still going to charge it. The floor is on the resulting state, not on one of the two actions that can breach it — otherwise a customer could satisfy it with crypto, delete their last card, then switch crypto off.

Параметри

НазваТипОбов'язковеЩо це таке
org_id (query)UuidНіThe organization to update. Omitted or empty means the caller's own.

Тіло запиту

НазваТипОбов'язковеЩо це таке
pays_by_cryptobooleanТакElect (or stop) paying by crypto. ⛔ Turning it off is refused with 409 when crypto is currently the only way the account can be charged and something is still going to…

Відповідь

НазваТипОбов'язковеЩо це таке
org_idstringТак
pays_by_cryptobooleanТакThe account pays in crypto (NOWPayments). Satisfies the "at least one operational payment method" floor with no card on file, and moves the account to invoice-ahead renewal —…
primary_payment_method_idstringТакThe mandate charged first, or null if none is nominated or usable.
backup_payment_method_idstringТакThe mandate charged if the primary declines.
auto_renew_possiblebooleanТакWhether this account can be charged unattended at all. false for a crypto-only account, and for one whose only mandates are rails Stripe will not let us reuse — both renew by…
fallback_reachablebooleanТакWhether the nominated backup could actually catch the primary's decline. false when there is no backup, or when it sits on a different gateway — a charge resolves one…

Помилки, які може повертати ця кінцева точка

401 · 403 · 409 · 422