Skip to main content

Plan

Properties

NameTypeRequiredDescription
aggregate_usageAggregateUsageDetermines which quantity is used to calculate the pricing. One of the following: _ max - The maximum reported usage within the billing cycle. _ sum - The sum of all usage during a billing cycle. This is the default. _ last_during_period - The last usage reported within the billing cycle. _ last_ever - The last usage ever reported, if the latest billing cycles contain no usage at all. Required when usage_type is metered. Relevant when billing_scheme is set to per_unit.
amountfloatThe amount to charge, in units of the currency defined in currency. Decimal, including the correct number of decimal places for the currency exponent, as defined in ISO 2417:2015. If the amount is a whole number, use an integer and not a decimal. For a free service, use 0. Must be null when tiers is set. Relevant when billing_scheme is set to per_unit.
billing_schemeBillingSchemeDescribes how to compute the price. One of the following: _ per_unit - The amount specified in amount is charged for each unit. Also set these related fields: amount, transform_usage, usage_type, aggregate_usage. This is the default. _ tiered - The unit pricing is computed using a tiering strategy as defined with the tiers and tiers_mode fields.
created_atfloatTime the 'plan' object was created, in Unix time. Response only.
currencystr
id_strUnique ID for this plan. English alphanumeric characters with no special characters except underscore. If the client does not define an ID, Rapyd generates a string starting with plan_.
intervalIntervalSpecifies the units used in defining the billing cycle. One of the following: _ day _ week _ month _ year Maximum interval is 1 year.
interval_countfloatNumber of time intervals in the billing cycle. Integer
metadatadictA JSON object defined by the client.
nicknamestrBrief description of the plan.
productPlanProductThe ID of the product that this plan is for, and fields describing this product in the plan.
tiersList[PlanTiers]Defines a tiered pricing structure. Each tier object represents a pricing tier.
tiers_modeTiersModeDetermines the mode for calculating the total tiered charge. One of the following values: _ graduated - The total cost at each price tier is calculated separately, then all tier charges are added together. _ volume - The total cost is calculated as the number of items times the applicable tier price. Relevant when billing_scheme is set to tiered
transform_usagePlanTransformUsageDefines the transformation that is applied to the reported usage before the billed price is computed. The transformation divides the quantity by the divisor specified in divide_by, then rounds up or down according to the setting in round. Relevant when billing_scheme is set to per_unit.
trial_period_daysfloatSpecifies the number of days before charges begin to accrue. Use this parameter to define a free trial period for a service.
usage_typeUsageTypeDetermines whether the customer is billed when the service is not actually used. Relevant when billing_scheme is set to per_unit. One of the following: _ metered - The customer is billed only for actual usage. You must also set aggregate_usage. _ licensed - The customer is billed even if the service is not used. This is the default.

AggregateUsage

Determines which quantity is used to calculate the pricing. One of the following: _ max - The maximum reported usage within the billing cycle. _ sum - The sum of all usage during a billing cycle. This is the default. _ last_during_period - The last usage reported within the billing cycle. _ last_ever - The last usage ever reported, if the latest billing cycles contain no usage at all. Required when usage_type is metered. Relevant when billing_scheme is set to per_unit.

Properties

NameTypeRequiredDescription
MAXstr"max"
SUMstr"sum"
LASTDURINGPERIODstr"last_during_period"
LASTEVERstr"last_ever"

BillingScheme

Describes how to compute the price. One of the following: _ per_unit - The amount specified in amount is charged for each unit. Also set these related fields: amount, transform_usage, usage_type, aggregate_usage. This is the default. _ tiered - The unit pricing is computed using a tiering strategy as defined with the tiers and tiers_mode fields.

Properties

NameTypeRequiredDescription
PERUNITstr"per_unit"
TIEREDstr"tiered"

Interval

Specifies the units used in defining the billing cycle. One of the following: _ day _ week _ month _ year Maximum interval is 1 year.

Properties

NameTypeRequiredDescription
MONTHstr"month"
DAYstr"day"
WEEKstr"week"
YEARstr"year"

PlanProduct

The ID of the product that this plan is for, and fields describing this product in the plan.

TiersMode

Determines the mode for calculating the total tiered charge. One of the following values: _ graduated - The total cost at each price tier is calculated separately, then all tier charges are added together. _ volume - The total cost is calculated as the number of items times the applicable tier price. Relevant when billing_scheme is set to tiered

Properties

NameTypeRequiredDescription
GRADUATEDstr"graduated"
VOLUMEstr"volume"

UsageType

Determines whether the customer is billed when the service is not actually used. Relevant when billing_scheme is set to per_unit. One of the following: _ metered - The customer is billed only for actual usage. You must also set aggregate_usage. _ licensed - The customer is billed even if the service is not used. This is the default.

Properties

NameTypeRequiredDescription
METEREDstr"metered"
LICENSEDstr"licensed"

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →