/** * Billing — subscription + plan catalogue. * * GET /billing/subscription/me?projectId= — caller's active plan (or null) * GET /billing/plans?projectId= — catalogue available to this project * POST /billing/subscription/update — switch plan / interval * * Plan switches are synchronous on the Stripe side — the API returns once * Stripe has accepted the update, so callers see the new tier immediately. */ import type { Client } from './client.js'; export interface OrgScopedRequestOptions { readonly orgId?: string; } export interface CurrentPlan { readonly id: string; readonly planSlug: string; readonly status: string; readonly interval: string | null; readonly currentPeriodStart: string | null; readonly currentPeriodEnd: string | null; readonly cancelAtPeriodEnd?: boolean; } export declare const getCurrentPlan: (client: Client, projectId: string, options?: OrgScopedRequestOptions) => Promise; export interface PlanListing { readonly id: string; readonly slug: string; readonly name: string; readonly description: string | null; readonly features: unknown; readonly priceMonthly: number | null; readonly priceAnnual: number | null; readonly priceLifetime: number | null; } export declare const listPlans: (client: Client, projectId: string, options?: OrgScopedRequestOptions) => Promise<{ plans: readonly PlanListing[]; }>; export type PlanInterval = 'monthly' | 'annual' | 'lifetime'; export interface UpgradeResult { readonly success: boolean; readonly subscription?: { readonly id: string; readonly planSlug: string; readonly interval: string; readonly currentPeriodEnd: string; }; } export declare const upgrade: (client: Client, projectId: string, userId: string, newPlanSlug: string, newInterval?: PlanInterval, options?: OrgScopedRequestOptions) => Promise; export interface UsageMetric { readonly used: number; readonly unit: string; readonly costFormatted?: string; } export interface UsageServiceCost { readonly cost?: number; readonly costFormatted?: string; } export interface UsageSummary { readonly projectId: string; readonly month: string; readonly metrics?: Readonly>; readonly services?: Readonly>; } export declare const usageSummary: (client: Client, projectId: string, options?: { month?: string; }, requestOptions?: OrgScopedRequestOptions) => Promise; export interface Balance { readonly balanceFormatted?: string; readonly balanceMicrodollars?: number; readonly status?: string; readonly nextInvoiceAt?: string | null; readonly nextInvoicePreview?: { readonly totalFormatted?: string; } | null; } export declare const balance: (client: Client, projectId: string, options?: OrgScopedRequestOptions) => Promise; export interface CreditPackage { readonly id: string; readonly label: string; readonly amountFormatted: string; readonly bonusFormatted?: string; } export declare const creditPackages: (client: Client) => Promise<{ packages: readonly CreditPackage[]; }>; export interface Invoice { readonly id: string; readonly invoiceNumber: string; readonly billingMonth: string; readonly status: string; readonly totalFormatted: string; readonly dueAt: string | null; readonly paidAt: string | null; readonly createdAt: string; } export declare const listInvoices: (client: Client, projectId: string, options?: { limit?: number; }, requestOptions?: OrgScopedRequestOptions) => Promise<{ invoices: readonly Invoice[]; }>; /** * Fetch structured invoice detail. Returns the raw server document — * today JSON, tomorrow potentially a PDF link field when the render * pipeline lands. Callers that persist this to disk should remain * type-agnostic (`unknown`) rather than latching onto the current shape. */ export declare const invoiceDetail: (client: Client, projectId: string, invoiceId: string, options?: OrgScopedRequestOptions) => Promise; //# sourceMappingURL=billing.d.ts.map