Skip to main content

Pricing API

SaaSus Pricing API Schema (1.0.0)

SaaSus Pricing API Schema

pricingUnits

Pricing Units

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:
Bearer

Responses

Response samples

Content type
application/json
{
  • "units": [
    ]
}

Create Pricing Unit

Create a pricing unit.

Authorizations:
Bearer
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

Content type
application/json
Example
{
  • "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": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "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": [
    ]
}

Get Pricing Unit

Get a pricing unit.

Authorizations:
Bearer
path Parameters
pricing_unit_id
required
string (Uuid)
Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775

Unit ID

Responses

Response samples

Content type
application/json
Example
{
  • "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": [
    ]
}

Delete Pricing Unit

Delete a pricing unit.

Authorizations:
Bearer
path Parameters
pricing_unit_id
required
string (Uuid)
Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775

Unit ID

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Update Pricing Unit

Update pricing unit.

Authorizations:
Bearer
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

Content type
application/json
Example
{
  • "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": [
    ]
}

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

pricingMenus

Pricing Menus

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:
Bearer

Responses

Response samples

Content type
application/json
{
  • "pricing_menus": [
    ]
}

Create a Pricing Feature Menu

Create a pricing feature menu.

Authorizations:
Bearer
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

Content type
application/json
{
  • "name": "Ten Users Menu",
  • "display_name": "10ユーザーメニュー",
  • "description": "Can use 10 users.",
  • "unit_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
  • "name": "Ten Users Menu",
  • "display_name": "10ユーザーメニュー",
  • "description": "Can use 10 users.",
  • "used": false,
  • "units": [
    ]
}

Get Pricing Feature Menu

Get a pricing feature menu.

Authorizations:
Bearer
path Parameters
menu_id
required
string (Uuid)
Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775

Menu ID

Responses

Response samples

Content type
application/json
{
  • "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
  • "name": "Ten Users Menu",
  • "display_name": "10ユーザーメニュー",
  • "description": "Can use 10 users.",
  • "used": false,
  • "units": [
    ]
}

Delete Pricing Feature Menu

Delete pricing feature menu.

Authorizations:
Bearer
path Parameters
menu_id
required
string (Uuid)
Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775

Menu ID

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Update Pricing Feature Menu

Update pricing feature menu.

Authorizations:
Bearer
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

