@getopenpay/client
Version:
OpenPay API TypeScript SDK
263 lines (262 loc) • 6.75 kB
TypeScript
/**
* OpenPay API
* super charge your subscription management.
*
* The version of the OpenAPI document: 1.2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import type { CollectionMethodEnum } from './CollectionMethodEnum';
import type { SubscriptionItemExternal } from './SubscriptionItemExternal';
import type { CalendarIntervalEnum } from './CalendarIntervalEnum';
import type { DiscountExternal } from './DiscountExternal';
import type { SubscriptionCancellationDetails } from './SubscriptionCancellationDetails';
import type { CurrencyEnum } from './CurrencyEnum';
import type { ObjectName } from './ObjectName';
import type { SubscriptionStatusEnum } from './SubscriptionStatusEnum';
/**
*
* @export
* @interface SubscriptionExternal
*/
export interface SubscriptionExternal {
/**
* Unique Identifier of the account.
* @type {string}
* @memberof SubscriptionExternal
*/
accountId: string;
/**
*
* @type {CalendarIntervalEnum}
* @memberof SubscriptionExternal
*/
billingInterval?: CalendarIntervalEnum | null;
/**
*
* @type {number}
* @memberof SubscriptionExternal
*/
billingIntervalCount?: number | null;
/**
* Whether this subscription should cancel at the end of contract or billing cycle.
* @type {boolean}
* @memberof SubscriptionExternal
*/
cancelAtEnd: boolean;
/**
*
* @type {SubscriptionCancellationDetails}
* @memberof SubscriptionExternal
*/
cancellationDetails?: SubscriptionCancellationDetails | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
cancelledAt: Date | null;
/**
*
* @type {string}
* @memberof SubscriptionExternal
*/
checkoutSessionId?: string | null;
/**
* Invoices that are generated from this subscription have this collection method.
* @type {CollectionMethodEnum}
* @memberof SubscriptionExternal
*/
collectionMethod: CollectionMethodEnum;
/**
*
* @type {boolean}
* @memberof SubscriptionExternal
*/
contractAutoRenew?: boolean | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
contractStart?: Date | null;
/**
* DateTime at which the object was created, in 'ISO 8601' format.
* @type {Date}
* @memberof SubscriptionExternal
*/
createdAt: Date;
/**
*
* @type {CurrencyEnum}
* @memberof SubscriptionExternal
*/
currency: CurrencyEnum | null;
/**
* End of the current billing period, in 'ISO 8601' format.
* @type {Date}
* @memberof SubscriptionExternal
*/
currentPeriodEnd: Date;
/**
* Starting of the current billing period, in 'ISO 8601' format.
* @type {Date}
* @memberof SubscriptionExternal
*/
currentPeriodStart: Date;
/**
*
* @type {object}
* @memberof SubscriptionExternal
*/
customFields?: object | null;
/**
* Unique Identifier of the customer.
* @type {string}
* @memberof SubscriptionExternal
*/
customerId: string;
/**
*
* @type {string}
* @memberof SubscriptionExternal
*/
defaultPaymentMethodId: string | null;
/**
*
* @type {string}
* @memberof SubscriptionExternal
*/
description: string | null;
/**
*
* @type {DiscountExternal}
* @memberof SubscriptionExternal
*/
discount?: DiscountExternal | null;
/**
* Unique Identifier of the subscription.
* @type {string}
* @memberof SubscriptionExternal
*/
id: string;
/**
* Very beginning of the subscription, in 'ISO 8601' format.
* @type {Date}
* @memberof SubscriptionExternal
*/
initialStart: Date;
/**
* If true, indicates that this object has been deleted
* @type {boolean}
* @memberof SubscriptionExternal
*/
isDeleted?: boolean;
/**
*
* @type {object}
* @memberof SubscriptionExternal
*/
metadata?: object | null;
/**
* Name for this subscription.
* @type {string}
* @memberof SubscriptionExternal
*/
name: string;
/**
*
* @type {number}
* @memberof SubscriptionExternal
*/
netD: number | null;
/**
*
* @type {ObjectName}
* @memberof SubscriptionExternal
*/
object?: ObjectName;
/**
*
* @type {boolean}
* @memberof SubscriptionExternal
*/
pauseAtEnd?: boolean | null;
/**
*
* @type {number}
* @memberof SubscriptionExternal
*/
pauseForCycles?: number | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
pausedAt?: Date | null;
/**
*
* @type {number}
* @memberof SubscriptionExternal
*/
remainingBillingCycles?: number | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
renewsAt?: Date | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
resumesAt?: Date | null;
/**
* Current status of the subscription.
* @type {SubscriptionStatusEnum}
* @memberof SubscriptionExternal
*/
status: SubscriptionStatusEnum;
/**
* List of subscription items.
* @type {Array<SubscriptionItemExternal>}
* @memberof SubscriptionExternal
*/
subscriptionItems: Array<SubscriptionItemExternal>;
/**
*
* @type {number}
* @memberof SubscriptionExternal
*/
totalBillingCycles?: number | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
trialEnd?: Date | null;
/**
*
* @type {Date}
* @memberof SubscriptionExternal
*/
trialStart?: Date | null;
/**
* DateTime at which the object was updated, in 'ISO 8601' format.
* @type {Date}
* @memberof SubscriptionExternal
*/
updatedAt: Date;
}
/**
* Check if a given object implements the SubscriptionExternal interface.
*/
export declare function instanceOfSubscriptionExternal(value: object): value is SubscriptionExternal;
export declare function SubscriptionExternalFromJSON(json: any): SubscriptionExternal;
export declare function SubscriptionExternalFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubscriptionExternal;
export declare function SubscriptionExternalToJSON(json: any): SubscriptionExternal;
export declare function SubscriptionExternalToJSONTyped(value?: SubscriptionExternal | null, ignoreDiscriminator?: boolean): any;