import { P as PaginationParams, B as BaseEntity, a as Address, M as Metadata, C as Currency, D as DateTime } from '../common-DxOEZ2Dn.js';
export { A as ApiError, E as ErrorResponse, L as ListResponse } from '../common-DxOEZ2Dn.js';

interface Customer extends BaseEntity {
    email: string;
    first_name?: string;
    last_name?: string;
    phone?: string;
    company?: string;
    billing_address?: Address;
    shipping_address?: Address;
    status: 'active' | 'inactive';
    metadata?: Metadata;
    payment_methods?: any[];
    default_payment_method_id?: string;
}
interface CreateCustomerRequest {
    email: string;
    first_name?: string;
    last_name?: string;
    phone?: string;
    company?: string;
    billing_address?: Address;
    shipping_address?: Address;
    metadata?: Metadata;
}
interface UpdateCustomerRequest {
    email?: string;
    first_name?: string;
    last_name?: string;
    phone?: string;
    company?: string;
    billing_address?: Address;
    shipping_address?: Address;
    metadata?: Metadata;
    status?: 'active' | 'inactive';
}
interface CreatePaymentMethodRequest {
    psp: string;
    name: string;
    type: 'card' | 'bank_account';
    details?: any;
    token: string;
    is_default?: boolean;
    billing_address?: Address;
    metadata?: Metadata;
}
interface UpdatePaymentMethodRequest {
    name?: string;
    is_default?: boolean;
    billing_address?: Address;
    metadata?: Metadata;
}
interface CustomerListParams extends PaginationParams {
    status?: 'active' | 'inactive';
    email?: string;
}
interface MrrBreakdownItem {
    subscription_id: string;
    product_name: string;
    monthly_amount: number;
    billing_interval: 'month' | 'year' | 'week' | 'day';
    normalized_monthly?: number;
    next_billing: string;
}
interface CustomerMrrResponse {
    customer_id: string;
    total_mrr: number;
    currency: string;
    breakdown: MrrBreakdownItem[];
    projected_annual_revenue: number;
}

interface Product extends BaseEntity {
    name: string;
    description?: string;
    status: 'active' | 'inactive';
    type: 'product' | 'service';
    metadata?: Metadata;
    variants?: Variant[];
}
interface CreateProductRequest {
    name: string;
    description?: string;
    type: 'product' | 'service';
    metadata?: Metadata;
}
interface UpdateProductRequest {
    name?: string;
    description?: string;
    status?: 'active' | 'inactive';
    metadata?: Metadata;
}
interface Variant extends BaseEntity {
    product_id: string;
    name: string;
    description?: string;
    sku?: string;
    status: 'active' | 'inactive';
    metadata?: Metadata;
    prices?: Price[];
}
interface CreateVariantRequest {
    name: string;
    description?: string;
    sku?: string;
    metadata?: Metadata;
}
interface UpdateVariantRequest {
    name?: string;
    description?: string;
    sku?: string;
    status?: 'active' | 'inactive';
    metadata?: Metadata;
}
interface Price extends BaseEntity {
    variant_id: string;
    label?: string;
    category: 'one_time' | 'subscription' | 'usage' | 'hybrid' | 'free' | 'variable';
    scheme: 'fixed' | 'tiered' | 'volume' | 'graduated';
    cycles?: number;
    currency: string;
    unit_price?: number;
    min_price?: number;
    suggested_price?: number;
    billing_interval: 'none' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
    billing_interval_qty?: number;
    trial_interval: 'none' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
    trial_interval_qty?: number;
    has_usage?: boolean;
    usage_type?: 'metered' | 'licensed';
    unit_type?: string;
    aggregation_type?: 'sum' | 'max' | 'average' | 'last_during_period';
    percentage_rate?: number;
    tiers?: PricingTier[];
    tax_code?: string;
    metadata?: Metadata;
}
interface PricingTier {
    up_to: number;
    unit_price: number;
    flat_fee?: number;
}
interface RecurringConfig {
    interval: 'none' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
    interval_count: number;
    trial_period_days?: number;
}
interface UsageConfig {
    unit: string;
    aggregation_type: 'sum' | 'max' | 'average' | 'last_during_period';
    unit_amount?: number;
    tiers?: PricingTier[];
    package_size?: number;
}
interface CreatePriceRequest {
    variant_id: string;
    label?: string;
    category: 'one_time' | 'subscription' | 'usage' | 'hybrid' | 'free' | 'variable';
    scheme: 'fixed' | 'tiered' | 'volume' | 'graduated';
    cycles?: number;
    currency: string;
    unit_price?: number;
    min_price?: number;
    suggested_price?: number;
    billing_interval: 'none' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
    billing_interval_qty?: number;
    trial_interval: 'none' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
    trial_interval_qty?: number;
    has_usage?: boolean;
    usage_type?: 'metered' | 'licensed';
    unit_type?: string;
    aggregation_type?: 'sum' | 'max' | 'average' | 'last_during_period';
    percentage_rate?: number;
    tiers?: PricingTier[];
    tax_code?: string;
    metadata?: Metadata;
}
interface UpdatePriceRequest {
    label?: string;
    metadata?: Metadata;
}

