billing

PUT /v1/billing/payment-preferences

Elect (or stop) paying by crypto.

Бүх billing төгсгөлийн цэгүүд

Баталгаажуулалт

API түлхүүрийг bearer token хэлбэрээр илгөэнэ үү. Түлхүүр нь billing.payment.manage эрхтэй байх ёстой бөгөөд үүнгүйгээр 404 биш, харин 403 алдаа буцааж татгалзах болно.

Таны байгууллагын дугаар орох газар

Энэ төгсгөл цэг нь org_id-г асуулгын параметр болгон авдаг. Үүнийг орхивол дуудлага таны бүх түрээсийн дэд модыг хамрах бөгөөд дуудлагыг зөвхөн нэг байгууллагаар хязгаарлахын тулд үүнийг илгээнэ үү.

Танай байгууллагын ID нь таны хяналтын самбар дээрх API түлхүүрийн дэлгэцэнд, түлхүүр өөрөө хажууд байрладаг. Энэ нь таны хийх дуудлага бүрт ижил ID байна.

Туршиж үзэх

Өнцөг хаалтанд байгаа бүх зүйлийг өөрийн утгаар солиж, түлхүүр санамж байрлуулагчийг хяналтын самбарынхаа түлхүүрээр сольж оруулна уу.

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 cha…

Хариу үйлдэл

НэрТөрөлЗаавал шаардлагатайЭнэ юу вэ
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 gate…

Энэ төгсгөл цэгээс буцааж болох алдаанууд

401 · 403 · 409 · 422