Change seats or the period
const url = 'https://beta-api.plune.ai/v1/billing/subscription';const options = { method: 'PATCH', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"seats":5}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://beta-api.plune.ai/v1/billing/subscription \ --header 'Content-Type: application/json' \ --cookie plune_session=<plune_session> \ --data '{ "seats": 5 }'More seats take effect at once: a grant with them to the paid end, and seats added × the seat’s dollar price × days left ÷ days in the period is added to the next charge, at that charge’s rate (ADR 0081 §3). Fewer seats and another period take effect from the next period (nextSeats, nextPeriod). Paddle: its own proration, to the minute, billed with the next payment; fewer seats are billed nothing now (do_not_bill); a month↔year switch answers 501 not_built_for_provider. Paddle is asked first: a refusal changes nothing of ours. The session alone, the owner’s alone for a company. Ten calls a minute.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Team: a company the caller owns. Absent: the caller’s own account (Personal).
Request Body required
Section titled “Request Body required ”object
Team: 3 to 50; Personal: 1
Examples
Two more seats now
{ "seats": 5}Yearly from the next period
{ "period": "year"}Responses
Section titled “ Responses ”The subscription as changed
object
object
Another period, from the next one
Fewer seats, from the next period
Seats added mid-period: owed on top of the next charge, in US cents (0 when nothing)
When the owner cancelled at the period’s end
The latest failed renewal payment not followed by a payment (Monopay: of an invoice still unpaid; Paddle: transaction.payment_failed)
A refund that ended it: Free limits at once
object
Monopay: the link to pay for the next period, while it lives
Where the receipt is: Paddle’s customer portal page of the subscription (its past payments), for the owner; a short-lived link, never stored; null when the provider gives none
Where the card is changed: Paddle’s customer portal with the payment method form open, for the owner; a short-lived link, never stored; null when the provider gives none
Example
{ "subscription": { "provider": "paddle", "tier": "personal", "period": "month", "status": "active", "nextPeriod": "month" }}Not JSON, nothing named, or a seat count out of range
object
Example generated
{ "error": "example"}No / invalid session
An API token (session_required), or a member of the company who is not its owner (owner_only)
object
Example generated
{ "error": "example"}A company the caller is not in
object
Example generated
{ "error": "example"}No active subscription whose period has not passed (nothing_to_change), or it changed meanwhile (conflict)
object
Example generated
{ "error": "example"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over
A month↔year switch through Paddle is not built yet (not_built_for_provider)
object
Example generated
{ "error": "example"}The payment provider refused the change (provider_error); nothing of ours changed
object
Example generated
{ "error": "example"}The provider’s variables are not set on this server (provider_not_configured), or it could not be reached (provider_unreachable) - try again
object
Example generated
{ "error": "example"}