billing
PUT /v1/billing/payment-preferences
Elect (or stop) paying by crypto.
Autentizace
Zašlete API klíč jako nosný token (bearer token). Klíč musí mít oprávnění billing.payment.manage; klíč bez něj je odmítnut s kódem 403, nikoli 404.
Sem patří ID vaší organizace
Tento koncový bod přijímá org_id jako parametr dotazu. Pokud ho vynecháte, volání pokryje celý podstrom vašeho nájemce; jeho odesláním volání zúžíte na jednu organizaci.
ID vaší organizace najdete na obrazovce API klíčů ve vašem přehledu, hned vedle samotného klíče. Je to stále stejné ID v každém volání, které provedete.
Vyzvednout
Nahraďte cokoli v závorkách vlastními hodnotami a zástupný symbol klíče klíčem z vašeho řídicího panelu.
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> }'Přihlášeni? Konzole API ve vašem dashboardu automaticky doplní vaše skutečné ID organizace i váš vlastní klíč a odešle požadavek na živé API, abyste viděli reálnou odpověď. Otevřete tento koncový bod v konzoli API
Podrobnosti
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
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
org_id (query) | Uuid | Ne | The organization to update. Omitted or empty means the caller's own. |
Tělo požadavku
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
pays_by_crypto | boolean | Ano | 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 cha… |
Odpověď
| Název | Typ | Požadováno | Co to je |
|---|---|---|---|
org_id | string | Ano | — |
pays_by_crypto | boolean | Ano | 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_id | string | Ano | The mandate charged first, or `null` if none is nominated or usable. |
backup_payment_method_id | string | Ano | The mandate charged if the primary declines. |
auto_renew_possible | boolean | Ano | 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_reachable | boolean | Ano | 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 gate… |
Chyby, které může tento koncový bod vrátit
401 · 403 · 409 · 422