type SubscriptionStatus = 'trial' | 'active' | 'past_due' | 'non_renewing' | 'paused' | 'unpaid' | 'cancelled' | 'pending' | 'expired' | 'completed' | 'error';
interface Subscription extends BaseEntity {
    customer_id: string;
    status: SubscriptionStatus;
    currency: Currency;
    current_period_start: DateTime;
    current_period_end: DateTime;
    trial_start?: DateTime;
    trial_end?: DateTime;
    cancelled_at?: DateTime;
    cancel_at_period_end: boolean;
    billing_cycle_anchor?: DateTime;
    items: SubscriptionItem[];
    default_payment_method_id?: string;
    metadata?: Metadata;
}
interface SubscriptionItem extends BaseEntity {
    subscription_id: string;
    price_id: string;
    quantity: number;
    description?: string;
    metadata?: Metadata;
}
interface CreateSubscriptionRequest {
    customer_id: string;
    payment_method_id?: string;
    currency: string;
    items: CreateSubscriptionItemRequest[];
    metadata?: Metadata;
}
interface CreateSubscriptionItemRequest {
    price_id: string;
    name: string;
    description?: string;
    quantity?: number;
    metadata?: Metadata;
}
interface UpdateSubscriptionRequest {
    default_payment_method_id?: string;
    metadata?: Metadata;
    cancel_at_period_end?: boolean;
}
interface PauseSubscriptionRequest {
    reason: string;
    pause_mode: 'temporary' | 'indefinite';
    resume_at?: DateTime;
}
interface ResumeSubscriptionRequest {
    reason?: string;
    resume_behavior?: 'continue_existing_period' | 'start_new_period';
    proration_mode?: 'none' | 'credit_unused';
}
interface CancelSubscriptionRequest {
    reason?: string;
    cancel_at?: 'immediate' | 'period_end';
}
interface ActivateSubscriptionRequest {
    trial_end?: DateTime;
    billing_cycle_anchor?: DateTime;
}
interface ChangePlanRequest {
    new_variant_id: string;
    new_price_id: string;
    proration_mode?: 'none' | 'immediate' | 'credit_unused';
    effective_date?: 'immediate' | 'next_billing_cycle';
    reason?: string;
}
interface UpdateBillingAnchorRequest {
    billing_anchor: number;
    proration_mode?: 'none' | 'credit_unused';
}
interface PlanChange {
    id: string;
    subscription_id: string;
    from_items: SubscriptionItem[];
    to_items: SubscriptionItem[];
    effective_date: DateTime;
    proration_amount?: number;
}
interface ProrationDetails {
    amount: number;
    currency: Currency;
    period_start: DateTime;
    period_end: DateTime;
    description: string;
}
interface SubscriptionListParams extends PaginationParams {
    status?: SubscriptionStatus;
    customer_id?: string;
}