Content type
application/json
{
  • "name": "Ten Users Menu",
  • "display_name": "10ユーザーメニュー",
  • "description": "Can use 10 users.",
  • "unit_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

pricingPlans

Pricing Plans

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:
Bearer

Responses

Response samples

Content type
application/json
{
  • "pricing_plans": [
    ]
}

Create Pricing Plan

Create a pricing plan.

Authorizations:
Bearer
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

Content type
application/json
{
  • "name": "Standard Plan",
  • "display_name": "スタンダードプラン",
  • "description": "Standard Plan for normal use",
  • "menu_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
  • "name": "Standard Plan",
  • "display_name": "スタンダードプラン",
  • "description": "Standard Plan for normal use",
  • "used": false,
  • "pricing_menus": [
    ]
}

Get Pricing Plan

Get a pricing plan.

Authorizations:
Bearer
path Parameters
plan_id
required
string (Uuid)
Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775

Pricing Plan ID

Responses

Response samples

Content type
application/json
{
  • "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
  • "name": "Standard Plan",
  • "display_name": "スタンダードプラン",
  • "description": "Standard Plan for normal use",
  • "used": false,
  • "pricing_menus": [
    ]
}

Delete Pricing Plan

Delete a pricing plan.

Authorizations:
Bearer
path Parameters
plan_id
required
string (Uuid)
Example: 69e732d6-8ecc-45c4-c2eb-8438f7ffe775

Pricing Plan ID

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Update Pricing Plan

Update a pricing plan.

Authorizations:
Bearer
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

Content type
application/json
{
  • "name": "Standard Plan",
  • "display_name": "スタンダードプラン",
  • "description": "Standard Plan for normal use",
  • "menu_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Update Used Flag

Update price plan and feature menu/pricing unit to used.

Authorizations:
Bearer
Request Body schema: application/json
plan_ids
required
Array of strings (Uuid)

Responses

Request samples

Content type
application/json
{
  • "plan_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Connect to Stripe

Connect information to Stripe.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Delete Product Data from Stripe

Delete product data from Stripe.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Delete all Plans, Menus, Units, Meters and Tax Rates

Unconditionally remove all rate plans, menus, units, meters and tax rates.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

metering

Metering

Get Metering Unit Count for Specific Date

Gets the metering unit count for a specific date.

Authorizations:
Bearer
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

Content type
application/json
{
  • "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:
Bearer
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

Content type
application/json
{
  • "method": "add",
  • "count": 10000
}

Response samples

Content type
application/json
{
  • "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:
Bearer
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

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Get Metering Unit Count for the Current Day

Get the metering unit count for the current day.

Authorizations:
Bearer
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

Content type
application/json
{
  • "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:
Bearer
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

Content type
application/json
{
  • "method": "add",
  • "count": 10000
}

Response samples

Content type
application/json
{
  • "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:
Bearer
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

Content type
application/json
{
  • "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:
Bearer
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

Content type
application/json
{
  • "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:
Bearer
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

Content type
application/json
{
  • "counts": [
    ]
}

Get All Metering Unit Counts for the Specified Month

Gets all metering unit counts for the specified month.

Authorizations:
Bearer
path Parameters
tenant_id
required
string
Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838

Tenant ID

month
required
string
Example: 2022-01

Month

Responses

Response samples

Content type
application/json
{
  • "counts": [
    ]
}

Obtain metering unit counts for a specified date/time period

Obtain metering unit counts for a specified date/time period.

Authorizations:
Bearer
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

Content type
application/json
{
  • "metering_unit_name": "storage_unit",
  • "counts": [
    ]
}

Create Metering Unit

Create a metering unit.

Authorizations:
Bearer
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

Content type
application/json
{
  • "unit_name": "storage_unit",
  • "aggregate_usage": "sum",
  • "display_name": "User Count Meter",
  • "description": "Number of users count"
}

Response samples

Content type
application/json
{
  • "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"
}

Get all metering units

Get all metering units.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "units": [
    ]
}

Update Metering Unit

Update metering unit.

Authorizations:
Bearer
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

Content type
application/json
{
  • "unit_name": "storage_unit",
  • "aggregate_usage": "sum",
  • "display_name": "User Count Meter",
  • "description": "Number of users count"
}

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

Delete Metering Unit

Delete metering unit.

Authorizations:
Bearer
path Parameters
metering_unit_id
required
string
Example: 46af35b5-60de-4cd8-9412-19a3a5d1f838

Metering Unit ID

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

taxRate

Tax Rate

Create Tax Rate

Creates a tax rate.

Authorizations:
Bearer
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

Content type
application/json
{
  • "name": "japanese_consumption_tax_inclusive",
  • "display_name": "消費税(外税)",
  • "percentage": 10,
  • "inclusive": false,
  • "country": "JP",
  • "description": "SaaSusとの連携用の税率"
}

Response samples

Content type
application/json
{
  • "id": "69e732d6-8ecc-45c4-c2eb-8438f7ffe775",
  • "name": "japanese_consumption_tax_inclusive",
  • "display_name": "消費税(外税)",
  • "percentage": 10,
  • "inclusive": false,
  • "country": "JP",
  • "description": "SaaSusとの連携用の税率"
}

Get Tax Rates

Get all Tax Rates

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "tax_rates": [
    ]
}

Update Tax Rate

Update tax rate.

Authorizations:
Bearer
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

Content type
application/json
{
  • "display_name": "消費税(外税)",
  • "description": "SaaSusとの連携用の税率"
}

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}

error

Testing Purpose Error

Return Internal Server Error

This endpoint is used for testing purposes. Returns a server error with status code 500.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "type": "string",
  • "message": "string"
}