UNPKG

@bebapps/rapyd-sdk

Version:

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

50 lines (48 loc) 2.13 kB
import { Payout } from './Payout'; export interface Subscription { /** * ID of the Subscription object. String starting with **sub_**. */ id: `sub_${string}`; /** * Determines the method of operation at the end of the payout cycle. Set to **pay_automatically** - Rapyd generates a 'payout' object, then attempts to pay it using the designated payout method. */ billing: string; /** * Determines the last date that the payout is transferred. * * - **false** - When the subscription is created, no end is defined. * - **true** - Payout is transferred until the end of the current cycle, then the subscription is canceled. The value must be **true** when canceling a payout subscription. */ cancel_at_period_end: boolean; /** * A JSON object defined by the client. */ metadata: object; /** * Contains fields of the 'payout' object. Defines a recurring payout, such as disbursement of pensions or salaries. For more information, see [Payout Object](ref:payout-object) . */ payout_fields: Partial<Payout>; /** * In payout subscription requests, an object containing the following fields: * - `plan` - ID of a plan that describes the service and pricing structure. String. * - `quantity` - Number of units of the service described in `plan`. * * In responses, an object containing the following fields: * - `data` - One subscription item. * - `has_more` - Indicates whether there are more than three items in this subscription. In payout subscription, the value is always **false**. * - `total_count` - Total number of items in this subscription. In payout subscription, the value is always **1**. * - `url` - URL for requesting all of the items in this subscription. */ subscription_items: { plan: unknown; quantity: unknown; data: unknown; has_more: unknown; total_count: unknown; url: unknown }; /** * Total amount of subscription items that are not displayed. */ total_count: number; /** * The type of the subscription. One of the following values: * - **payment** * - **payout** */ type: 'payment' | 'payout'; };