interface UsageRecord extends BaseEntity {
    subscription_item_id: string;
    quantity: number;
    timestamp: DateTime;
    action?: 'increment' | 'set';
    idempotency_key?: string;
    metadata?: Record<string, any>;
}
interface RecordUsageRequest {
    subscription_item_id: string;
    quantity: number;
    timestamp?: DateTime;
    action?: 'increment' | 'set';
    idempotency_key?: string;
    metadata?: Record<string, any>;
}
interface BatchRecordUsageRequest {
    records: RecordUsageRequest[];
}
interface UsageEvent {
    customer_id: string;
    subscription_item_id: string;
    event_type: string;
    quantity: number;
    timestamp?: DateTime;
    idempotency_key?: string;
}
interface UsageSummary {
    subscription_id: string;
    subscription_item_id: string;
    billing_period: string;
    usage_type: 'metered' | 'licensed';
    unit_type: string;
    aggregation_type: 'sum' | 'max' | 'average' | 'last_during_period';
    total_quantity: number;
    total_amount: number;
    details?: Record<string, any>;
}
interface UsageEstimate {
    subscription_id: string;
    estimated_amount: number;
    current_usage: Record<string, any>;
    billing_period: string;
}
interface UsageEventResponse {
    id: string;
    subscription_item_id: string;
    quantity: number;
    timestamp: DateTime;
    processed: boolean;
}
interface UsageEstimateResponse {
    subscription_id: string;
    period_start: DateTime;
    period_end: DateTime;
    estimated_total: number;
    line_items: UsageEstimateLineItem[];
}
interface UsageEstimateLineItem {
    subscription_item_id: string;
    description: string;
    quantity: number;
    unit_amount: number;
    amount: number;
}
interface UsageResponse {
    id: string;
    status: 'accepted' | 'rejected';
    errors?: string[];
}
interface CloudEventUsageRequest {
    specversion: string;
    type: string;
    id: string;
    time: DateTime;
    source: string;
    subject: string;
    data: Record<string, any>;
}
interface CloudEventUsageResponse {
    id: string;
    org_id: string;
    subscription_id: string;
    subscription_item_id: string;
    meter_id?: string;
    spec_version: string;
    type: string;
    event_id: string;
    time: DateTime;
    source: string;
    subject: string;
    data: Record<string, any>;
    received_at: DateTime;
}

interface Meter extends BaseEntity {
    org_id: string;
    slug: string;
    name: string;
    description?: string;
    event_name: string;
    aggregation_type: 'sum' | 'max' | 'average' | 'last_during_period';
    value_property: string;
    unit_type?: string;
    is_active: boolean;
}
interface CreateMeterRequest {
    slug: string;
    name: string;
    description?: string;
    event_name: string;
    aggregation_type: 'sum' | 'max' | 'average' | 'last_during_period';
    value_property: string;
    unit_type?: string;
}
interface UpdateMeterRequest {
    name?: string;
    description?: string;
    event_name?: string;
    aggregation_type?: 'sum' | 'max' | 'average' | 'last_during_period';
    value_property?: string;
    unit_type?: string;
    is_active?: boolean;
}

type PaymentStatus = 'pending' | 'failed' | 'succeeded' | 'refunded' | 'partial_refund' | 'cancelled' | 'expired' | 'fraudulent';
interface Payment extends BaseEntity {
    psp: string;
    psp_id: string;
    reference?: string;
    recurring: boolean;
    order_id?: string;
    invoice_id?: string;
    subscription_id?: string;
    customer_id: string;
    amount: number;
    currency: Currency;
    status: PaymentStatus;
    psp_fee?: number;
    platform_fee?: number;
    net_amount?: number;
    refunded_amount?: number;
    metadata?: Metadata;
    completed_at?: DateTime;
}
interface Refund extends BaseEntity {
    psp_refund_id?: string;
    payment_id: string;
    amount: number;
    currency: Currency;
    reason?: string;
    status: 'pending' | 'completed' | 'error';
    refunded_at?: DateTime;
    completed_at?: DateTime;
}
interface RefundPaymentRequest {
    reason?: string;
    amount?: number;
}
interface PaymentListParams extends PaginationParams {
    status?: PaymentStatus;
    customer_id?: string;
}
interface PaymentMethod extends BaseEntity {
    status: 'active' | 'expired';
    psp: string;
    name: string;
    customer_id: string;
    billing_address?: any;
    details?: any;
    type: 'card' | 'bank_account';
    token: string;
    is_default: boolean;
    metadata?: Metadata;
    expire_at?: DateTime;
}

