import Stripe from "stripe"; import { StripeService } from "../../stripe/services/stripe.service"; /** * Stripe Invoice API Service * * Manages Stripe invoices including retrieval, listing, and payment operations. * Provides access to upcoming invoices for subscription previews. * * @example * ```typescript * const invoice = await stripeInvoiceApiService.retrieveInvoice('in_abc123'); * * const invoices = await stripeInvoiceApiService.listInvoices({ * stripeCustomerId: 'cus_abc123', * status: 'paid', * }); * ``` */ export declare class StripeInvoiceApiService { private readonly stripeService; constructor(stripeService: StripeService); /** * Retrieve an invoice by ID * * @param invoiceId - The Stripe invoice ID * @returns Promise resolving to the invoice * @throws {StripeError} If retrieval fails * * @example * ```typescript * const invoice = await service.retrieveInvoice('in_abc123'); * ``` */ retrieveInvoice(invoiceId: string): Promise; /** * List invoices for a customer * * @param params - Listing parameters * @param params.stripeCustomerId - Stripe customer ID * @param params.status - Filter by invoice status (optional) * @param params.limit - Maximum number of invoices to return (optional, default: 100) * @returns Promise resolving to array of invoices * @throws {StripeError} If listing fails * * @example * ```typescript * // List all invoices * const invoices = await service.listInvoices({ * stripeCustomerId: 'cus_abc123', * }); * * // List only paid invoices * const paidInvoices = await service.listInvoices({ * stripeCustomerId: 'cus_abc123', * status: 'paid', * }); * ``` */ listInvoices(params: { stripeCustomerId: string; status?: Stripe.InvoiceListParams.Status; limit?: number; }): Promise; /** * Get an invoice with expanded line items * * @param invoiceId - The Stripe invoice ID * @returns Promise resolving to the invoice with expanded lines * @throws {StripeError} If retrieval fails * * @example * ```typescript * const invoice = await service.getInvoice('in_abc123'); * console.info(invoice.lines.data); * ``` */ getInvoice(invoiceId: string): Promise; /** * Get the upcoming invoice for a customer or subscription * * @param params - Preview parameters * @param params.customerId - Stripe customer ID * @param params.subscriptionId - Stripe subscription ID (optional) * @returns Promise resolving to the upcoming invoice preview * @throws {StripeError} If preview fails * * @example * ```typescript * // Preview next invoice for customer * const upcoming = await service.getUpcomingInvoice({ * customerId: 'cus_abc123', * }); * * // Preview next invoice for specific subscription * const upcomingSub = await service.getUpcomingInvoice({ * customerId: 'cus_abc123', * subscriptionId: 'sub_xyz789', * }); * ``` */ getUpcomingInvoice(params: { customerId: string; subscriptionId?: string; }): Promise; /** * Pay an invoice * * @param invoiceId - The invoice ID to pay * @returns Promise resolving to the paid invoice * @throws {StripeError} If payment fails * * @example * ```typescript * const invoice = await service.payInvoice('in_abc123'); * ``` */ payInvoice(invoiceId: string): Promise; /** * Void an invoice * * @param invoiceId - The invoice ID to void * @returns Promise resolving to the voided invoice * @throws {StripeError} If voiding fails * * @example * ```typescript * const invoice = await service.voidInvoice('in_abc123'); * ``` * * @remarks * Only draft or open invoices can be voided. */ voidInvoice(invoiceId: string): Promise; } //# sourceMappingURL=stripe-invoice-api.service.d.ts.map