billing

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

Choose which clock charges this subscription.

सर्व billing एंडपॉइंट्स

प्रमाणीकरण

बेरर टोकन म्हणून API की पाठवा. की मध्ये billing.payment.manage परवानगी असणे आवश्यक आहे; ती नसलेली की 404 ऐवजी 403 सह नाकारली जाते.

या एंडपॉइंटला कोणतीही संस्था आयडी (organisation id) लागत नाही. तुमची की (key) आधीच ती कोणत्या संस्थेशी संबंधित आहे हे ओळखते आणि प्रतिसाद त्यानुसार मर्यादित केला जातो.

प्रयत्न करा

कोनसांस्कृतिक कंसात (<>) असलेली कोणतीही गोष्ट तुमच्या स्वतःच्या मूल्यांनी बदला आणि key प्लेसहोल्डरला तुमच्या डॅशबोर्डवरील किने बदला.

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 विरुद्ध विनंती कार्यान्वित करतो जेणेकरून तुम्हाला वास्तविक प्रतिसाद पाहता येईल. एपी कन्सोलमध्ये हा एंडपॉइंट उघडा

तपशील

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. ⛔⛔ **Until they approve there and PayPal sends us a signed `BILLING.SUBSCRIPTION.ACTIVATED`, nothing is agreed and nothing wil…
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