UNPKG

@bebapps/rapyd-sdk

Version:

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

58 lines (57 loc) 2.49 kB
export interface Plan { /** * Unique ID for this payment plan. Legal input includes alphanumeric characters and the underscore (_) character. If the merchant does not define an ID, Rapyd generates a string starting with **plan\_**. */ id: string; /** * The amount to pay out, 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. */ amount: number; /** * Time the `plan` object was created, in [*Unix time*](ref:glossary). Response only. */ created_at: number; /** * Three-letter ISO 4217 code for the currency used in the `amount` field. Uppercase. */ currency: string; /** * Specifies the units used in defining the payout cycle. One of the following: * * **day** * * **week** * * **month** * * **year** * * Maximum interval is 1 year. * * When `interval_count` is set to **1**, the cycle ends at the following times: * * **day**: Cycle ends after one day at 1:00 AM GMT time. * * **week**: Cycle ends after seven days at 1:00 AM GMT time. * * **month**: Cycle ends on the same day on the next month at 1:00 AM GMT time. For example, a monthly cycle that started on Jan. 23 will end on Feb. 23 at 1:00 AM GMT. In scenarios where the day does not exist in the next month, the cycle will end on the last day of the next month at 1:00 AM GMT. For example, a monthly cycle that started on Oct. 31 will end on Nov. 30 at 1:00 AM GMT. * * **year**: Cycle ends on the same date on the next year at 1:00 AM GMT time. In a leap year, a cycle that started on Feb. 29 will end on the next year on Feb. 28 at 1:00 AM GMT. */ interval: 'day' | 'week' | 'month' | 'year' | 'day' | 'week' | 'month' | 'year'; /** * Number of time intervals in the payout cycle. Integer. * * The payout cycle is defined in the `interval` and `interval_count` fields of the plan. * For example, to set the payout cycle to three months, set the following fields: * "interval": "month", * "interval_count": 3, */ interval_count: number; /** * A JSON object defined by the client. */ metadata: object; /** * Brief description of the plan. */ nickname: string; /** * The ID of the product that this plan is for. * * For more information, see [Product Object](ref:product-object). */ product: string; };