type InvoiceStatus = 'draft' | 'sent' | 'paid' | 'overdue' | 'cancelled' | 'refunded';
type InvoiceType = 'invoice' | 'proforma' | 'quote' | 'receipt' | 'statement';
type InvoiceCategory = 'initial' | 'recurring' | 'usage' | 'adjustment' | 'setup' | 'cancellation' | 'refund';
interface Invoice extends BaseEntity {
    customer_id: string;
    order_id?: string;
    subscription_id?: string;
    sequence_id?: string;
    doc_number?: string;
    type: InvoiceType;
    invoice_type: InvoiceCategory;
    status: InvoiceStatus;
    is_immutable: boolean;
    currency: Currency;
    sub_total: number;
    tax_total: number;
    discount_total: number;
    total: number;
    amount_paid: number;
    amount_due: number;
    tax_provider?: string;
    tax_transaction_id?: string;
    tax_breakdown?: any;
    issued_at?: DateTime;
    due_at?: DateTime;
    schedule_at?: DateTime;
    finalize_at?: DateTime;
    paid_at?: DateTime;
    notes?: string;
    customer_notes?: string;
    metadata?: Metadata;
    exchange_rate?: number;
    base_currency?: Currency;
    customer?: any;
    line_items?: InvoiceLineItem[];
    payments?: any[];
}
interface InvoiceLineItem extends BaseEntity {
    invoice_id: string;
    product_id?: string;
    variant_id?: string;
    price_id?: string;
    description: string;
    category?: string;
    quantity: number;
    unit_price: number;
    line_total: number;
    discount_type?: 'percentage' | 'fixed';
    discount_value?: number;
    discount_total?: number;
    tax_code?: string;
    tax_rate?: number;
    tax_amount?: number;
    tax_exempt?: boolean;
    seq?: number;
    metadata?: Metadata;
}
interface CreateInvoiceRequest {
    customer_id: string;
    order_id?: string;
    subscription_id?: string;
    type: InvoiceType;
    invoice_type: InvoiceCategory;
    currency: Currency;
    due_at?: DateTime;
    notes?: string;
    customer_notes?: string;
    metadata?: Metadata;
    line_items?: CreateInvoiceLineItemRequest[];
}
interface CreateInvoiceLineItemRequest {
    product_id?: string;
    variant_id?: string;
    price_id?: string;
    description: string;
    category?: string;
    quantity: number;
    unit_price: number;
    discount_type?: 'percentage' | 'fixed';
    discount_value?: number;
    tax_code?: string;
    tax_rate?: number;
    tax_exempt?: boolean;
    metadata?: Metadata;
}
interface UpdateInvoiceRequest {
    customer_notes?: string;
    notes?: string;
    due_at?: DateTime;
    metadata?: Metadata;
}
interface UpdateInvoiceLineItemRequest {
    description?: string;
    category?: string;
    quantity?: number;
    unit_price?: number;
    discount_type?: 'percentage' | 'fixed';
    discount_value?: number;
    tax_code?: string;
    tax_rate?: number;
    tax_exempt?: boolean;
    metadata?: Metadata;
}
interface InvoiceHistory {
    id: string;
    invoice_id: string;
    action: 'created' | 'updated' | 'finalized' | 'sent' | 'paid' | 'voided';
    field?: string;
    old_value?: any;
    new_value?: any;
    user_email?: string;
    reason?: string;
    timestamp: DateTime;
}
interface InvoiceListParams extends PaginationParams {
    status?: InvoiceStatus;
    customer_id?: string;
}
interface CreateInvoicePaymentLinkRequest {
    expires_at?: DateTime;
    success_url?: string;
    cancel_url?: string;
    config?: Record<string, any>;
}
interface InitiateInvoicePaymentRequest {
    payment_processor: 'paystack' | 'checkout_com';
    billing_address?: {
        first_name?: string;
        last_name?: string;
        email?: string;
        phone?: string;
        line1?: string;
        line2?: string;
        city?: string;
        state?: string;
        postal_code?: string;
        country?: string;
    };
    success_url?: string;
    cancel_url?: string;
    metadata?: Record<string, string>;
}
interface InitiatePaymentResponse {
    order_id: string;
    payment_processor: 'paystack' | 'checkout_com';
    redirect_url?: string;
    client_secret?: string;
    session_id?: string;
    amount: number;
    currency: string;
    status: 'pending';
    reference: string;
}

