Documentation Index
Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
Use this file to discover all available pages before exploring further.
Subscriptions let you sell ongoing access with automated renewals. Use flexible billing cycles, free trials, plan changes, and add‑ons to tailor pricing for each customer.
Upgrade & Downgrade
Control plan changes with proration and quantity updates.
On‑Demand Subscriptions
Authorize a mandate now and charge later with custom amounts.
Customer Portal
Let customers manage plans, billing, and cancellations.
Subscription Webhooks
React to lifecycle events like created, renewed, and canceled.
What Are Subscriptions?
Subscriptions are recurring products customers purchase on a schedule. They’re ideal for:- SaaS licenses: Apps, APIs, or platform access
- Memberships: Communities, programs, or clubs
- Digital content: Courses, media, or premium content
- Support plans: SLAs, success packages, or maintenance
Key Benefits
- Predictable revenue: Recurring billing with automated renewals
- Flexible cycles: Monthly, annual, custom intervals, and trials
- Plan agility: Proration for upgrades and downgrades
- Add‑ons and seats: Attach optional, quantifiable upgrades
- Seamless checkout: Hosted checkout and customer portal
- Developer-first: Clear APIs for creation, changes, and usage tracking
Creating Subscriptions
Create subscription products in your Dodo Payments dashboard, then sell them through checkout or your API. Separating products from active subscriptions lets you version pricing, attach add‑ons, and track performance independently.Subscription product creation
Configure the fields in the dashboard to define how your subscription sells, renews, and bills. The sections below map directly to what you see in the creation form.Product details
- Product Name (required): The display name shown in checkout, customer portal, and invoices.
- Product Description (required): A clear value statement that appears in checkout and invoices.
- Product Image (required): PNG/JPG/WebP up to 3 MB. Used on checkout and invoices.
- Brand: Associate the product with a specific brand for theming and emails.
- Tax Category (required): Choose the category (for example, SaaS) to determine tax rules.
Pricing
- Pricing Type: Choose Subscription (this guide). Alternatives are Single Payment and Usage Based Billing.
- Price (required): Base recurring price with currency.
- Discount Applicable (%): Optional percentage discount applied to the base price; reflected in checkout and invoices.
- Repeat payment every (required): Interval for renewals, e.g., every 1 Month. Select the cadence (months or years) and quantity.
- Subscription Period (required): Total term for which the subscription remains active (e.g., 10 Years). After this period ends, renewals stop unless extended.
- Trial Period Days (required): Set trial length in days. Use 0 to disable trials. The first charge occurs automatically when the trial ends.
- Select add‑on: Attach up to 10 add‑ons that customers can purchase alongside the base plan.
Add‑ons are ideal for quantifiable extras such as seats or storage. You can control allowed quantities and proration behavior when customers change them.
Advanced settings
- Tax Inclusive Pricing: Display prices inclusive of applicable taxes. Final tax calculation still varies by customer location.
- Generate license keys: Issue a unique key to each customer after purchase. See the License Keys guide.
- Digital Product Delivery: Deliver files or content automatically after purchase. Learn more in Digital Product Delivery.
- Metadata: Attach custom key–value pairs for internal tagging or client integrations. See Metadata.
Subscription Trials
Trials let customers access subscriptions without immediate payment. The first charge occurs automatically when the trial ends.Configuring Trials
Set Trial Period Days in the product pricing section (use0 to disable). You can override this when creating subscriptions:
Detecting Trial Status
To determine if a subscription is in trial, retrieve the list of payments for the subscription. If there is exactly one payment with amount 0, the subscription is in trial period:Updating Trial Period
Extend the trial by updatingnext_billing_date:
Subscription Plan Changes
Plan changes let you upgrade or downgrade subscriptions, adjust quantities, or migrate to different products. Depending on the proration mode you select, a change may trigger an immediate charge, create credit, or apply no billing adjustment.Product Collections
Group related products into collections to enable seamless upgrade/downgrade paths in the Customer Portal.
Proration Modes
Choose how customers are billed when changing plans:Quick comparison of the four proration modes:
prorated_immediately | difference_immediately | full_immediately | do_not_bill | |
|---|---|---|---|---|
| Upgrade | Prorated charge for remaining days | Full price difference charged | Full new plan price charged | No charge — switch immediately |
| Downgrade | Prorated credit for remaining days | Full price difference as credit | No credit, full charge | No credit — switch immediately |
| Billing cycle | Stays the same | Stays the same | Resets to today | Stays the same |
| Best for | Fair time-based billing | Simple tier changes | Billing cycle resets | Free migrations or courtesy switches |
prorated_immediately
Charges prorated amount based on remaining time in the current billing cycle. Best for fair billing that accounts for unused time.
difference_immediately
Charges the price difference immediately (upgrade) or adds credit for future renewals (downgrade). Best for simple upgrade/downgrade scenarios.
Credits from downgrades using
difference_immediately are subscription-scoped and auto-applied to future renewals. They’re distinct from Credit-Based Billing entitlements.difference_immediately, the unused value becomes a subscription-scoped credit that automatically offsets future renewals:
full_immediately
Charges full new plan amount immediately, ignoring remaining time. Best for resetting billing cycles.
do_not_bill
Switches to the new plan without any billing adjustment. No proration charges, no credits — the customer simply moves to the new plan. Best for courtesy migrations, free plan switches, or scenarios where you want to absorb the cost difference.
Example: Prorated upgrade calculation
Example: Prorated upgrade calculation
Scenario: Customer on Basic (80/month) on day 16 of a 30-day cycle using Next renewal on the original billing date: $80.00/month.
prorated_immediately.Example: Downgrade credit calculation
Example: Downgrade credit calculation
Scenario: Customer on Pro (20/month) using The $60 credit auto-applies to future renewals:
difference_immediately.- Renewal 1: 20 (credit) = **40 credit remaining)
- Renewal 2: 20 (credit) = **20 credit remaining)
- Renewal 3: 20 (credit) = $0.00 (credit exhausted)
- Renewal 4: $20.00 (full price)
Learn more about how credits are managed in the Upgrade & Downgrade Guide.
Changing Plans with Add-ons
Modify add-ons when changing plans. Add-ons are included in proration calculations:Plan changes trigger immediate charges. Failed charges may move the subscription to
on_hold status. Track changes via subscription.plan_changed webhook events.Previewing Plan Changes
Before committing to a plan change, preview the exact charge and resulting subscription:Preview Change Plan API
Preview plan changes before committing to them.
Subscription States
Subscriptions can be in different states throughout their lifecycle:active: Subscription is active and will renew automaticallyon_hold: Subscription is paused due to failed payment. Payment method update required to reactivatecancelled: Subscription is cancelled and will not renewexpired: Subscription has reached its end datepending: Subscription is being created or processed
On Hold State
A subscription enterson_hold state when:
- A renewal payment fails (insufficient funds, expired card, etc.)
- A plan change charge fails
- Payment method authorization fails
Reactivating from On Hold
To reactivate a subscription fromon_hold state, update the payment method. This automatically:
- Creates a charge for remaining dues
- Generates an invoice
- Processes the payment using the new payment method
- Reactivates the subscription to
activestate upon successful payment
After successfully updating the payment method for an
on_hold subscription, you’ll receive payment.succeeded followed by subscription.active webhook events.API Management
Create subscriptions
Create subscriptions
Use
POST /subscriptions to create subscriptions programmatically from products, with optional trials and add‑ons.API Reference
View the create subscription API.
Update subscriptions
Update subscriptions
Use
PATCH /subscriptions/{id} to update quantities, cancel at next billing date, or modify metadata.API Reference
Learn how to update subscription details.
Change plans (proration)
Change plans (proration)
Change the active product and quantities with proration controls.
API Reference
Review plan change options.
On‑demand charges
On‑demand charges
For on‑demand subscriptions, charge specific amounts on demand.
API Reference
Charge an on‑demand subscription.
List and retrieve
List and retrieve
Use
GET /subscriptions to list all subscriptions and GET /subscriptions/{id} to retrieve one.API Reference
Browse listing and retrieval APIs.
Usage history
Usage history
Fetch recorded usage for metered or hybrid pricing models.
API Reference
See usage history API.
Update payment method
Update payment method
Update the payment method for a subscription. For active subscriptions, this updates the payment method for future renewals. For subscriptions in
on_hold state, this reactivates the subscription by creating a charge for remaining dues.API Reference
Learn how to update payment methods and reactivate subscriptions.
Common Use Cases
- SaaS and APIs: Tiered access with add‑ons for seats or usage
- Content and media: Monthly access with introductory trials
- B2B support plans: Annual contracts with premium support add‑ons
- Tools and plugins: License keys and versioned releases
Integration Examples
Checkout Sessions (subscriptions)
When creating checkout sessions, include your subscription product and optional add‑ons:Plan changes with proration
Upgrade or downgrade a subscription and control proration behavior:Cancel at next billing date
Schedule a cancellation that takes effect at the end of the current billing period:On‑demand subscriptions
Create an on‑demand subscription and charge later as needed:Update payment method for active subscription
Update the payment method for an active subscription:Reactivate subscription from on_hold
Reactivate a subscription that went on hold due to failed payment:Subscriptions with RBI-Compliant Mandates
UPI and Indian card subscriptions operate under RBI (Reserve Bank of India) regulations with specific mandate requirements:Mandate Limits
The mandate type and amount depend on your subscription’s recurring charge:- Cobranças abaixo do valor mínimo do mandato (padrão ₹15.000): Criamos um mandato sob demanda para o valor mínimo. O valor da assinatura é cobrado periodicamente de acordo com a frequência da sua assinatura, até o limite do mandato.
- Cobranças no valor mínimo do mandato ou acima: Criamos um mandato de assinatura (ou mandato sob demanda) para o valor exato da assinatura.
mandate_min_amount_inr_paise (INR paise). O valor registrado no banco é max(mandate_floor, billing_amount) — assim, o mínimo efetivamente se torna o teto de autorização visível para o cliente sempre que a cobrança for menor.
Para informações detalhadas sobre mandatos compatíveis com RBI e o valor mínimo de mandato configurável para métodos de pagamento indianos, consulte a página Métodos de Pagamento na Índia.
Considerações para Upgrade e Downgrade
Importante: Ao atualizar ou rebaixar assinaturas, considere cuidadosamente os limites de mandato:- Se uma atualização/rebaixamento resultar em um valor de cobrança que exceda Rs 15.000 e ultrapasse o limite de pagamento sob demanda existente, a cobrança da transação pode falhar.
- Nesses casos, o cliente pode precisar atualizar seu método de pagamento ou alterar a assinatura novamente para estabelecer um novo mandato com o limite correto.
Autorização para Cobranças de Alto Valor
Para cobranças de assinatura de Rs 15.000 ou mais:- O cliente será solicitado pelo banco a autorizar a transação.
- Se o cliente não autorizar a transação, ela falhará e a assinatura será suspensa.
Atraso de Processamento de 48 Horas
Linha do Tempo de Processamento: As cobranças recorrentes em cartões indianos e assinaturas UPI seguem um padrão de processamento único:- As cobranças são iniciadas na data agendada de acordo com a frequência da sua assinatura.
- A dedução real da conta do cliente ocorre apenas após 48 horas da iniciação do pagamento.
- Essa janela de 48 horas pode se estender até 2-3 horas adicionais dependendo das respostas da API do banco.
Janela de Cancelamento de Mandato
Durante a janela de processamento de 48 horas:- Os clientes podem cancelar o mandato através de seus aplicativos bancários.
- Se um cliente cancelar o mandato durante esse período, a assinatura permanecerá ativa (este é um caso específico para assinaturas de cartão indiano e UPI AutoPay).
- No entanto, a dedução real pode falhar, e nesse caso, colocaremos a assinatura em espera.
- Atrasar a ativação de benefícios até a confirmação do pagamento
- Implementar períodos de graça ou acesso temporário
- Monitorar o status da assinatura para cancelamentos de mandato
- Lidar com estados de espera da assinatura na lógica do seu aplicativo
Melhores Práticas
- Comece com categorias claras: 2–3 planos com diferenças óbvias
- Comunique preços: Mostre totais, rateio e próxima renovação
- Use testes com inteligência: Converta com integração, não apenas com tempo
- Aproveite os complementos: Mantenha planos básicos simples e faça upsell de extras
- Teste mudanças: Valide alterações de plano e rateio em modo de teste
As assinaturas são uma base flexível para receita recorrente. Comece simples, teste minuciosamente e itere com base em métricas de adoção, churn e expansão.