// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; export class Subscribers extends APIResource { /** * Get all subscribers for a creator with optional filtering */ list( query: SubscriberListParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { return this._client.get('/subscribers', { query, ...options }); } } export interface SubscriberListResponse { data?: SubscriberListResponse.Data; message?: string; status?: string; } export namespace SubscriberListResponse { export interface Data { pagination?: Data.Pagination; subscribers?: Array; } export namespace Data { export interface Pagination { current_page?: number; has_more?: boolean; per_page?: number; total_items?: number; total_pages?: number; } export interface Subscriber { id?: string; customer?: Subscriber.Customer; product?: Subscriber.Product; subscription?: Subscriber.Subscription; } export namespace Subscriber { export interface Customer { id?: string; country_code?: string; email?: string; name?: string; phone?: string; } export interface Product { id?: string; description?: string; payment_link?: string; price?: number; title?: string; } export interface Subscription { id?: string; auto_renew_count?: number; cancelled_at?: string | null; charge_consent?: boolean; completion_date?: string; created_at?: string; payment_frequency?: number; service_type?: string; status?: string; updated_at?: string; } } } } export interface SubscriberListParams { /** * Filter by customer ID */ customer_id?: string; /** * Page number for pagination */ page?: number; /** * Number of items per page */ per_page?: number; /** * Filter by product ID */ product_id?: string; } export declare namespace Subscribers { export { type SubscriberListResponse as SubscriberListResponse, type SubscriberListParams as SubscriberListParams, }; }