billing
POST /v1/subscriptions/{subscriptionId}/auto-renew
Turn a subscription's renewal on or off.
ప్రమాణీకరణ
బీయర్ టోకెన్గా API కీని పంపండి. కీ తప్పనిసరిగా billing.payment.manage అనుమతిని కలిగి ఉండాలి; అది లేని కీని 404 కాకుండా 403తో తిరస్కరిస్తారు.
ఈ ఎండ్పాయింట్ ఎలాంటి సంస్థ ఐడీని తీసుకోదు. మీ కీ ఇప్పటికే అది ఏ సంస్థకు చెందుతుందో గుర్తిస్తుంది మరియు ప్రతిస్పందన దానికే పరిమితం చేయబడుతుంది.
ప్రయత్నించండి
కోణీయ బ్రాకెట్లలో ఉన్న దేన్నైనా మీ స్వంత విలువలతో భర్తీ చేయండి, మరియు కీ ప్లేస్హోల్డర్ను మీ డాష్బోర్డ్ నుండి తీసుకున్న కీతో భర్తీ చేయండి.
curl -X POST https://api.zinndigital.com/v1/subscriptions/{subscriptionId}/auto-renew \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "auto_renew": <boolean> }'సైన్ ఇన్ చేశారా? మీ డ్యాష్బోర్డ్లోని API కాన్సోల్ మీ అసలైన సంస్థ ID మరియు మీ స్వంత కీని నింపుతుంది, అలాగే మీరు అసలైన ప్రతిస్పందనను చూడటానికి లైవ్ API ద్వారా ఆభ్యర్థనను రన్ చేస్తుంది. ఈ ఎండ్పాయింట్ను API కన్సోల్లో తెరిచండి
వివరాలు
The customer's renewal switch, and the only one there is. With auto_renew false the subscription runs to the end of the period already paid for and is then expired by the rebill sweep — nothing is minted, no card is charged, and the entitlements lapse at the same instant the period does. It is not an immediate cancellation: every day already bought is kept. With it true the subscription is selected by the nightly sweep at current_period_end, an order is minted and the payment method is charged. The switch is reversible right up to that moment, which is the customer's way back after turning it off. For a compute server the machine follows on its own: the provider's own renewal flag is pinned to "hold" for the life of every machine and is never exposed, so an unrenewed contract keeps serving for 24 hours, is powered down, and is deleted six days after that. Zinn® issues each vendor renewal explicitly, after the money is captured. Find a server's subscription with subscription_id on GET /v1/compute/servers/{serverId}/renewal. The response is the subscription as the database now holds it, not an echo of the request. Requires billing.payment.manage — the authority to decide what this account is charged. It deliberately does not require sites.view: a subscription is not a site, and this endpoint governs every plan, including ones that own no site. 404 for a subscription in another tenant as well as for one that does not exist — a 403 would confirm that an id belongs to somebody. 422 when the subscription has already ended (canceled/expired): writing true to a row the sweep can never select again would tell the customer they were covered when nothing will charge or serve them.
పారామీటర్లు
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
subscriptionId (path) | Uuid | అవును | The subscription whose renewal is being changed. |
అభ్యర్థన బాడీ
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
auto_renew | boolean | అవును | true to charge again at current_period_end; false to run to the end of the paid period and then expire. |
స్పందన
| పేరు | రకం | కావలసినది | ఇది ఏమిటి |
|---|---|---|---|
id | Uuid | అవును | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | అవును | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | SubscriptionStatus | అవును | A subscription's lifecycle state (docs/05 §1). |
plan | SubscriptionPlanRef | అవును | The pinned plan version a subscription was sold (a purchase-time snapshot). |
price | MoneyAmount | అవును | The captured price the subscriber pays (minor units + code, §2.8). |
interval | string<monthly, annual> | అవును | — |
entitlements | object | అవును | The resolved entitlements captured at purchase (feature/quota map). |
current_period_start | string | అవును | — |
current_period_end | string | అవును | — |
auto_renew | boolean | అవును | Whether this subscription charges again at current_period_end. false does not mean it has ended: it runs to the end of the period already paid for and is then expired.… |
billing_rail | string<engine, paypal> | కాదు | Which clock decides when this subscription is charged (W41-G, ADR 0029). engine is the default and is what ADR 0011 describes: the engine decides money is due, mints an… |
started_at | string | అవును | — |
canceled_at | object | కాదు | — |
created_at | string | అవును | — |
updated_at | string | కాదు | — |
ఈ ఎండ్పాయింట్ తిరిగి ఇవ్వగల లోపాలు
401 · 403 · 404 · 422 · 429