A Subscription represents a recurring billing arrangement between a merchant and a customer. Fluveo handles the billing cycle, invoice generation, payment collection, and dunning retries on your behalf.Documentation Index
Fetch the complete documentation index at: https://docs.fluveo.com/llms.txt
Use this file to discover all available pages before exploring further.
MVP scope
- Card recurring only, routed to Stripe. PIX and other push-to-pay methods
don’t support recurring billing (the PSP layer rejects them with
422 unsupported_psp_capabilityat create time). default_payment_methodis required forcharge_automaticallysubscriptions without a trial. Missing it returns400 parameter_missingwithparam=default_payment_method.- Trials and
send_invoicesubscriptions can omitdefault_payment_method— they are charged (or invoiced) at trial end.
Create a subscription
How it works
- Fluveo validates the request: items must be non-empty, prices must resolve, the default payment method must exist on the customer.
- The subscription and its items are written to the database atomically.
- A draft invoice is created for the first billing period.
- The invoice is finalized (gets an invoice number, moves to
open). - Payment is collected through the PSP using the default payment method.
- On success, the subscription transitions to
activeandlatest_invoiceis populated. On failure, the subscription staysincomplete(unlesspayment_behavior=error_if_incomplete, which returns 402).
Payment behavior matrix
payment_behavior | Initial pay fails → subscription status |
|---|---|
default_incomplete | incomplete (default; Temporal retries) |
allow_incomplete | incomplete (same as default) |
error_if_incomplete | Request returns 402, nothing is written |
Renewal
Fluveo’s Temporal billing workflow creates a fresh invoice atcurrent_period_end, collects payment, and moves the period window forward.
You see a invoice.created → invoice.finalized → invoice.paid chain in
your events stream. Failures transition the subscription to past_due and
start dunning retries on days 1, 3, 5, and 7.
Cancel
Events emitted
subscription.createdsubscription.updatedsubscription.deletedsubscription.resumedinvoice.created/invoice.finalized/invoice.paid/invoice.payment_failed