@bebapps/rapyd-sdk
Version:
An un-official [Rapyd](https://rapyd.net) SDK for Node.js.
63 lines (62 loc) • 2.12 kB
text/typescript
export interface CreatePlanRequest {
/**
* Determines which quantity is used to calculate the pricing. Relevant when `usage_type` is **metered**. Default is *sum*.
*/
aggregate_usage?: string;
/**
* The amount to charge in the billing cycle. Use 0 for a free service. Must be null when `tiers` is set. Default is 0.
*/
amount?: number;
/**
* Describes how to compute the price per billing period. One of the following values: **per_unit**, **tiered**
*/
billing_scheme?: string;
/**
* Three-letter ISO 4217 code for the currency used in fields that represent monetary amounts. Uppercase.
*/
currency: string;
/**
* Unique ID for this payment plan. English alphanumeric characters and underscore (_). Limited to 50 characters. If the merchant does not define an ID, Rapyd generates a string starting with **plan_**.
*/
id?: `plan_${string}`;
/**
* Specifies the units used in defining the billing cycle.
*/
interval: string;
/**
* Number of intervals in the billing cycle. Default is **1**.
*/
interval_count?: number;
/**
* A JSON object defined by the client.
*/
metadata?: object;
/**
* Brief description of the pricing plan.
*/
nickname?: string;
/**
* Specifies the number of days before charges begin to accrue. Use this parameter to define a free trial period for a service.
*/
trial_period_days?: number;
/**
* Fields or ID of the 'product' object that this plan is for. The product must have `type` set to **service**.
*/
product: string;
/**
* Defines a tiered pricing structure. Array of objects. Must be null when `amount` is set.
*/
tiers?: string;
/**
* Determines the mode for calculating the total tiered charge.
*/
tiers_mode?: string;
/**
* Defines the transformation that is applied to the reported usage before the billed price is computed. Object.
*/
transform_usage?: string;
/**
* Determines whether the customer is billed when the service is not actually used. One of the following values: **metered**, **licensed**
*/
usage_type?: string;
};