import { APIResource } from "../../core/resource.mjs"; import * as SubscriptionsAPI from "./subscriptions.mjs"; import { SubscriptionCancelParams, SubscriptionCancelResponse, SubscriptionListForSessionParams, SubscriptionListForSessionResponse, Subscriptions } from "./subscriptions.mjs"; import * as TransactionsAPI from "./transactions.mjs"; import { TransactionListForSessionParams, TransactionListForSessionResponse, TransactionListParams, TransactionListResponse, TransactionRefundParams, TransactionRefundResponse, Transactions } from "./transactions.mjs"; import { APIPromise } from "../../core/api-promise.mjs"; import { RequestOptions } from "../../internal/request-options.mjs"; export declare class CheckoutSessions extends APIResource { transactions: TransactionsAPI.Transactions; subscriptions: SubscriptionsAPI.Subscriptions; /** * Create a checkout session */ create(body?: CheckoutSessionCreateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Get a checkout session by ID */ retrieve(checkoutSessionID: string, options?: RequestOptions): APIPromise; /** * Delete a checkout session */ delete(checkoutSessionID: string, options?: RequestOptions): APIPromise; /** * Create an embedded checkout session */ embedded(params?: CheckoutSessionEmbeddedParams | null | undefined, options?: RequestOptions): APIPromise; /** * Get subscriptions for a specific product */ getSubscriptions(productID: string, query?: CheckoutSessionGetSubscriptionsParams | null | undefined, options?: RequestOptions): APIPromise; } export interface CheckoutSessionCreateResponse { data?: CheckoutSessionCreateResponse.Data; message?: string; status?: string; } export declare namespace CheckoutSessionCreateResponse { interface Data { checkout_session_id?: number; payment_link?: string; } } export interface CheckoutSessionRetrieveResponse { data?: CheckoutSessionRetrieveResponse.Data; message?: string; status?: string; } export declare namespace CheckoutSessionRetrieveResponse { interface Data { amount_cents?: number; expiration_date?: string | null; metadata?: { [key: string]: unknown; }; product?: Data.Product; subscription?: Data.Subscription | null; success_url?: string; type?: 'subscription' | 'onetime_reusable' | 'onetime_non_reusable'; webhook_url?: string | null; } namespace Data { interface Product { id?: string; description?: string | null; title?: string; } interface Subscription { auto_expire_after_x_periods?: number | null; free_trial_days?: number | null; frequency_days?: number; initial_fee?: number | null; initial_fee_days?: number | null; } } } export interface CheckoutSessionDeleteResponse { data?: Array; message?: string; status?: string; } export interface CheckoutSessionEmbeddedResponse { data?: CheckoutSessionEmbeddedResponse.Data; message?: string; status?: string; } export declare namespace CheckoutSessionEmbeddedResponse { interface Data { id?: string; checkout_session_secret?: string; created_at?: string; } } export interface CheckoutSessionGetSubscriptionsResponse { data?: CheckoutSessionGetSubscriptionsResponse.Data; message?: string; status?: string; } export declare namespace CheckoutSessionGetSubscriptionsResponse { interface Data { pagination?: Data.Pagination; subscriptions?: Array; } namespace Data { interface Pagination { current_page?: number; has_more?: boolean; per_page?: number; total_items?: number; total_pages?: number; } interface Subscription { id?: string; country_code?: string | null; created_at?: string; email?: string | null; first_name?: string | null; last_name?: string | null; next_renewal_date?: string; phone?: string | null; subscription_status?: string; } } } export interface CheckoutSessionCreateParams { amount_cents?: number; application_fee?: number | null; expiration_date?: string | null; metadata?: { [key: string]: unknown; }; product?: CheckoutSessionCreateParams.Product; subscription?: CheckoutSessionCreateParams.Subscription | null; success_url?: string; type?: 'subscription' | 'onetime_reusable' | 'onetime_non_reusable'; webhook_url?: string | null; } export declare namespace CheckoutSessionCreateParams { interface Product { title: string; description?: string | null; } interface Subscription { auto_expire_after_x_periods?: number | null; free_trial_days?: number | null; /** * Required if type is subscription */ frequency_days?: number; initial_fee?: number | null; initial_fee_days?: number | null; } } export interface CheckoutSessionEmbeddedParams { body?: unknown; } export interface CheckoutSessionGetSubscriptionsParams { /** * Page number for pagination */ page?: number; /** * Number of items per page */ per_page?: number; /** * Alternative way to specify the product ID */ product_id?: number; } export declare namespace CheckoutSessions { export { type CheckoutSessionCreateResponse as CheckoutSessionCreateResponse, type CheckoutSessionRetrieveResponse as CheckoutSessionRetrieveResponse, type CheckoutSessionDeleteResponse as CheckoutSessionDeleteResponse, type CheckoutSessionEmbeddedResponse as CheckoutSessionEmbeddedResponse, type CheckoutSessionGetSubscriptionsResponse as CheckoutSessionGetSubscriptionsResponse, type CheckoutSessionCreateParams as CheckoutSessionCreateParams, type CheckoutSessionEmbeddedParams as CheckoutSessionEmbeddedParams, type CheckoutSessionGetSubscriptionsParams as CheckoutSessionGetSubscriptionsParams, }; export { Transactions as Transactions, type TransactionListResponse as TransactionListResponse, type TransactionListForSessionResponse as TransactionListForSessionResponse, type TransactionRefundResponse as TransactionRefundResponse, type TransactionListParams as TransactionListParams, type TransactionListForSessionParams as TransactionListForSessionParams, type TransactionRefundParams as TransactionRefundParams, }; export { Subscriptions as Subscriptions, type SubscriptionCancelResponse as SubscriptionCancelResponse, type SubscriptionListForSessionResponse as SubscriptionListForSessionResponse, type SubscriptionCancelParams as SubscriptionCancelParams, type SubscriptionListForSessionParams as SubscriptionListForSessionParams, }; } //# sourceMappingURL=checkout-sessions.d.mts.map