billing
POST /v1/subscriptions/{subscriptionId}/billing-rail
Choose which clock charges this subscription.
പ്രമാണീകരണം
ബെയറർ ടോക്കണായി ഒരു 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 കൺസോൾ നിങ്ങളുടെ യഥാർത്ഥ ഓർഗനൈസേഷൻ ഐഡിയും നിങ്ങളുടെ സ്വന്തം കീയും പൂരിപ്പിക്കുകയും, യഥാർത്ഥ പ്രതികരണം (response) നിങ്ങൾക്ക് കാണുന്നതിനായി ലൈവ് API-ലേക്ക് അഭ്യർത്ഥന (request) പ്രവർത്തിപ്പിക്കുകയും ചെയ്യുന്നു. ഈ എൻഡ്പോയിന്റ് 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. |
അഭ്യർത്ഥന ബോഡി
| പേര് | തരം | ആവശ്യമാണ് | എന്താണിത് |
|---|---|---|---|
rail | string<engine, paypal> | അതെ | — |
പ്രതികരണം
| പേര് | തരം | ആവശ്യമാണ് | എന്താണിത് |
|---|---|---|---|
rail | string<engine, paypal> | അതെ | — |
approval_url | object | ഇല്ല | 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… |
active | boolean | അതെ | 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_id | string | ഇല്ല | — |
ഈ എൻഡ്പോയിന്റ് നൽകാൻ കഴിയുന്ന പിഴവുകൾ
401 · 403 · 404 · 422 · 429