PMWallets
中文
Plans

Buy 30 days of a plan from the balance

CHARGES THE BALANCE the tier price for 30 days that never renew (starts now, or queues behind the running period). maxCents caps the charge (409 price_changed). requestId is required: a retry with it returns the same period, never a second charge. Refused while a card plan is active.

POST/v1/account/plan/balanceAPI keySpends balance

Request body

tierstringrequired

Base 499, Pro 1499, Max 3999 cents per 30 days.

Allowed values: basepromax

maxCentsintegerrequired

Most you agree to be charged, in cents.

Allowed range: 0 <= x

requestIdstringrequired

Your idempotency key for this purchase; reuse it on retry, use a new one for a new purchase.

Response

outcomestring

Allowed values: startedqueuedreplayed

startsAtstring
endsAtstring
centsinteger
tiersPlanTier[]
planobject | null
balanceobject
baseTrialobject
usageobject
trialobject

Responses

201Bought (HTTP 201); the body also carries the updated plan status.
400Invalid parameter or body; message names what was expected.
401No valid API key (missing, malformed, unknown or revoked).
402code: insufficient_balance; nothing charged.
409code one of: price_changed (with cents), card_active, fix_payment, checkout_open, already_queued, request_conflict. Nothing charged.
503code: stripe_unavailable or temporarily unavailable; nothing charged.