billing

PUT /v1/billing/payment-preferences

Elect (or stop) paying by crypto.

ټول billing پای ټکي

ټول د پراختیا کونکي اسناد

تصدیق‌هویت

یو API کی د بیئرر ټوکن (bearer token) په توګه ولیکئ. کی باید د billing.payment.manage اجازه ولري؛ له دې اجازې پرته کی د 404 پرځای د 403 په واسطه رد کیږي.

چیرته چې ستاسو د سازمان آی ډي ځي

دا پای ټکی د پوښتنې پیرامیتر په توګه 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 په وړاندې پرمخ وړي ترڅو تاسو وکولی شئ اصلي ځواب وګورئ. دا پای ټکی (endpoint) د 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