billing
POST /v1/subscriptions/{subscriptionId}/auto-renew
Turn a subscription's renewal on or off.
Ìfàṣẹ́pọ̀
Fi bọ́ọ̀lù (bearer token) ranṣẹ gẹ́gẹ́ bí kọ́kọ́rọ́ API. Kọ́kọ́rọ́ náà gbọ́dọ̀ ní ìyọ̀ǹda billing.payment.manage; a ó kọ̀ ọ́ silẹ pẹlu 403, kii ṣe 404, ti kọ́kọ́rọ́ náà kò bá ní i.
Ojú abánisọ̀rọ̀ yìí kò gba id ajọ kankan. Kọ́kọ́rọ́ rẹ ti mọ ajọ ti o jẹ ti e, a o si fèsì nipa rẹ̀.
Gbiyanju rẹ
Rọ́pọ̀ èyíkéyìí nínú àwọn àmì ìtọ́ka < > pẹ̀lú iye tirẹ̀, àti àmì ìdánimọ̀ bọ́tìnnì náà pẹ̀lú bọ́tìnnì kan láti inú dásibọ̀ọ̀dù rẹ.
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> }'Ṣé o ti wọlé? Iwọ̀n api ní nú ìgbékalẹ̀ rẹ kún id àjọ gidi rẹ ati bọtini tirẹ, o si nṣiṣẹ ibeere na lòdì si api gidi ki o le rii esi gidi na. Ṣí ojú abáná yìí sílẹ̀ nínú kọnsólù API
Àwọn kúlẹ̀kúlẹ̀
**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.
Àwọn ìpìlẹ̀
| Orúkọ | Iru | Tí a nílò | Kini o jẹ |
|---|---|---|---|
subscriptionId (path) | Uuid | Bẹẹni | The subscription whose renewal is being changed. |
Akoonu ibeere naa
| Orúkọ | Iru | Tí a nílò | Kini o jẹ |
|---|---|---|---|
auto_renew | boolean | Bẹẹni | `true` to charge again at `current_period_end`; `false` to run to the end of the paid period and then expire. |
Idahun
| Orúkọ | Iru | Tí a nílò | Kini o jẹ |
|---|---|---|---|
id | Uuid | Bẹẹni | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | Bẹẹni | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
status | SubscriptionStatus | Bẹẹni | A subscription's lifecycle state (docs/05 §1). |
plan | SubscriptionPlanRef | Bẹẹni | The pinned plan version a subscription was sold (a purchase-time snapshot). |
price | MoneyAmount | Bẹẹni | The captured price the subscriber pays (minor units + code, §2.8). |
interval | string<monthly, annual> | Bẹẹni | — |
entitlements | object | Bẹẹni | The resolved entitlements captured at purchase (feature/quota map). |
current_period_start | string | Bẹẹni | — |
current_period_end | string | Bẹẹni | — |
auto_renew | boolean | Bẹẹni | 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`. Cha… |
started_at | string | Bẹẹni | — |
canceled_at | object | Bẹẹkọ | — |
created_at | string | Bẹẹni | — |
updated_at | string | Bẹẹkọ | — |
Awọn aṣiṣe ti ibudo ipari yii le da pada
401 · 403 · 404 · 422 · 429