Create reactivate

Puts a canceled subscription back on its plan.

POST /v1/billing/subscriptions/{id}/reactivate

Addresshttps://api.hanzo.ai/v1/billing/subscriptions/{id}/reactivate
MethodPOST
OperationreactivateSubscription
AuthAuthorization: Bearer $HANZO_API_KEY

Puts a canceled subscription back on its plan.

What asks for this is usually a recovered payment method or a support tool rather than a browser, which is most of the argument for it having an address at all. The engine decides whether the move is legal; a row it will not reactivate comes back with its own reason.

Resuming the org's plan commits its card to the next renewal, so it takes the authority ending it does: an admin of the org or the platform, or a member for a wallet of their own. A member is refused with 403 and told to ask an admin.

A named handler, not a closure, so zipdoc can lift this prose into the registry.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyesID is the subscription, from the path.
atPeriodEndbodyboolean—AtPeriodEnd cancels at the end of the paid period rather than at once.
idbodystring—ID is the subscription, from the path.

Response

StatusBodyMeaning
200billing.Subscriptionok
defaultproblem-detailsrefused

200 body — 42 fields.

FieldInTypeAlwaysDescription
assignedbodybilling.SubscriptionSeat[]—Assigned is which member holds which seat type, as the org's admin set it.
assigned[].memberbodystring—Member is the IAM user who holds the seat, as the org's members list names them.
assigned[].planbodystring—Plan is the seat type held: "team" (standard) or "team-premium".
cancelAtPeriodEndbodyboolean—CancelAtPeriodEnd reports that the plan ends at CurrentPeriodEnd.
canceledAtbodystring—CanceledAt is when it was canceled; absent when it was not.
chargedCentsbodyinteger (int64)—ChargedCents is what the period in hand was actually paid, after any discount and net of refunds.
couponbodystring—Coupon is the plan coupon code the first period was bought with, as commerce stores it (upper case); absent when none was.
createdAtbodystring—CreatedAt is when the row was written, RFC 3339.
currentPeriodEndbodystring—CurrentPeriodEnd is when it ends, RFC 3339.
currentPeriodStartbodystring—CurrentPeriodStart is when the period in hand began, RFC 3339.
customerCentsbodyinteger (int64)—CustomerCents is the price staff agreed this subscriber pays for one seat each period, below the plan's list price; absent when none was.
defaultPaymentMethodbodystring—DefaultPaymentMethod is the saved method a renewal would use.
endedAtbodystring—EndedAt is when it ended; absent while it runs.
heldbodyboolean—Held reports that this row is the subject's one paid plan: while it stands, commerce refuses a second paid sale (409).
idbodystring—ID is the subscription's own id, the one cancel and reactivate take.
lastPaidbodystring—LastPaid is when the latest payment for this subscription arrived, RFC 3339: its latest paid invoice's paid time, or, for a period recorded as collected outside commerce, which keeps no time of its own record, the start of the latest period recorded — whichever is later.
linesbodybilling.SubscriptionLine[]—Lines are a team's other seat types beside Plan (a team of standard and premium seats is Plan "team" and one line of "team-premium"), each with the seats of it the period in hand was paid for.
lines[].namebodystring—Name is the seat type's display name, e.g. "Team Premium".
lines[].pendingQuantitybodyinteger (int64)—PendingQuantity is the seats of it the next period opens at, when a change waits for the renewal that charges it; absent when none does.
lines[].planbodystring—Plan is the seat type's catalog plan, e.g. "team-premium".
lines[].pricebodyinteger (int64)—Price is one seat of it for the row's period, in cents.
lines[].quantitybodyinteger (int64)—Quantity is the seats of it the row holds.
lines[].seatsbodyinteger (int64)—Seats is the seats of it the period in hand was paid for; 0 when unpaid.
mrrCentsbodyinteger (int64)—MRRCents is what this subscription contributes per month — commerce's own figure, interval-normalized and multiplied by its seats, so no reader re-derives it from price and interval.
planbodybilling.SubscriptionPlan—
plan.currencybodystring—Currency is the ISO code the price is in, lower-cased.
plan.idbodystring—ID is the plan row the subscription was opened on.
plan.intervalbodystring—Interval is the billing period: "month" or "year".
plan.namebodystring—Name is the plan's display name, e.g. "Max 20x".
plan.pricebodyinteger (int64)—Price is what one period costs per seat, in cents, as the subscription snapshotted it: a later catalog price change does not move it.
plan.slugbodystring—Slug is the catalog plan it was opened on, e.g. "max-20x": what a reader matches against GET /v1/billing/plans.
planIdbodystring—PlanID is the plan slug, e.g. "max-20x".
providerTypebodystring—ProviderType is who collects it: a processor ("square"), "credit" for a plan bought with credits, "internal" or "bundle" for a row nobody paid for.
quantitybodyinteger (int64)—Quantity is the seat count; a flat plan holds 1.
seatsbodyinteger (int64)—Seats is the seat count the period in hand was paid for — its paid invoice's quantity, or the quantity recorded with an external period — never the row's live Quantity, which the holder may change.
settledbodystring—Settled is how the period in hand was paid: "card" (a card paid all of it), "external:<processor>" (a payment recorded as collected outside commerce), "balance", "credit" or "mixed" (prepaid money).
statusbodystring—Status is trialing, active, past_due, canceled or unpaid.
testbodyboolean—Test marks a sandbox subscription: sold while its org was in test mode, paid with sandbox money.
trialEndbodystring—TrialEnd is when that trial ends; absent when there was none.
trialStartbodystring—TrialStart is when a trial began; absent when there was none.
updatedAtbodystring—UpdatedAt is when the row last changed, RFC 3339.
userIdbodystring—UserID is the billing account that holds it: the org slug for an org's own plan, "<org>/<name>" for a member's.

Failure carries the platform error shape — see Errors.

Examples

hanzo billing subscriptions reactivate <id>
import { Configuration, BillingApi } from 'hanzoai';

const api = new BillingApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.reactivateSubscription({ id: 'id', atPeriodEnd: false, id: "<id>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import BillingApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = BillingApi(client).reactivate_subscription(id='id', at_period_end=False, id="<id>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.BillingAPI.ReactivateSubscription(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, billing_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = billing_api::reactivate_subscription(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.BillingApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new BillingApi(client).reactivateSubscription();
curl -X POST https://api.hanzo.ai/v1/billing/subscriptions/<id>/reactivate \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "atPeriodEnd": false,
       "id": "<id>"
     }'

Tool billing, op reactivateSubscription — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "billing",
         "arguments": {
           "op": "reactivateSubscription",
           "input": {
             "id": "<id>",
             "atPeriodEnd": false
           }
         }
       }
     }'

Billing API · All Hanzo APIs · Interactive reference

Was this page useful?
Broken link or missing step? Drop it in #docs on Discord or open a PR.