Data model
Borga’s billing model follows a hierarchy from product catalogue down to the individual subscription:
A single subscription can contain multiple items, each referencing a different price. This lets you bundle base plans with add-ons in one billing agreement.
Billing intervals
Billing intervals are defined on the Price object. Borga supports the following recurring intervals:Collection methods
When you create a subscription, you choose how Borga collects payment at each billing cycle:- charge_automatically
- send_invoice
Borga charges the customer’s default saved payment method on the renewal date. The customer does not need to take any action.Best for: SaaS products, recurring services where the customer expects seamless billing.
To use
charge_automatically, the customer must have a default payment method saved. Set one with POST /v1/payment_methods/{id}/set_default before creating the subscription.Trials
Give new subscribers a free trial period by settingtrial_period_days on the subscription. Borga does not charge the customer until the trial ends.
trialing. The first invoice is issued when the trial period ends.
Proration
When you add, remove, or change a subscription item mid-billing cycle, Borga calculates a proration — a credit or charge for the partial period. You control this withproration_behavior when updating subscription items:
Discounts
Apply a one-time discount to a subscription at creation using thediscount field:
duration field currently only supports "once", meaning the discount applies to the first invoice only. Subsequent invoices are billed at the standard price.
Subscription lifecycle
A subscription passes through the following states:Managing subscription state
Cancel a subscription
Cancel a subscription
Send An
POST /v1/subscriptions/{id}/cancel. Set at_period_end: true to let the current billing period complete before canceling, or false to cancel immediately.at_period_end cancellation moves the subscription to canceling status. Call POST /v1/subscriptions/{id}/uncancel to reverse it before the period ends.Pause and resume
Pause and resume
POST /v1/subscriptions/{id}/pause — stops invoicing without ending the subscription. The status moves to paused.POST /v1/subscriptions/{id}/resume — resumes billing from the next scheduled cycle.Credit rollover
For usage-based or credit-based plans, you can configure subscription items with included units and credit rollover:Credit rollover applies per subscription item, not per subscription. Items on the same subscription can have different rollover settings.