UNPKG

@bebapps/rapyd-sdk

Version:

An un-official [Rapyd](https://rapyd.net) SDK for Node.js.

59 lines (58 loc) 2.03 kB
export interface CreateSubscriptionRequest { /** * Determines the method of billing. Set to **pay_automatically**. */ billing: string; /** * Determines the start of the next billing cycle, as defined in the plan described in the 'items'. Value must be timestamp in [*Unix time*](ref:glossary). */ billing_cycle_anchor?: string; /** * Terminates the subscription at the end of the current billing period. Default is **false**. */ cancel_at_period_end?: boolean; /** * The ID of a discount coupon that applies to all subscription items associated with this subscription. If the coupon defines a fixed monetary discount, it must use the same currency as the subscription's plan. */ coupon?: string; /** * ID of the customer who pays for this subscription. String starting with **cus_**. Relevant to payments. */ customer?: `cus_${string}`; /** * Number of days between the date of issuance of an invoice and the date payment is due. */ days_until_due?: number; /** * A JSON object defined by the client. */ metadata?: object; /** * Object containing fields of the 'payment' object. */ payment_fields?: object; /** * Payment method ID or 'payment_method' object. */ payment_method?: string; /** * Array of subscription items. Each item contains a plan (required) and a quantity (optional). */ subscription_items: (object)[]; /** * The percentage of tax that is applied to the entire amount of the invoice or periodic billing statement. */ tax_percent?: string; /** * The time of the end of the customer's free trial period. If `trial_from_plan` is set, leave this parameter unset. */ trial_end?: number; /** * Determines whether a free trial period can be defined in a 'plan' object attached to the subscription. If `trial_end` is set, leave this parameter unset. */ trial_from_plan?: boolean; /** * The number of days in the customer's free trial period. */ trial_period_days?: number; };