type OrderStatus = 'pending' | 'failed' | 'refunded' | 'partial_refund' | 'completed' | 'expired' | 'cancelled' | 'fraudulent';
interface Order extends BaseEntity {
    customer_id: string;
    status: OrderStatus;
    reference?: string;
    session_id?: string;
    currency: Currency;
    sub_total: number;
    tax_total: number;
    discount_total: number;
    total: number;
    items?: OrderItem[];
    customer?: any;
    metadata?: Metadata;
}
interface OrderItem extends BaseEntity {
    order_id: string;
    product_id: string;
    variant_id: string;
    price_id: string;
    description?: string;
    quantity: number;
    unit_price: number;
    sub_total: number;
    total: number;
    tax_total: number;
    discount_total: number;
    metadata?: Metadata;
}
interface CreateOrderRequest {
    customer: {
        id: string;
    } | any;
    payment_method_id?: string;
    session_id?: string;
    psp_id: string;
    cart?: {
        currency?: Currency;
        items: Array<{
            product_id: string;
            price_id: string;
            quantity: number;
        }>;
    };
    metadata?: Metadata;
}
interface CompleteOrderRequest {
    payment_method_id?: string;
    payment_method?: {
        token: string;
        type: 'card' | 'bank_account';
    };
    payment?: {
        amount: number;
        currency: Currency;
    };
    metadata?: Metadata;
}
interface AddCartItemRequest {
    product_id: string;
    price_id: string;
    quantity: number;
}
interface RemoveCartItemRequest {
    product_id: string;
}
interface ValidateCouponRequest {
    coupon_code: string;
}
interface Cart {
    id: string;
    customer_id?: string;
    items: CartItem[];
    discounts?: CartDiscount[];
    subtotal_amount: number;
    discount_amount: number;
    total_amount: number;
    currency: string;
    created_at: string;
    updated_at: string;
}
interface CartItem {
    product_id: string;
    price_id: string;
    quantity: number;
    unit_amount: number;
    total_amount: number;
    product?: Product;
    price?: Price;
}
interface CartDiscount {
    discount_id: string;
    amount: number;
    type: 'fixed' | 'percentage';
}
interface CartResponse extends Cart {
}
interface OrderListParams extends PaginationParams {
    status?: OrderStatus;
    customer_id?: string;
}

interface Gateway extends BaseEntity {
    org_id: string;
    psp_id: string;
    name: string;
    settings: Record<string, any>;
    is_active: boolean;
}
interface PspConfiguration extends BaseEntity {
    name: string;
    provider: 'paystack' | 'checkout_com' | 'stripe';
    configuration: any;
    is_active: boolean;
}
interface CreateGatewayRequest {
    psp_id: string;
    name: string;
    settings: Record<string, any>;
    is_active?: boolean;
}
interface CreatePspConfigurationRequest {
    name: string;
    provider: 'paystack' | 'checkout_com' | 'stripe';
    configuration: any;
    is_active?: boolean;
}
interface UpdateGatewayRequest {
    name?: string;
    settings?: Record<string, any>;
    is_active?: boolean;
}

interface Setting extends BaseEntity {
    parent_id: string;
    key: string;
    value: string;
    description?: string;
}
interface CreateSettingRequest {
    key: string;
    value: string;
    description?: string;
}
interface UpdateSettingRequest {
    value?: string;
    description?: string;
}

interface Organization extends BaseEntity {
    name: string;
    country: string;
    timezone: string;
    metadata?: Metadata;
}
interface CreateOrganizationRequest {
    name: string;
    country: string;
    timezone: string;
    metadata?: Metadata;
}
interface ApiKey {
    id: string;
    name: string;
    prefix: string;
    scopes: string[];
    expires_at?: string;
    created_at: string;
    last_used_at?: string;
}

