billing

POST /v1/subscriptions/{subscriptionId}/billing-rail

Choose which clock charges this subscription.

सभी billing एंडपॉइंट्स

सभी डेवलपर दस्तावेज़

प्रमाणन

बेरर टोकन के रूप में एक API कुंजी भेजें। कुंजी के पास billing.payment.manage अनुमति होनी चाहिए; इसके बिना एक कुंजी को 404 के बजाय 403 के साथ अस्वीकार कर दिया जाता है।

यह एंडपॉइंट कोई संगठन आईडी नहीं लेता है। आपकी कुंजी पहले से ही उस संगठन की पहचान करती है जिससे वह संबंधित है, और प्रतिक्रिया उसी के दायरे में है।

इसे आज़माएँ

कोणार्कित ब्रैकेट्स में दी गई किसी भी चीज़ को अपने मानों से बदलें, और की प्लेसहोलर को अपने डैशबोर्ड की एक की से बदलें।

curl -X POST https://api.zinndigital.com/v1/subscriptions/{subscriptionId}/billing-rail \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "rail": <string<engine, paypal>> }'

साइन इन हैं? आपके डैशबोर्ड में मौजूद API कंसोल आपकी वास्तविक संगठन आईडी और आपकी अपनी कुंजी स्वतः भर देता है, और लाइव API के विरुद्ध अनुरोध चलाता है ताकि आप वास्तविक प्रतिक्रिया देख सकें। इस एंडपॉइंट को API कंसोल में खोलें

विवरण

Move a subscription between the engine rail (we invoice and charge on the renewal date) and the PayPal rail (PayPal charges on its own schedule under an agreement the customer approved). ADR 0029 records the boundary: PayPal owns only when the money is taken — the engine still owns what is owed, tax, entitlements, dunning and suspension. ⛔⛔ Switching to PayPal returns an approval_url and grants nothing. Until the buyer approves in PayPal's own interface and PayPal sends us a signed BILLING.SUBSCRIPTION.ACTIVATED webhook, the agreement cannot charge and the subscription's clock has not started. active is false for exactly that reason. The browser's return from the approval URL is an attacker-supplied claim and is never treated as approval. Switching away cancels the agreement at PayPal first and unbinds second. The reverse order would hand the subscription back to the engine's renewal sweep while PayPal was still entitled to charge it — a double charge for the window between the two calls. Requires billing.payment.manage. 422 carries a code: ALREADY_ON_RAIL, NO_CATALOGUE_PRICE, PRICE_WOULD_CHANGE (the subscription is on a price that differs from the published one, so switching would change what the customer pays — refused rather than done quietly), NOT_SWITCHABLE, or PAYPAL_REFUSED.

पैरामीटर

नामप्रकारआवश्यकयह क्या है
subscriptionId (path)UuidहाँThe subscription whose recurring rail is being changed.

अनुरोध बॉडी

नामप्रकारआवश्यकयह क्या है
railstring<engine, paypal>हाँ

प्रतिक्रिया

नामप्रकारआवश्यकयह क्या है
railstring<engine, paypal>हाँ
approval_urlobjectनहींWhere the buyer must approve the PayPal agreement. ⛔⛔…
activebooleanहाँWhether the named rail is charging yet. false immediately after switching to PayPal — a client that rendered "you are now billed by PayPal" here would be telling the customer…
paypal_subscription_idstringनहीं

त्रुटियाँ जो यह एंडपॉइंट लौटा सकता है

401 · 403 · 404 · 422 · 429