Pricing API
SaaSus Pricing API Schema (1.0.0)
SaaSus Pricing API Schema
Get Pricing Units
Gets the smallest unit of measure on which the charges are based. "Fixed Unit" (type=fixed) is a unit of a monthly fixed charge such as a basic charge, "Usage Unit" (type=usage) is a unit in which a charge is generated per unit such as billing for the number of users, "Tiered Unit" (type=tiered) is a fixed charge unit for each tier of usage, such as the tiered packet charge for mobile phones, "Tiered Usage Unit" (type=tiered_usage) is a unit where the charge per unit changes according to the usage amount, such as a volume discount.
Authorizations:
Responses
Response samples
- 200
- 500
{- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
Create Pricing Unit
Create a pricing unit.
Authorizations:
Request Body schema: application/json
upper_count required | integer Upper limit |
metering_unit_name required | string Metering unit name |
aggregate_usage | string (AggregateUsage) Enum: "sum" "max" Aggregate usage sum: Total usage during the period max: Maximum usage during the period |
name required | string Name |
display_name required | string Display Name |
description required | string Description |
type required | string (UnitType) Unit of measurement type fixed: Fixed unit usage: Usage unit tiered: Tiered unit tiered_usage: Tiered usage unit |
currency required | string (Currency) Enum: "JPY" "USD" Unit of currency |
required | Array of objects (Pricing Tier Info) |
Responses
Request samples
- Payload
{- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "tiered_usage",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
Response samples
- 201
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "tiered_usage",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
Get Pricing Unit
Get a pricing unit.
Authorizations:
path Parameters
pricing_unit_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Unit ID |
Responses
Response samples
- 200
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "tiered_usage",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
Update Pricing Unit
Update pricing unit.
Authorizations:
path Parameters
pricing_unit_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Unit ID |
Request Body schema: application/json
upper_count required | integer Upper limit |
metering_unit_name required | string Metering unit name |
aggregate_usage | string (AggregateUsage) Enum: "sum" "max" Aggregate usage sum: Total usage during the period max: Maximum usage during the period |
name required | string Name |
display_name required | string Display Name |
description required | string Description |
type required | string (UnitType) Unit of measurement type fixed: Fixed unit usage: Usage unit tiered: Tiered unit tiered_usage: Tiered usage unit |
currency required | string (Currency) Enum: "JPY" "USD" Unit of currency |
required | Array of objects (Pricing Tier Info) |
Responses
Request samples
- Payload
{- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "tiered_usage",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
Response samples
- 500
{- "type": "string",
- "message": "string"
}
Get Pricing Feature Menus
Get the feature menu list. Multiple measurement units are grouped together and defined as one feature menu. Multiple feature menus defined here are combined into one billing plan.
Authorizations:
Responses
Response samples
- 200
- 500
{- "pricing_menus": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "used": false,
- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
]
}
Create a Pricing Feature Menu
Create a pricing feature menu.
Authorizations:
Request Body schema: application/json
name required | string Menu name |
display_name required | string Menu display name |
description required | string Menu description |
unit_ids required | Array of strings (Uuid) Unit IDs to add |
Responses
Request samples
- Payload
{- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "unit_ids": [
- "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
]
}
Response samples
- 201
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "used": false,
- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
Get Pricing Feature Menu
Get a pricing feature menu.
Authorizations:
path Parameters
menu_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Menu ID |
Responses
Response samples
- 200
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "used": false,
- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
Update Pricing Feature Menu
Update pricing feature menu.
Authorizations:
path Parameters
menu_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Menu ID |
Request Body schema: application/json
name required | string Menu name |
display_name required | string Menu display name |
description required | string Menu description |
unit_ids required | Array of strings (Uuid) Unit IDs to add |
Responses
Request samples
- Payload
{- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "unit_ids": [
- "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
]
}
Response samples
- 500
{- "type": "string",
- "message": "string"
}
Get Pricing Plans
Get pricing plans. Multiple feature menus are grouped together and defined as one pricing plan. Each tenant can choose a pricing plan defined here. If you have a specific tenant-specific rate (private pricing), create and connect the pricing plan specifically for that tenant.
Authorizations:
Responses
Response samples
- 200
- 500
{- "pricing_plans": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Standard Plan",
- "display_name": "スタンダードプラン",
- "description": "Standard Plan for normal use",
- "used": false,
- "pricing_menus": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "used": false,
- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
]
}
]
}
Create Pricing Plan
Create a pricing plan.
Authorizations:
Request Body schema: application/json
name required | string Pricing plan name |
display_name required | string Pricing plan display name |
description required | string Pricing plan description |
menu_ids required | Array of strings (Uuid) Menu ID to be added to the pricing plan |
Responses
Request samples
- Payload
{- "name": "Standard Plan",
- "display_name": "スタンダードプラン",
- "description": "Standard Plan for normal use",
- "menu_ids": [
- "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
]
}
Response samples
- 201
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Standard Plan",
- "display_name": "スタンダードプラン",
- "description": "Standard Plan for normal use",
- "used": false,
- "pricing_menus": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "used": false,
- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
]
}
Get Pricing Plan
Get a pricing plan.
Authorizations:
path Parameters
plan_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Pricing Plan ID |
Responses
Response samples
- 200
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Standard Plan",
- "display_name": "スタンダードプラン",
- "description": "Standard Plan for normal use",
- "used": false,
- "pricing_menus": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "Ten Users Menu",
- "display_name": "10ユーザーメニュー",
- "description": "Can use 10 users.",
- "used": false,
- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "metering_unit_id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "recurring_interval": "month",
- "used": false,
- "upper_count": 100,
- "metering_unit_name": "test_unit",
- "aggregate_usage": "sum",
- "name": "storage_unit",
- "display_name": "ストレージユニット",
- "description": "KB unit for storage usage",
- "type": "fixed",
- "currency": "JPY",
- "tiers": [
- {
- "up_to": 5,
- "unit_amount": 1000,
- "flat_amount": 500,
- "inf": true
}
]
}
]
}
]
}
Update Pricing Plan
Update a pricing plan.
Authorizations:
path Parameters
plan_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Pricing Plan ID |
Request Body schema: application/json
name required | string Pricing plan name |
display_name required | string Pricing plan display name |
description required | string Pricing plan description |
menu_ids required | Array of strings (Uuid) Menu ID to be added to the pricing plan |
Responses
Request samples
- Payload
{- "name": "Standard Plan",
- "display_name": "スタンダードプラン",
- "description": "Standard Plan for normal use",
- "menu_ids": [
- "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
]
}
Response samples
- 500
{- "type": "string",
- "message": "string"
}
Update Used Flag
Update price plan and feature menu/pricing unit to used.
Authorizations:
Request Body schema: application/json
plan_ids required | Array of strings (Uuid) |
Responses
Request samples
- Payload
{- "plan_ids": [
- "69e732d6-8ecc-45c4-c2eb-8438f7ffe775"
]
}
Response samples
- 500
{- "type": "string",
- "message": "string"
}
Get Metering Unit Count for Specific Date
Gets the metering unit count for a specific date.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
date required | string Example: 2022-01-01 Date |
Responses
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "date": "2022-01-01",
- "count": 10000
}
Update Metering Unit Count for Specified Timestamp
Update metering unit count for the specified timestamp.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
timestamp required | integer Example: 1640995200 Timestamp |
Request Body schema: application/json
method required | string (Metering Unit Count Update Method) Enum: "add" "sub" "direct" Update method add: Addition sub: Subtraction direct: Overwrite |
count required | integer Count |
Responses
Request samples
- Payload
{- "method": "add",
- "count": 10000
}
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "timestamp": 1640995200,
- "count": 10000
}
Delete Metering Unit Count for Specified Timestamp
Deletes metering unit count for the specified timestamp.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
timestamp required | integer Example: 1640995200 Timestamp |
Responses
Response samples
- 500
{- "type": "string",
- "message": "string"
}
Get Metering Unit Count for the Current Day
Get the metering unit count for the current day.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
Responses
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "date": "2022-01-01",
- "count": 10000
}
Update Metering Unit Count for Current Time
Update the metering unit count for the current time.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
Request Body schema: application/json
method required | string (Metering Unit Count Update Method) Enum: "add" "sub" "direct" Update method add: Addition sub: Subtraction direct: Overwrite |
count required | integer Count |
Responses
Request samples
- Payload
{- "method": "add",
- "count": 10000
}
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "timestamp": 1640995200,
- "count": 10000
}
Get Metering Unit Count for the Current Month
Get the metering unit count for the current month.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
Responses
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "month": "2022-05",
- "count": 10000
}
Get the Metering Unit Count for the Specified Month
Gets the metering unit count for the specified month.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
month required | string Example: 2022-01 Month |
Responses
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "month": "2022-05",
- "count": 10000
}
Get All Metering Unit Counts for a Specified Date
Gets the total metering unit count for the specified date.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
date required | string Example: 2022-01-01 Date |
Responses
Response samples
- 200
- 500
{- "counts": [
- {
- "metering_unit_name": "storage_unit",
- "date": "2022-01-01",
- "count": 10000
}
]
}
Get All Metering Unit Counts for the Specified Month
Gets all metering unit counts for the specified month.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
month required | string Example: 2022-01 Month |
Responses
Response samples
- 200
- 500
{- "counts": [
- {
- "metering_unit_name": "storage_unit",
- "month": "2022-05",
- "count": 10000
}
]
}
Obtain metering unit counts for a specified date/time period
Obtain metering unit counts for a specified date/time period.
Authorizations:
path Parameters
tenant_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Tenant ID |
metering_unit_name required | string Example: storage_unit Metering Unit Name |
query Parameters
start_timestamp | integer Example: start_timestamp=1640995200 Start Date-Time |
end_timestamp | integer Example: end_timestamp=1640995200 End Date-Time |
Responses
Response samples
- 200
- 500
{- "metering_unit_name": "storage_unit",
- "counts": [
- {
- "timestamp": 1640995200,
- "count": 10000
}
]
}
Create Metering Unit
Create a metering unit.
Authorizations:
Request Body schema: application/json
unit_name required | string Metering unit name |
aggregate_usage | string (AggregateUsage) Enum: "sum" "max" Aggregate usage sum: Total usage during the period max: Maximum usage during the period |
display_name required | string Display name |
description required | string Description |
Responses
Request samples
- Payload
{- "unit_name": "storage_unit",
- "aggregate_usage": "sum",
- "display_name": "User Count Meter",
- "description": "Number of users count"
}
Response samples
- 201
- 400
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "used": false,
- "unit_name": "storage_unit",
- "aggregate_usage": "sum",
- "display_name": "User Count Meter",
- "description": "Number of users count"
}
Response samples
- 200
- 500
{- "units": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "used": false,
- "unit_name": "storage_unit",
- "aggregate_usage": "sum",
- "display_name": "User Count Meter",
- "description": "Number of users count"
}
]
}
Update Metering Unit
Update metering unit.
Authorizations:
path Parameters
metering_unit_id required | string Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838 Metering Unit ID |
Request Body schema: application/json
unit_name required | string Metering unit name |
aggregate_usage | string (AggregateUsage) Enum: "sum" "max" Aggregate usage sum: Total usage during the period max: Maximum usage during the period |
display_name required | string Display name |
description required | string Description |
Responses
Request samples
- Payload
{- "unit_name": "storage_unit",
- "aggregate_usage": "sum",
- "display_name": "User Count Meter",
- "description": "Number of users count"
}
Response samples
- 400
- 500
{- "type": "string",
- "message": "string"
}
Create Tax Rate
Creates a tax rate.
Authorizations:
Request Body schema: application/json
name required | string Name of tax rate |
display_name required | string Display name |
percentage required | number Percentage |
inclusive required | boolean Inclusive or not |
country required | string^[A-Z]{2}$ Country code of ISO 3166-1 alpha-2 |
description required | string Description |
Responses
Request samples
- Payload
{- "name": "japanese_consumption_tax_inclusive",
- "display_name": "消費税(外税)",
- "percentage": 10,
- "inclusive": false,
- "country": "JP",
- "description": "SaaSusとの連携用の税率"
}
Response samples
- 201
- 400
- 500
{- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "japanese_consumption_tax_inclusive",
- "display_name": "消費税(外税)",
- "percentage": 10,
- "inclusive": false,
- "country": "JP",
- "description": "SaaSusとの連携用の税率"
}
Response samples
- 200
- 500
{- "tax_rates": [
- {
- "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
- "name": "japanese_consumption_tax_inclusive",
- "display_name": "消費税(外税)",
- "percentage": 10,
- "inclusive": false,
- "country": "JP",
- "description": "SaaSusとの連携用の税率"
}
]
}
Update Tax Rate
Update tax rate.
Authorizations:
path Parameters
tax_rate_id required | string (Uuid) Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775 Tax Rate ID |
Request Body schema: application/json
display_name required | string Display name |
description required | string Description |
Responses
Request samples
- Payload
{- "display_name": "消費税(外税)",
- "description": "SaaSusとの連携用の税率"
}
Response samples
- 400
- 500
{- "type": "string",
- "message": "string"
}