type DunningCampaignStatus = 'active' | 'paused' | 'completed';
interface DunningCampaign extends BaseEntity {
    subscription_id: string;
    status: DunningCampaignStatus;
    configuration_id: string;
    current_attempt: number;
    max_attempts: number;
    last_attempt_at?: DateTime;
    next_attempt_at?: DateTime;
    success_at?: DateTime;
    failure_at?: DateTime;
    metadata?: Metadata;
}
interface DunningAttempt extends BaseEntity {
    campaign_id: string;
    attempt_number: number;
    status: 'pending' | 'succeeded' | 'failed';
    attempted_at: DateTime;
    payment_id?: string;
    failure_reason?: string;
    metadata?: Metadata;
}
interface DunningCommunication extends BaseEntity {
    campaign_id: string;
    attempt_id: string;
    type: 'email' | 'sms' | 'in_app';
    template_id: string;
    sent_at: DateTime;
    delivered_at?: DateTime;
    opened_at?: DateTime;
    clicked_at?: DateTime;
    metadata?: Metadata;
}
interface DunningConfiguration extends BaseEntity {
    name: string;
    max_attempts: number;
    retry_schedule: Array<{
        delay_days: number;
        communication_template: string;
    }>;
    grace_period_days: number;
    is_active: boolean;
    metadata?: Metadata;
}
interface PaymentToken extends BaseEntity {
    subscription_id: string;
    token: string;
    expires_at: DateTime;
    is_used: boolean;
    used_at?: DateTime;
    metadata?: Metadata;
}
interface PaymentTokenVerification {
    token: string;
    subscription_id: string;
    is_valid: boolean;
    expires_at: DateTime;
    customer_id: string;
    amount_due: number;
    currency: string;
}
interface UpdateDunningCampaignRequest {
    status?: DunningCampaignStatus;
    metadata?: Metadata;
}
interface CreateDunningConfigurationRequest {
    name: string;
    max_attempts: number;
    retry_schedule: Array<{
        delay_days: number;
        communication_template: string;
    }>;
    grace_period_days?: number;
    metadata?: Metadata;
}
interface UpdateDunningConfigurationRequest {
    name?: string;
    max_attempts?: number;
    retry_schedule?: Array<{
        delay_days: number;
        communication_template: string;
    }>;
    grace_period_days?: number;
    metadata?: Metadata;
}
interface VerifyPaymentTokenRequest {
    token: string;
}
interface ActivatePaymentTokenRequest {
    token: string;
    payment_method_token: string;
}
interface DunningCampaignListParams extends PaginationParams {
    status?: DunningCampaignStatus;
    subscription_id?: string;
}

type WebhookEvent = 'subscription.created' | 'subscription.updated' | 'subscription.cancelled' | 'invoice.created' | 'invoice.finalized' | 'invoice.payment_succeeded' | 'invoice.payment_failed' | 'payment.succeeded' | 'payment.failed' | 'customer.created' | 'customer.updated' | 'usage.recorded';
interface WebhookSubscription extends BaseEntity {
    url: string;
    events: WebhookEvent[];
    secret: string;
    is_active: boolean;
    metadata?: any;
}
interface CreateWebhookRequest {
    url: string;
    events: WebhookEvent[];
    secret?: string;
}

interface RevenueReport {
    currency: string;
    amount: number;
    period: string;
    breakdown?: Array<{
        date: string;
        amount: number;
        change_percent?: number;
    }>;
    metadata?: any;
}
interface SubscriberReport {
    total_count: number;
    active_count: number;
    trial_count: number;
    past_due_count: number;
    cancelled_count: number;
    date: string;
    change_percent?: number;
    breakdown?: Array<{
        status: string;
        count: number;
        percent: number;
    }>;
}
interface RefundReport {
    currency: string;
    total_amount: number;
    refund_count: number;
    period: string;
    average_refund_amount: number;
    breakdown?: Array<{
        date: string;
        amount: number;
        count: number;
    }>;
}
interface ChurnReport {
    period: string;
    churn_rate: number;
    churned_customers: number;
    total_customers: number;
    churned_mrr?: number;
    total_mrr?: number;
    breakdown?: Array<{
        date: string;
        churn_rate: number;
        churned_customers: number;
        reason?: string;
    }>;
}

interface Session extends BaseEntity {
    type: 'checkout' | 'customer_portal';
    customer_id?: string;
    return_url?: string;
    session_url: string;
    expires_at: string;
    metadata?: Metadata;
}
interface CreateSessionRequest {
    type: 'checkout' | 'customer_portal';
    customer_id?: string;
    return_url?: string;
    metadata?: Metadata;
}

