Crie um plano de assinatura
Defina um plano de faturamento recorrente com valor, moeda, intervalo, período de teste e restrições geográficas opcionais.
amount, o interval, o intervalCount e a currency dele são imutáveis. Para mudar o preço ou a cadência de assinantes existentes, crie um novo plano e migre os assinantes usando change-plan.
amount, currency, interval e intervalCount se tornam imutáveis assim que o plano tem assinantes ativos — veja o painel de parâmetros acima para a lista completa de campos, incluindo as opções de preço introdutório (introAmount/introBillingCycles) e maxBillingCycles/availableCountries.
Devolve 201 Created com o objeto de plano completo incluindo o id gerado.
Autorizações
Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).
Corpo
Your merchant account identifier.
Human-readable plan name.
Billing interval unit.
day, week, month, year Recurring charge in the currency minor units.
ISO 4217 currency code.
Optional plan description.
Number of interval units between charges. Defaults to 1.
Decimal places for amount - defaults to the currency standard (2 for USD, 0 for JPY).
Free-trial length in days. 0 for no trial.
Introductory charge in minor units for the first introBillingCycles cycles.
Cycles billed at introAmount before reverting to amount.
Total cycles after which the subscription auto-completes. 0 = open-ended.
ISO 3166-1 alpha-2 codes to restrict the plan to. Omit for global availability.
Resposta
Plan created
A reusable billing plan. amount is a flat integer in the currency minor units (with separate currency + exponent) - not an Amount object.
The plan unique integer ID.
The merchant account that owns the plan.
Billing interval unit. Immutable after creation.
day, week, month, year Number of interval units between charges - month + 3 bills quarterly.
Recurring charge in the currency minor units (e.g. 2999 = $29.99 at exponent 2). Immutable after creation.
ISO 4217 currency code. Immutable after creation.
Decimal places for amount / introAmount - 2 for USD, 0 for JPY.
Free-trial length in days before the first charge. 0 for no trial.
Introductory charge in minor units for the first introBillingCycles cycles, if set.
How many initial cycles are billed at introAmount before the rate reverts to amount.
Total cycles after which the subscription auto-completes. 0 = open-ended.
ISO 3166-1 alpha-2 codes the plan is offered in. Empty = available everywhere.
Whether the plan accepts new subscribers. Existing subscriptions are unaffected when this is false.

