@getopenpay/client
Version:
OpenPay API TypeScript SDK
159 lines (158 loc) • 4.97 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 { SubscriptionItemDetails } from './SubscriptionItemDetails';
import type { SelectedPriceQuantity } from './SelectedPriceQuantity';
import type { CheckoutPreferences } from './CheckoutPreferences';
/**
*
* @export
* @interface CreateSubscriptionRequest
*/
export interface CreateSubscriptionRequest {
/**
*
* @type {string}
* @memberof CreateSubscriptionRequest
*/
attachToCheckoutAttemptId?: string | null;
/**
* Boolean indicating whether this subscription should cancel at the end of the current period.
* @type {boolean}
* @memberof CreateSubscriptionRequest
*/
cancelAtEnd?: boolean;
/**
*
* @type {CheckoutPreferences}
* @memberof CreateSubscriptionRequest
*/
checkoutPreferences?: CheckoutPreferences | null;
/**
* Invoices generated by this subscription can either be charged automatically or can be sent to customer for payment. The latter is not automatically charged.
* @type {CollectionMethodEnum}
* @memberof CreateSubscriptionRequest
*/
collectionMethod?: CollectionMethodEnum;
/**
*
* @type {string}
* @memberof CreateSubscriptionRequest
*/
couponId?: string | null;
/**
*
* @type {object}
* @memberof CreateSubscriptionRequest
*/
customFields?: object | null;
/**
* Unique Identifier of the customer.
* @type {string}
* @memberof CreateSubscriptionRequest
*/
customerId: string;
/**
*
* @type {string}
* @memberof CreateSubscriptionRequest
*/
description?: string | null;
/**
* Whether the request is in preview mode (subscriptions won't actually be created)
* @type {boolean}
* @memberof CreateSubscriptionRequest
*/
isPreview?: boolean;
/**
*
* @type {number}
* @memberof CreateSubscriptionRequest
*/
netD?: number | null;
/**
*
* @type {string}
* @memberof CreateSubscriptionRequest
*/
paymentMethodId?: string | null;
/**
*
* @type {string}
* @memberof CreateSubscriptionRequest
*/
paymentRouteId?: string | null;
/**
*
* @type {string}
* @memberof CreateSubscriptionRequest
*/
promotionCode?: string | null;
/**
* This object contains details of selected product' price and quantity.
* @type {Array<SelectedPriceQuantity>}
* @memberof CreateSubscriptionRequest
*/
selectedProductPriceQuantity: Array<SelectedPriceQuantity>;
/**
* Whether to skip invoice payment for this subscription. Setting this to true will leave the invoices open.
* @type {boolean}
* @memberof CreateSubscriptionRequest
*/
skipInvoicePayment?: boolean;
/**
*
* @type {Date}
* @memberof CreateSubscriptionRequest
*/
startsAt?: Date | null;
/**
*
* @type {{ [key: string]: SubscriptionItemDetails; }}
* @memberof CreateSubscriptionRequest
*/
subscriptionItemDetails?: {
[key: string]: SubscriptionItemDetails;
} | null;
/**
*
* @type {number}
* @memberof CreateSubscriptionRequest
*/
totalAmountAtom?: number | null;
/**
*
* @type {Date}
* @memberof CreateSubscriptionRequest
*/
trialEnd?: Date | null;
/**
* Indicates if a price's trial_period_days should be applied to the subscription. Setting trial_end per subscription is preferred, and this defaults to false. Setting this flag to true together with trial_end is not allowed. In case of subscription containing multiple prices and the trial period of them are not same, minimum of trial days will be used.
* @type {boolean}
* @memberof CreateSubscriptionRequest
*/
trialFromPrice?: boolean;
/**
*
* @type {number}
* @memberof CreateSubscriptionRequest
*/
trialPeriodDays?: number | null;
}
/**
* Check if a given object implements the CreateSubscriptionRequest interface.
*/
export declare function instanceOfCreateSubscriptionRequest(value: object): value is CreateSubscriptionRequest;
export declare function CreateSubscriptionRequestFromJSON(json: any): CreateSubscriptionRequest;
export declare function CreateSubscriptionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSubscriptionRequest;
export declare function CreateSubscriptionRequestToJSON(json: any): CreateSubscriptionRequest;
export declare function CreateSubscriptionRequestToJSONTyped(value?: CreateSubscriptionRequest | null, ignoreDiscriminator?: boolean): any;