interface Discount extends BaseEntity {
    id: string;
    org_id: string;
    name: string;
    type: 'fixed' | 'percentage';
    value: number;
    code?: string;
    starts_at?: string;
    ends_at?: string;
    max_redemptions?: number;
    recurring: 'once' | 'forever' | 'cycles';
    cycles?: number;
    currency?: string;
    active: boolean;
    created_at: string;
    updated_at: string;
    metadata?: Record<string, any>;
}
interface DiscountRedemption extends BaseEntity {
    id: string;
    org_id: string;
    discount_id: string;
    customer_id: string;
    resource_type: 'subscription' | 'invoice' | 'payment' | 'checkout_session';
    resource_id: string;
    discount_amount: number;
    currency: string;
    created_at: string;
    metadata?: Record<string, any>;
}
interface CreateDiscountRequest {
    name: string;
    type: 'fixed' | 'percentage';
    value: number;
    code?: string;
    starts_at?: string;
    ends_at?: string;
    max_redemptions?: number;
    recurring: 'once' | 'forever' | 'cycles';
    cycles?: number;
    currency?: string;
    active?: boolean;
    metadata?: Record<string, any>;
}
interface UpdateDiscountRequest {
    name?: string;
    code?: string;
    starts_at?: string;
    ends_at?: string;
    max_redemptions?: number;
    active?: boolean;
    metadata?: Record<string, any>;
}
interface ValidateDiscountRequest {
    code: string;
    customer_id?: string;
    amount?: number;
    currency?: string;
}
interface DiscountValidationResponse {
    valid: boolean;
    discount?: Discount;
    discount_amount?: number;
    final_amount?: number;
    error?: string;
}
interface ApplyDiscountRequest {
    discount_id?: string;
    code?: string;
    customer_id: string;
    resource_type: 'subscription' | 'invoice' | 'payment' | 'checkout_session';
    resource_id: string;
    amount: number;
    currency: string;
}
interface DiscountApplicationResponse {
    discount: Discount;
    redemption: DiscountRedemption;
    discount_amount: number;
    final_amount: number;
}
interface ListDiscountsParams {
    page?: number;
    limit?: number;
    active?: boolean;
    type?: 'fixed' | 'percentage';
    recurring?: 'once' | 'forever' | 'cycles';
}
interface ListDiscountRedemptionsParams {
    page?: number;
    limit?: number;
    customer_id?: string;
    resource_type?: 'subscription' | 'invoice' | 'payment' | 'checkout_session';
}

interface PaymentLink extends BaseEntity {
    id: string;
    slug: string;
    data?: Record<string, any>;
    config: Record<string, any>;
    single_use: boolean;
    status: 'active' | 'inactive' | 'expired' | 'used';
    created_at: string;
    updated_at: string;
    used_at?: string;
    expires_at?: string;
}
interface PaymentLinkUsage extends BaseEntity {
    id: string;
    payment_link_id: string;
    session_id?: string;
    customer_id?: string;
    event_type: string;
    ip_address?: string;
    user_agent?: string;
    referer?: string;
    country?: string;
    metadata?: Record<string, any>;
    timestamp: string;
}
interface CreatePaymentLinkRequest {
    slug: string;
    data?: Record<string, any>;
    config: Record<string, any>;
    single_use?: boolean;
    expires_at?: string;
}
interface UpdatePaymentLinkRequest {
    slug?: string;
    data?: Record<string, any>;
    config?: Record<string, any>;
    single_use?: boolean;
    status?: 'active' | 'inactive' | 'expired' | 'used';
    expires_at?: string;
}
interface RecordPaymentLinkUsageRequest {
    payment_link_id: string;
    session_id?: string;
    customer_id?: string;
    event_type: string;
    ip_address?: string;
    user_agent?: string;
    referer?: string;
    country?: string;
    metadata?: Record<string, any>;
}
interface ListPaymentLinksParams {
    page?: number;
    limit?: number;
    status?: 'active' | 'inactive' | 'expired' | 'used';
    slug?: string;
}
interface ListPaymentLinkUsagesParams {
    page?: number;
    limit?: number;
    event_type?: string;
    start_date?: string;
    end_date?: string;
}
interface PaymentLinkResponse extends PaymentLink {
}
interface PaymentLinkUsageResponse extends PaymentLinkUsage {
}

interface PublicPaymentDetailsResponse {
    type: 'invoice' | 'checkout';
    invoice?: PublicInvoiceResponse;
    checkout_items?: Record<string, any>;
    payment_config: Record<string, any>;
    org_id: string;
}
interface PublicInvoiceResponse {
    id: string;
    doc_number: string;
    total: number;
    amount_due: string;
    currency: string;
    due_at?: string | null;
    line_items: PublicInvoiceLineItem[];
    customer?: PublicCustomerResponse;
}
interface PublicInvoiceLineItem {
    description: string;
    quantity: string;
    unit_price: number;
    line_total: number;
}
interface PublicCustomerResponse {
    email: string;
    first_name?: string;
    last_name?: string;
    billing_address?: Address;
}
interface PublicCreateOrderRequest {
    payment_processor: string;
    customer_email?: string;
    customer_name?: string;
    billing_address?: Address;
    success_url?: string;
    cancel_url?: string;
    metadata?: Record<string, string>;
}
interface CreateOrderResponse {
    order: Order;
    psp: Record<string, any>;
}
interface PublicOrderResponse {
    order_id: string;
    payment_processor: string;
    redirect_url?: string;
    client_secret?: string;
    session_id?: string;
    reference: string;
    amount: number;
    currency: string;
    status: string;
}
interface PublicOrderStatusResponse {
    order_id: string;
    status: string;
    payment_status?: string;
    amount: number;
    currency: string;
}

