Pular para o conteúdo principal
POST
Assign a plan to an account

Autorizações

api_access_token
string
header
obrigatório

Token de um Platform App, gerado pelo super admin. Usado para provisionar contas, usuários, papéis e bots.

Parâmetros de caminho

account_id
string
obrigatório

The numeric ID of the account

Corpo

Assigns a plan without a gateway. Any subscription the account already had is closed. Entitlements and the monthly AI Action allowance are applied right away, and a suspension raised by billing is lifted.

plan_id
integer
obrigatório

Plan to assign. It does not need to be public.

source
enum<string>
padrão:courtesy

courtesy is a free plan, manual is a contract invoiced outside the platform, trial starts a trial that expires.

Opções disponíveis:
courtesy,
manual,
trial
ends_at
string<date>

Day the subscription ends, taken to the end of that day. For a trial it is the end of the trial.

trial_days
integer

Length of the trial when source is trial and no ends_at is given. Defaults to 15.

note
string

Kept with the subscription. Defaults to a note naming the platform app that made the call.

Resposta

Plan assigned

Billing state of the account. The provider-agnostic keys are always present; the catalog, subscription, ai_actions and suspension keys are added when native billing is enabled.

provider
enum<string>
Opções disponíveis:
stripe,
asaas,
dlocal_go,
paypal,
shopify
state
enum<string>

Status of the current subscription, or legacy when the account has none under the native catalog.

Opções disponíveis:
legacy,
pending,
incomplete,
trialing,
active,
past_due,
canceled,
expired,
suspended
plan
object | null
amount
integer | null

Recurring amount in cents, add-ons included.

currency
string | null
billing_period
enum<string> | null
Opções disponíveis:
month,
semester,
year,
null
trial_ends_at
string<date-time> | null
current_period_end
string<date-time> | null
last_verified_at
string<date-time> | null
catalog
enum<string>

Present and set to native when native billing is enabled.

Opções disponíveis:
native
source
enum<string> | null

How the subscription was created.

Opções disponíveis:
gateway,
courtesy,
manual,
trial,
null
billing_profile_required
boolean
suspension
object | null

Present only while the account is suspended.

allowed_actions
object

What the current user interface is allowed to offer for this account.

ai_actions
object | null

AI Actions balance of the account.

subscription
object | null