---
title: "SaaS billing API and invoicing · Fungies"
description: "Model plans as offers, change them with proration and preview the amount first, run trials and retries over the API, and record every charge."
image: "https://fungies.io/og-image.jpg"
canonical: "https://fungies.io/saas-billing-api-invoicing/"
---

Developers · SaaS billing

# Model your pricing as data and let the billing run itself

Most billing bugs are modelling mistakes wearing a disguise: a plan duplicated as a second product, an upgrade that charges twice, a trial that converts a day late, a failed renewal treated as a cancellation. This page is how the objects fit together and which call to make at each of those moments.

[Start free](https://app.fungies.io/register)

[Book a demo](https://calendly.com/duke-vuh/fungies-io-demo-clone)

No upfront costs. No credit card required.

Already selling with Fungies

 [![Leadsin.io](/logos/clients/leadsin.png)](/customer-story/hosted-checkout-solution-for-leadsin-io-a-saas-business "Leadsin.io — read the story")[![RenderAI](/logos/clients/renderai.png) ](/customer-story/helping-renderai-reduce-their-ai-saas-payment-integration-from-days-to-just-a-couple-of-minutes "RenderAI — read the story")[![SuperScale](/logos/clients/superscale.png) ](/customer-story/nimblebits-revenue-boost-with-a-web-store-solution "SuperScale — read the story")[![NimbleBit](/logos/clients/nimblebit.png) ](/customer-story/nimblebits-revenue-boost-with-a-web-store-solution "NimbleBit — read the story")![DynamicNext](/logos/clients/dynamicnext.png)![Kepithor](/logos/clients/kepithor.png)![Imagina RPG](/logos/clients/imagina.png)  [![FreeVocals](/logos/clients/freevocals.png)](/customer-story/freevocals-com-and-fungies-io-a-seamless-solution-for-digital-e-commerce "FreeVocals — read the story")![STATSCORE](/logos/clients/statscore.png)![SimFabric](/logos/clients/simfabric.png)![BotRix](/logos/clients/botrix.png)![Enhance AI](/logos/clients/enhance-ai.png)![The Humanize AI](/logos/clients/humanize-ai.png)![Kenerate AI](/logos/clients/kenerate.png)

![Subscription products in the Fungies dashboard, each with the plans and offers a customer can buy.](/_astro/subscriptions.CS4yi8pK_1kMw30.webp?dpl=dpl_EJw5ge4UsaQGQ25RDSHgTGzqJ2Pi)

The same objects you create over the API, seen from the other side.

## The objects your pricing table becomes

Products, plans and offers

A product is the thing you sell. Plans express the tiers inside a subscription product. An offer is the purchasable price on top: currency, billing interval, trial. Monthly and annual are two offers, not two products, and that distinction is what keeps upgrades and reporting coherent.

Trials, including ending them early

Start a subscription in trial and let it convert on its own, or call the API to end the trial when somebody upgrades before it runs out and take the first payment there and then.

Plan changes with proration

Move a subscription to another plan mid-cycle and the difference is worked out to the day. You can preview the upcoming renewal through the API first, so the figure you show the customer is the figure they are charged.

Usage and one-off amounts

Usage-based and pay-as-you-go pricing are supported as plan shapes, and you can charge a single amount onto a live subscription for an overage, an add-on, or seats bought halfway through a month — no second checkout required.

Retries on a declined renewal

A failed charge is retried on a schedule and the customer is told, rather than the subscription being dropped on the first decline. The failure arrives as an event if you want your own recovery messaging running alongside ours.

The records each charge produces

Every charge, first or fortieth, is its own payment object, and the buyer receives either a receipt or a tax invoice depending on whether they entered business details at checkout. The documents are issued in our name, because we are the seller of record on the sale.

## From a pricing table to the first renewal

1.  01
    
    ### Create the product, then an offer per price
    
    In the dashboard or over the API — the same objects either way. The interval, the currency and any trial belong to the offer rather than to the product, which is why a new price point never needs a new product.
    
2.  02
    
    ### Open a checkout that tells you who it was
    
    Point a button, a link or an SDK call at a checkout element and pass a custom field carrying your own user identifier. That field is what lets the webhook you get back map cleanly onto a row in your database.
    
3.  03
    
    ### Grant access on payment\_success
    
    It fires for the first charge and for every renewal, and it is the only event that means money actually arrived. subscription\_created can fire while the first payment is still pending, so treat it as information rather than as permission.
    
4.  04
    
    ### Handle changes through the subscription endpoints
    
    Update with proration, pause collection, charge a one-off amount, end a trial, cancel. When a subscription\_updated arrives, read the subscription back instead of inferring its state from the order the events turned up in.
    

## Modelling decisions that pay off later

01

### One product, many offers

Duplicating a product per price point is the cheapest mistake to make and among the most expensive to unwind: reporting splits down the middle, upgrades degrade into cancel-and-resubscribe, and proration stops being available at all. Offers exist so the price can vary while the product identity holds still.

02

### Show the prorated number before you commit the change

Previewing the upcoming renewal turns a plan change from a surprise on a statement into an amount the customer agreed to. It is also, in practice, the difference between a completed upgrade and a support ticket.

03

### Treat events as notifications, not as state

Delivery is at-least-once and can arrive out of order, so store the event id, skip anything already handled, and read the object back when correctness matters. A billing integration that trusts event ordering fails in a way that is very hard to reproduce afterwards.

04

### The tax on each charge is not your code

As Merchant of Record we calculate and file the transaction tax on the first charge and every renewal. There is no rate table in your application, no tax branch in your billing tests, and no filing that depends on your deploy schedule.

## What sellers say once they have switched

[★★★★★ 4.8/5 from 10 reviews on G2 →](https://www.g2.com/products/fungies-io/reviews)

 [Vadim Finayev Head of Growth, Leadsin.io

“We work with quite a few merchants of record, but none comes close to the support and speed of implementation of Fungies. If you want a payment partner that actually gives you the feeling they want to work with you — rather than leaving you on read for three days or randomly restricting your account — you are in the right place.”

Read the story →](/customer-story/hosted-checkout-solution-for-leadsin-io-a-saas-business) [David Elliott Creative Director, Freevocals.com

“I researched the options and Fungies was the best fit for functionality and customisation within a store builder you can connect to your own domain. Taking a small percentage of sales, instead of charging a subscription for every environment and plugin, is refreshing.”

Read the story →](/customer-story/freevocals-com-and-fungies-io-a-seamless-solution-for-digital-e-commerce) [Elnura Abdimanap Kyzy Founder, TextToVideo.bot

“The platform is user-friendly, integrates easily with APIs and webhooks, and simplifies managing digital products and subscriptions. We were up and running quickly and support has been responsive throughout. Fungies is clearly tailored to the needs of SaaS businesses.”

Read the story →](/customer-story/how-fungies-enabled-texttovideo-bot-to-integrate-payments-in-minutes) [Francisco Magnone Rienzi Founder, Renderai.app

“Fungies has been a great partner — fast setup, competitive pricing, and real humans providing quick answers. They are constantly rolling out new features, and I am excited to see what is next.”

Read the story →](/customer-story/helping-renderai-reduce-their-ai-saas-payment-integration-from-days-to-just-a-couple-of-minutes)

## Billing model questions

### What is the difference between a plan and an offer?

### How do I move someone to another plan and know the amount first?

### Can I bill for usage or overages?

### What happens to a declined renewal?

### Do I have to generate invoices myself?

Subscriptions and billing

## Recurring revenue, and the paperwork that comes with it.

-   [Recurring Billing →](/recurring-billing)
-   [Subscription Management Platform →](/subscription-management)
-   [Invoice Software →](/invoice-software)

## Model it once and stop maintaining billing

Create a product with two offers, run a subscription through the sandbox including a declined renewal, and read the events that arrive before you write any of it into your app.

[Start free](https://app.fungies.io/register)

[Book a demo](https://calendly.com/duke-vuh/fungies-io-demo-clone)

No upfront costs. No credit card required.

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://fungies.io/#organization","name":"Fungies","legalName":"Fungies Inc.","url":"https://fungies.io/","description":"Merchant of Record for SaaS, games, and digital products. Fungies handles global payments, VAT and sales tax, and checkout. Free to start, commission only.","slogan":"Tax-compliant payments for everything digital","logo":{"@type":"ImageObject","url":"https://fungies.io/brand/fungies-logo-black.svg"},"image":"https://fungies.io/og-image.jpg","address":{"@type":"PostalAddress","streetAddress":"2100 Geng Road, Suite 210","addressLocality":"Palo Alto","addressRegion":"CA","postalCode":"94303","addressCountry":"US"},"sameAs":["https://www.facebook.com/fungies.io","https://www.linkedin.com/company/fungies","https://twitter.com/fungies_io","https://t.me/fungies_announcements","https://discord.gg/yfH5ZyTZH4","https://www.youtube.com/@Fungies","https://www.tiktok.com/@fungies_io"],"contactPoint":[{"@type":"ContactPoint","contactType":"customer support","email":"support@fungies.io","url":"https://help.fungies.io/","availableLanguage":["en"]}]},{"@type":"WebSite","@id":"https://fungies.io/#website","name":"Fungies","url":"https://fungies.io/","description":"Merchant of Record for SaaS, games, and digital products. Fungies handles global payments, VAT and sales tax, and checkout. Free to start, commission only.","inLanguage":"en","publisher":{"@id":"https://fungies.io/#organization"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://fungies.io/"},{"@type":"ListItem","position":2,"name":"SaaS billing API and invoicing","item":"https://fungies.io/saas-billing-api-invoicing"}]},{"@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the difference between a plan and an offer?","acceptedAnswer":{"@type":"Answer","text":"A plan is how a subscription product's tiers are expressed. An offer is the purchasable pricing configuration a checkout points at — currency, billing interval, trial. The practical rule is that a new price never requires a new product."}},{"@type":"Question","name":"How do I move someone to another plan and know the amount first?","acceptedAnswer":{"@type":"Answer","text":"Preview the upcoming renewal through the API, show the customer that number, then apply the update. Either way the change is prorated to the day, so nobody pays twice for a period they have already had."}},{"@type":"Question","name":"Can I bill for usage or overages?","acceptedAnswer":{"@type":"Answer","text":"Yes. Usage-based and pay-as-you-go pricing are supported, and you can charge a one-off amount onto a live subscription for an overage, an add-on, or seats added mid-cycle."}},{"@type":"Question","name":"What happens to a declined renewal?","acceptedAnswer":{"@type":"Answer","text":"It is retried on a schedule and the customer is notified before anything is cancelled. The failure is also delivered as an event, so you can run your own dunning inside the product if that is where your users will actually see it."}},{"@type":"Question","name":"Do I have to generate invoices myself?","acceptedAnswer":{"@type":"Answer","text":"No. Each charge produces its own record, and the customer receives a receipt or, if they gave business details and a tax ID at checkout, a tax invoice by email. They are issued by us as the seller of record, and customers can find them again in the portal without going through you."}}]}]}
```