export { type ActivatePaymentTokenRequest, type ActivateSubscriptionRequest, type AddCartItemRequest, Address, type ApiKey, type ApplyDiscountRequest, BaseEntity, type BatchRecordUsageRequest, type CancelSubscriptionRequest, type Cart, type CartDiscount, type CartItem, type CartResponse, type ChangePlanRequest, type ChurnReport, type CloudEventUsageRequest, type CloudEventUsageResponse, type CompleteOrderRequest, type CreateCustomerRequest, type CreateDiscountRequest, type CreateDunningConfigurationRequest, type CreateGatewayRequest, type CreateInvoiceLineItemRequest, type CreateInvoicePaymentLinkRequest, type CreateInvoiceRequest, type CreateMeterRequest, type CreateOrderRequest, type CreateOrderResponse, type CreateOrganizationRequest, type CreatePaymentLinkRequest, type CreatePaymentMethodRequest, type CreatePriceRequest, type CreateProductRequest, type CreatePspConfigurationRequest, type CreateSessionRequest, type CreateSettingRequest, type CreateSubscriptionItemRequest, type CreateSubscriptionRequest, type CreateVariantRequest, type CreateWebhookRequest, Currency, type Customer, type CustomerListParams, type CustomerMrrResponse, DateTime, type Discount, type DiscountApplicationResponse, type DiscountRedemption, type DiscountValidationResponse, type DunningAttempt, type DunningCampaign, type DunningCampaignListParams, type DunningCampaignStatus, type DunningCommunication, type DunningConfiguration, type Gateway, type InitiateInvoicePaymentRequest, type InitiatePaymentResponse, type Invoice, type InvoiceCategory, type InvoiceHistory, type InvoiceLineItem, type InvoiceListParams, type InvoiceStatus, type InvoiceType, type ListDiscountRedemptionsParams, type ListDiscountsParams, type ListPaymentLinkUsagesParams, type ListPaymentLinksParams, Metadata, type Meter, type MrrBreakdownItem, type Order, type OrderItem, type OrderListParams, type OrderStatus, type Organization, PaginationParams, type PauseSubscriptionRequest, type Payment, type PaymentLink, type PaymentLinkResponse, type PaymentLinkUsage, type PaymentLinkUsageResponse, type PaymentListParams, type PaymentMethod, type PaymentStatus, type PaymentToken, type PaymentTokenVerification, type PlanChange, type Price, type PricingTier, type Product, type ProrationDetails, type PspConfiguration, type PublicCreateOrderRequest, type PublicCustomerResponse, type PublicInvoiceLineItem, type PublicInvoiceResponse, type PublicOrderResponse, type PublicOrderStatusResponse, type PublicPaymentDetailsResponse, type RecordPaymentLinkUsageRequest, type RecordUsageRequest, type RecurringConfig, type Refund, type RefundPaymentRequest, type RefundReport, type RemoveCartItemRequest, type ResumeSubscriptionRequest, type RevenueReport, type Session, type Setting, type SubscriberReport, type Subscription, type SubscriptionItem, type SubscriptionListParams, type SubscriptionStatus, type UpdateBillingAnchorRequest, type UpdateCustomerRequest, type UpdateDiscountRequest, type UpdateDunningCampaignRequest, type UpdateDunningConfigurationRequest, type UpdateGatewayRequest, type UpdateInvoiceLineItemRequest, type UpdateInvoiceRequest, type UpdateMeterRequest, type UpdatePaymentLinkRequest, type UpdatePaymentMethodRequest, type UpdatePriceRequest, type UpdateProductRequest, type UpdateSettingRequest, type UpdateSubscriptionRequest, type UpdateVariantRequest, type UsageConfig, type UsageEstimate, type UsageEstimateLineItem, type UsageEstimateResponse, type UsageEvent, type UsageEventResponse, type UsageRecord, type UsageResponse, type UsageSummary, type ValidateCouponRequest, type ValidateDiscountRequest, type Variant, type VerifyPaymentTokenRequest, type WebhookEvent, type WebhookSubscription };
