Borga subscriptions let you bill customers on a repeating schedule without writing any scheduling logic yourself. You define a product catalogue once — products, then prices — attach them to a subscription for a customer, and Borga takes care of invoice generation, payment collection, and proration when plans change mid-cycle. This guide walks through every step from an empty catalogue to a running subscription.Documentation Index
Fetch the complete documentation index at: https://docs.borga.is/llms.txt
Use this file to discover all available pages before exploring further.
Create a product
A product represents what you are selling — a plan, a service, or a bundle. Create one with a name and an optional description.Save the product
id — you will reference it when creating a price.Create a price
A price defines how much to charge for the product and how often. Attach it to the product you just created and set the billing interval.The
unit_amount is in whole ISK — 4990 charges 4,990 kr per month. Supported intervals are day, week, month, and year.A product can have multiple prices — for example, a monthly price and an annual price at a discount. You can archive a price to stop new subscriptions from using it without affecting existing subscribers.
Create a customer
If you do not already have a customer in Borga, create one. A customer record links subscriptions, invoices, and saved payment methods to a single identity.For
curl
charge_automatically subscriptions (the most common setup), the customer must have a default saved payment method before the first invoice is charged. You can collect and save a card using a payment session with save_payment_method: true, then set it as default with POST /v1/payment_methods/{id}/set_default.Create a subscription
Create the subscription by specifying the customer and the price to bill. Pass A subscription created with
trial_period_days to give new subscribers a free trial before the first charge.trial_period_days starts in trialing status. The first invoice is generated when the trial ends. Without a trial the subscription starts active and Borga attempts to charge the customer immediately.Handle renewals
Borga manages the renewal cycle automatically. At the end of each billing period, Borga:
- Generates a new invoice for the upcoming period.
- Attempts to collect payment from the customer’s default payment method (for
charge_automatically). - Emits a
subscription.renewedwebhook event and aninvoice.paidevent on success.
Cancel a subscription
Cancel a subscription at the end of the current billing period to let the customer keep access until they have paid for, or at the end of the period immediately on request.Setting
at_period_end: true moves the subscription to canceling status — billing continues until the period ends, then the subscription moves to canceled. If the customer changes their mind before the period ends, call POST /v1/subscriptions/{id}/uncancel to reverse the cancellation.Pause and resume
Pausing a subscription suspends invoicing without ending the subscription. No invoices are generated while the subscription is paused. Resume it to restart billing from the next scheduled cycle.Pausing is useful for accommodating customer requests to temporarily freeze an account without losing the subscription history or configuration.
Pause
Resume
Subscription lifecycle
| Status | Meaning |
|---|---|
trialing | Within the trial period. No charges yet. |
active | Billing normally. |
past_due | Latest invoice is unpaid past its due date. |
paused | Billing suspended. No invoices generated. |
canceling | Cancellation scheduled for end of current period. |
canceled | Subscription has ended. No further invoices. |
Usage-based billing
If you want to charge customers based on consumption rather than a fixed recurring amount, set up a metered price with a meter. See Usage billing for a full walkthrough.Next steps
- Usage billing — bill customers based on actual consumption using meters and events
- Webhooks — receive
subscription.created,subscription.canceled, andinvoice.paidevents - Accounting link — sync invoices to your accounting software automatically