billing

PUT /v1/billing/payment-preferences

Elect (or stop) paying by crypto.

Све billing крајње тачке

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

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

Пошаљите API кључ као bearer токен. Кључ мора имати дозволу billing.payment.manage; кључ без ње се одбија уз 403, а не 404.

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

Ова крајња тачка прихвата 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 конзола на вашој контролној табли попуњава ваш прави id организације и ваш сопствени кључ, и покреће захтев према живом 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