billing

PUT /v1/billing/payment-preferences

Elect (or stop) paying by crypto.

Wszystkie punkty końcowe billing

Uwierzytelnianie

Wyślij klucz API jako token bearer. Klucz musi posiadać uprawnienie billing.payment.manage; klucz bez niego jest odrzucany z kodem 403, a nie 404.

Miejsce na identyfikator organizacji

Ten punkt końcowy przyjmuje org_id jako parametr zapytania. Pomiń go, a wywołanie obejmie całe drzewo dzierżawy; prześlij go, aby ograniczyć wywołanie do jednej organizacji.

Identyfikator Twojej organizacji znajduje się na ekranie kluczy API w Twoim panelu, obok samego klucza. Jest to ten sam identyfikator w każdym wywołaniu, które wykonujesz.

Wypróbuj

Zastąp wszystko w nawiasach ostrych własnymi wartościami, a zastępczy znacznik klucza kluczem ze swojego pulpitu nawigacyjnego.

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> }'

Zalogowany? Konsola API w Twoim panelu uzupełnia rzeczywiste identyfikator organizacji oraz Twój własny klucz i wykonuje żądanie względem aktywnego API, dzięki czemu możesz zobaczyć rzeczywistą odpowiedź. Otwórz ten punkt końcowy w konsoli API

Szczegóły

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.

Parametry

NazwaTypWymaganeCo to jest
org_id (query)UuidNieThe organization to update. Omitted or empty means the caller's own.

Treść żądania

NazwaTypWymaganeCo to jest
pays_by_cryptobooleanTakElect (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 cha…

Odpowiedź

NazwaTypWymaganeCo to jest
org_idstringTak
pays_by_cryptobooleanTakThe 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_idstringTakThe mandate charged first, or `null` if none is nominated or usable.
backup_payment_method_idstringTakThe mandate charged if the primary declines.
auto_renew_possiblebooleanTakWhether 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_reachablebooleanTakWhether 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 gate…

Błędy, które ten punkt końcowy może zwrócić

401 · 403 · 409 · 422