Skip to main content
Subscriptions let you bill customers on a repeating schedule without writing any scheduling logic yourself. You define the products and prices once, attach them to a subscription, and Borga handles billing on every renewal cycle — generating invoices, collecting payment, and handling proration when plans change mid-cycle.

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:
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 setting trial_period_days on the subscription. Borga does not charge the customer until the trial ends.
During the trial, the subscription status is 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 with proration_behavior when updating subscription items:
Use always_invoice when a customer upgrades to a higher-tier plan mid-cycle and you want to collect the difference immediately rather than rolling it into the next invoice.

Discounts

Apply a one-time discount to a subscription at creation using the discount field:
The 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

Send POST /v1/subscriptions/{id}/cancel. Set at_period_end: true to let the current billing period complete before canceling, or false to cancel immediately.
An at_period_end cancellation moves the subscription to canceling status. Call POST /v1/subscriptions/{id}/uncancel to reverse it before the period ends.
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.