billing

POST /v1/subscriptions/{subscriptionId}/term

Switch a live monthly subscription to annual billing now.

All billing endpoints

All developer docs →

Zinn®, our Viking, hammering at his anvil beside an API endpoint sending events to several listeners.

Authentication

Send an API key as a bearer token. The key must carry the billing.payment.manage permission; a key without it is refused with 403, not 404.

This endpoint takes no organisation id. Your key already identifies the organisation it belongs to, and the response is scoped to it.

Try it

Replace anything in angle brackets with your own values, and the key placeholder with a key from your dashboard.

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

Signed in? The API console in your dashboard fills in your real organisation id and your own key, and runs the request against the live API so you can see the actual response. Open this endpoint in the API console

Details

Moves the subscription onto the SAME plan billed annually, starting now and running a year (P1-086). The charge is the annual price less the unused part of the current paid window, plus tax, taken exactly as a plan change takes it: account credit first, then a stored method. With nothing stored that can pay, the answer is 422 PAYMENT_METHOD_REQUIRED carrying the payment step for the order; pay that order (POST /v1/orders/{orderId}/pay) and repeat this request, which replays the same order and takes nothing further. Renewal settings (automatic or invoice me, the stored method) are kept. Send expected_total_minor (the figure the customer was shown): a quote that moved since is refused with nothing charged. Requires billing.payment.manage. 422 with nothing charged for every refusal GET names, plus refusal.termSwitch.notSwitchable.

Parameters

NameTypeRequiredWhat it is
subscriptionId (path)UuidYesThe live monthly subscription to move to annual billing.

Request body

NameTypeRequiredWhat it is
intervalstring<annual>Yes—
expected_total_minorintegerNoThe total the customer was shown; a moved quote is refused, nothing charged.

Response

NameTypeRequiredWhat it is
plan_codestringYesThe plan this subscription is now on.
plan_namestringYesIts catalogue name, so a receipt can name it without a second lookup.
plan_version_idstringYesThe priced version the new subscription carries.
subscription_idstringYesThe new subscription. A plan change supersedes rather than mutates, because a subscription pins the exact version it was sold — so this id differs from the one in the request…
order_idstringYesThe order the charge was raised against, or "" when the change resulted in a credit and no order was minted.
charged_minorintegerYesWhat was actually taken, in minor units.
credited_minorintegerYesWhat was actually returned as account balance, in minor units.
pay_order_idstringNoP1-087: when this downgrade replaced an unpaid renewal, the unpaid order at the cheaper price to pay now (POST /v1/orders/{id}/pay); "" otherwise. The subscription stays past…
paypal_approval_urlstringNoP1-085: on a PayPal-billed subscription the change cancels the PayPal agreement FIRST (a refused cancel changes nothing: refusal.planChange.paypalNotStopped), supersedes, then…
package_typestringYesThe vendor package type, read back after the move. "" on our own fleet and "" when the subscription entitles no site — there is no package to move.
slots_beforeintegerYesThe site allowance the subscription held before the change.
slots_afterintegerYesThe site allowance it holds now.
slots_before_unlimitedbooleanYesThe old plan sold unlimited sites, so slots_before is null by design.
slots_after_unlimitedbooleanYesThe new plan sells unlimited sites, so slots_after is null by design.
quoteSitePlanQuoteYesThe quote the change was performed against.

Errors this endpoint can return

401 · 403 · 404 · 422 · 429