Crie e ative uma assinatura
Inscreva um cliente em um plano e cobre o primeiro ciclo de faturamento. Realiza a CIT inicial que registra o mandato recorrente.
POST /subscription inscreve um cliente em um plano e estabelece o mandato recorrente que
ancora toda futura Merchant Initiated Transaction (MIT). Inscrever um cliente é uma
Cardholder Initiated Transaction (CIT), e uma CIT pode exigir 3D Secure. Dois modos:
Modo CIT — nonceData / cardData
Modo record — tokenData
/payment/authorization ou /payment/purchase. Nenhuma segunda CIT é executada aqui.
Use isto para qualquer cartão que precise de 3D Secure.nonceData, cardData (apenas servidores
em conformidade com PCI DSS), ou tokenData.
Modo record
Execute você mesmo uma CIT com capacidade 3DS, depois anexe o resultado:Execute a CIT via /payment/*
/payment/authorization (valor 0 = verificação de conta) ou /payment/purchase
com card.<x>.tokenize: true + um shopper.id, e trate qualquer desafio de 3DS com o
SDK JS como você faria para um pagamento normal. A resposta devolve um token vt_....Crie a assinatura
POST /subscription com card.tokenData.token. Para o ciclo 1:
• teste ou
startAt diferido → nada é cobrado;
• você cobrou o primeiro ciclo na sua CIT (
/payment/purchase) → passe também
firstPaymentId (o id do pagamento da resposta dessa chamada); o Therius marca a primeira
fatura como paga e a vincula, sem cobrança;
• a sua CIT foi uma verificação de valor zero → omita
firstPaymentId; o Therius cobra
o ciclo 1 como uma MIT contra o mandato registrado (reverte a assinatura com um 402
se for recusada).
O objeto
firstCycle da resposta informa o que aconteceu.planId, customerEmail e um instrumento de cartão (nonceData/cardData/tokenData — exatamente um) são obrigatórios; customerName/customerDocument, firstPaymentId (modo record), startAt, parentSubscriptionId/propagateLifecycle e metadata são opcionais.
Resposta
Uma requisição bem-sucedida devolve201 Created com o objeto de assinatura completo, incluindo o id da assinatura, o status inicial, as datas de início e fim do período atual, e a primeira fatura.
Status na criação
Erros
Autorizações
Your secret API key: Bearer prv_production_xxx (production) or Bearer prv_sandbox_xxx (sandbox).
Corpo
Your merchant account identifier.
ID of an active plan. Determines amount, currency, interval and trial.
Subscriber email. Used for billing and dunning notifications.
Card input for creating a subscription. Enrolling a customer is a CIT and a CIT may require 3D Secure — pick the mode that fits:
• CIT mode (nonceData / cardData): Therius runs the initial CIT + first charge here. The customer must be present. This CIT cannot carry out a 3D Secure challenge, so a 3DS-required card will fail — use record mode for those.
• Record mode (tokenData): the token is a card that already completed a CIT — including any 3DS — through /payment/authorization or /payment/purchase (with card.<x>.tokenize: true + shopper.id). No second CIT runs. The mandate is read from the token; pass networkTransactionId / networkReferenceId explicitly only for a card CIT'd outside Therius. For cycle 1: with a trial or deferred start nothing is charged; with firstPaymentId set Therius marks the first invoice paid and links that payment; otherwise Therius charges cycle 1 as an MIT against the recorded mandate.
Provide exactly ONE of cardData, nonceData, or tokenData. cardOnFile and instalments are not accepted — Therius owns the mandate.
- Raw card (PCI DSS)
- SDK nonce
- Vault token
Subscriber full name, as it should appear on invoices.
Subscriber national ID / tax document, where a market requires it (e.g. Brazil CPF/CNPJ).
Record mode only, when a first payment is due. The payment id from the /payment/authorization or /payment/purchase call in which you ran this card CIT - Therius verifies it charged the same vaulted token in the plan currency, then marks cycle 1 paid and links it (no charge). Omit and Therius charges cycle 1 as an MIT against the recorded mandate.
RFC 3339 future timestamp to defer the first charge. Omit to activate (or start the trial) immediately.
UUID of an existing subscription to attach this one to as a child (add-on hierarchies).
When true, pause/cancel on parentSubscriptionId cascades to this subscription. Requires parentSubscriptionId.
Arbitrary string key/value pairs, echoed on subscription responses and webhooks.
Resposta
Subscription created. Body is the Subscription plus firstInvoice, and firstCycle in record mode (what happened to cycle 1).
A customer enrollment in a plan. plan is embedded on single-subscription responses. Invoice/event history is not included here - use the invoice endpoints.
Subscription UUID.
The merchant account that owns the subscription.
ID of the plan this subscription is enrolled in.
Subscriber email, used for billing and dunning notifications.
Subscriber name as it appears on invoices.
Subscriber national ID / tax document, where a market requires it (e.g. Brazil CPF/CNPJ).
Brand of the card on the mandate, e.g. visa.
pending - awaiting first charge; trialing - in a free trial; active - billing normally; past_due - a renewal failed and dunning is running; suspended - dunning exhausted, needs a new CIT (POST /subscription/{id}/payment-method in CIT mode) to recover; paused - billing stopped on request, resumable; cancelled - terminated; completed - reached maxBillingCycles.
pending, trialing, active, past_due, suspended, paused, cancelled, completed Start of the current billing period.
End of the current billing period.
When the next renewal charge is scheduled.
Trial start, when the plan has a trial.
Trial end - the first real charge date.
Failed-renewal retry attempts made in the current dunning sequence.
When the subscription first became active.
Deferred start, when creation set a future startAt.
Number of billing cycles charged so far.
When the subscription reached maxBillingCycles.
Parent subscription UUID, for add-on hierarchies.
Whether pause/cancel on the parent cascades to this subscription.
Plan the subscription will switch to at the next cycle, set by a next_billing change-plan.
A reusable billing plan. amount is a flat integer in the currency minor units (with separate currency + exponent) - not an Amount object.

