Pricing plans, usage, and billing
Create SaaS pricing plans and manage subscriptions and usage for each tenant.
Integrate with Stripe to use your pricing plans and recorded usage for billing.
Related API links use operation names from Pricing API and Auth API.
Pricing structure design
Create pricing plans that combine fixed monthly charges with usage-based charges such as API call counts.
Build plans using meter units to record usage, pricing units to define charges, and feature menus to group pricing units. Apply the resulting plan and tax rate to a tenant.
| Feature | Details | Related APIs |
|---|---|---|
| Get, create, update, and delete meter units | Define items for recording usage, such as API call counts. With Stripe integration, choose sum or max as the aggregation method for daily and monthly usage retrieval and billing. Without Stripe integration, the aggregation setting is not shown in the console and the method is sum. For meter units used in a pricing unit, only the display name and description can be changed; deletion is not allowed. Create a new meter unit to change what is measured or how it is aggregated.References: Meter Unit Setting | GetMeteringUnits CreateMeteringUnit UpdateMeteringUnitByID DeleteMeteringUnitByID |
| Manage pricing units | Set charges, currency, and billing model: fixed, usage-based, tiered, or tiered usage. Usage-based billing references a meter unit. For pricing units used in a feature menu, only the display name, description, and usage limit can be changed (fixed units have no usage limit). Deletion is not allowed; create a new unit to change charges or the billing model. References: Creating Pricing Plans / The difference in rate calculation between Tiered units and Tiered usage units | GetPricingUnits GetPricingUnit CreatePricingUnit UpdatePricingUnit DeletePricingUnit |
| Manage feature menus | Group pricing units, such as fixed monthly charges and usage-based charges, into feature menus. For menus used in a pricing plan, only the display name and description can be changed. Their composition cannot be changed and deletion is not allowed; create a new menu to use a different combination of pricing units. References: Creating Pricing Plans | GetPricingMenus GetPricingMenu CreatePricingMenu UpdatePricingMenu DeletePricingMenu |
| Manage pricing plans | Combine feature menus into pricing plans. For plans applied or scheduled for a tenant, only the display name and description can be changed. Their composition cannot be changed and deletion is not allowed; create a new plan to use a different combination of menus. References: Pricing Plan Overview / Creating Pricing Plans | GetPricingPlans GetPricingPlan CreatePricingPlan UpdatePricingPlan DeletePricingPlan |
| Get and create tax rates; update display names and descriptions | Register the tax percentage, inclusive or exclusive tax, and country, then select the tax rate when applying a plan to a tenant. You can update an existing tax rate’s display name and description, but not its percentage or other tax properties. References: Tax Rate Settings | GetTaxRates CreateTaxRate UpdateTaxRate |
| Reset all pricing plans | Delete pricing definitions and recorded usage together in development or staging environments. Use Account Settings > Others in the SaaS Development Console or call the API. This operation is not available in production. See “Reset pricing plans” below for the scope of deletion. | ResetPlan |
Reset pricing plans
Resetting deletes the following information in the selected environment:
- Pricing plans, feature menus, pricing units, meter units, and tax rates
- Recorded usage
- Scheduled plan changes and plan histories for all tenants
If Stripe integration is configured, resetting also removes the integration mappings and secret key from SaaSus Platform and disconnects Stripe.
Products, customers, and subscriptions in Stripe are not deleted.
Record and retrieve usage
Record usage for each tenant by meter unit and retrieve it by day, month, or time range.
Call the recording APIs when the measured activity occurs in your SaaS application, and use the results to display usage or calculate charges.
| Feature | Details | Related APIs |
|---|---|---|
| Add, subtract, or overwrite usage at the current or a specified time | Record usage for a tenant and meter unit. Choose add, sub, or direct to add, subtract, or overwrite the count. Updates apply to the record at the specified timestamp, in Unix seconds, rather than the aggregated value for the entire period. References: Metering API Implementation Samples | UpdateMeteringUnitTimestampCountNow UpdateMeteringUnitTimestampCount |
| Delete usage at a specified time | Delete usage recorded at a specified time for a tenant and meter unit, for example to remove an incorrect record. References: Metering API Implementation Samples | DeleteMeteringUnitTimestampCount |
| Get usage for today, a specified day, this month, or a specified month | Retrieve the aggregated value for one meter unit for a specified day or month. The meter unit’s aggregation method determines the result: sum returns the total of recorded values for the period, and max returns the maximum.References: Billing Dashboard Implementation | GetMeteringUnitDateCountByTenantIdAndUnitNameToday GetMeteringUnitDateCountByTenantIdAndUnitNameAndDate GetMeteringUnitMonthCountByTenantIdAndUnitNameThisMonth GetMeteringUnitMonthCountByTenantIdAndUnitNameAndMonth |
| Get usage for a time range | Specify start and end timestamps to retrieve timestamped records within a period. The meter unit’s aggregation method (sum or max) is not applied. Calculate totals or maximum values for that period in your SaaS application.References: Metering API Implementation Samples | GetMeteringUnitDateCountByTenantIdAndUnitNameAndDatePeriod |
| Get usage for multiple meters | Retrieve aggregated values for all meter units of a tenant for a specified day or month. Each meter unit’s setting determines its result: sum returns the total of recorded values for the period, and max returns the maximum.References: Billing Dashboard Implementation | GetMeteringUnitDateCountsByTenantIdAndDate GetMeteringUnitMonthCountsByTenantIdAndMonth |
With Stripe integration, you cannot modify usage for past billing periods or periods before a plan change. You also cannot subtract more than the value recorded at the specified timestamp.
Tenant subscriptions
Manage the pricing plan, tax rate, and effective time for each tenant.
Configure subscriptions in the SaaS Operations Console, or implement plan selection and changes in your application.
| Feature | Details | Related APIs |
|---|---|---|
| Apply, change, or cancel a pricing plan | Apply a pricing plan and tax rate to a tenant, change the plan, or cancel it. Apply changes immediately or at a specified time, and check or cancel scheduled changes. Tenant information includes the current plan and plan history. With Stripe integration, plan changes support prorations. See “Prorations when changing plans” below for invoice timing and other details. References: Set a Pricing Plan for Tenants / Change Tenant Pricing Plan Settings / Cancel the Tenant Pricing Plan / Canceling a Scheduled Change / Plan Change Implementation | GetTenant GetTenants UpdateTenantPlan |
Scheduled changes cannot be modified or canceled from five minutes before their effective time.
With Stripe integration, a scheduled change that removes metered subscription items (delete_usage) cannot be canceled.
Prorations when changing plans
With Stripe integration, pricing plan changes support prorations.
Changes made through the SaaS Operations Console invoice the prorated difference immediately.
Use proration_behavior in UpdateTenantPlan to specify whether to prorate and when to invoice the difference.
always_invoice: Issue an invoice for the prorated difference immediately.create_prorations: Include the prorated difference in the next invoice.none: Do not prorate the plan change.
Example with fixed monthly prices
Suppose a tenant switches from a JPY 25,000 monthly plan to a JPY 28,000 monthly plan halfway through the billing period. Excluding tax and usage-based charges, the difference is:
- Unused time on the old plan: −JPY 12,500
- Remaining time on the new plan: +JPY 14,000
- Difference: JPY 1,500
For the reverse change from JPY 28,000 to JPY 25,000 per month, the −JPY 1,500 difference is retained as a Stripe credit and applied to future invoices.
Stripe calculates the actual amounts to the second based on the change time and billing period.