import type * as Whop from "../index.js"; /** * An invoice represents an itemized bill sent by a company to a customer for a specific product and plan, tracking the amount owed, due date, and payment status. */ export interface LegacyInvoice { /** The date and time when the invoice will be automatically finalized. For charge_automatically, triggers an automatic charge. For send_invoice, sends the invoice email at the specified time. */ automatically_finalizes_at: string | null; /** Whether the invoice includes a buyer processing fee on top of the plan price. */ charge_buyer_fee: boolean; /** The method used to collect payment for this invoice, such as automatic charging or manual payment. */ collection_method: Whop.InvoiceCollectionMethods; /** The company that issued this invoice. */ company: LegacyInvoice.Company; /** The datetime the invoice was created. */ created_at: string; /** The plan that this invoice charges for. */ current_plan: LegacyInvoice.CurrentPlan; /** The full name of the customer this invoice is addressed to. Null if no name is on file. */ customer_name: string | null; /** The deadline by which payment is expected. Null if the invoice is collected automatically. */ due_date: string | null; /** The email address of the customer this invoice is addressed to. Null if no email is on file. */ email_address: string | null; /** A signed token that allows fetching invoice data publicly without authentication. */ fetch_invoice_token: string; /** The unique identifier for the invoice. */ id: string; /** Optional line items that break down the invoice total into individual charges. */ line_items: LegacyInvoice.LineItems.Item[]; /** The billing/mailing address associated with this invoice, if one was provided at creation time. */ mailing_address: LegacyInvoice.MailingAddress | null; /** The member that the invoice was created for. Null when the invoice is addressed to an email address with no member record behind it. */ member: LegacyInvoice.Member | null; /** The sequential invoice number for display purposes. */ number: string; /** The checkout URL where the customer can pay this invoice online, with their email address pre-filled and locked. */ pay_online_url: string | null; /** The payment that settled this invoice. Null while the invoice is unpaid, when the invoice was marked paid manually, and on a subscription renewal invoice, where the settling payment cannot yet be identified. */ payment: LegacyInvoice.Payment | null; /** Whether a payment on this invoice is still clearing. True while a delayed payment method such as ACH or SEPA settles, during which the invoice stays open and is not marked past due. */ payment_processing: boolean; /** The product that this invoice was generated for. */ product: LegacyInvoice.Product; /** The current payment status of the invoice, such as draft, open, paid, or void. */ status: Whop.InvoiceStatuses; /** The date that defines when the subscription billing cycle starts. When set on a renewal plan invoice, all future billing periods anchor to this date. */ subscription_billing_anchor_at: string | null; /** The datetime the invoice was last updated. */ updated_at: string; /** The user this invoice is addressed to. Null if the user account has been removed. */ user: LegacyInvoice.User | null; } export declare namespace LegacyInvoice { /** * The company that issued this invoice. */ interface Company { /** The unique identifier for the company. */ id: string; /** The company's logo. */ logo: Company.Logo | null; /** The display name of the company shown to customers. */ title: string; } namespace Company { /** * The company's logo. */ interface Logo { /** A pre-optimized URL for rendering this attachment on the client. This should be used for displaying attachments in apps. */ url: string | null; } } /** * The plan that this invoice charges for. */ interface CurrentPlan { /** Number of days between recurring charges, such as 30 for monthly or 365 for annual. `null` for one-time plans. */ billing_period: number | null; /** The currency used for all prices on this plan (e.g., 'usd', 'eur'). All monetary amounts on the plan are denominated in this currency. */ currency: Whop.Currencies; /** A text description of the plan visible to customers. Maximum 1000 characters. Null if no description is set. */ description: string | null; /** The formatted price (including currency) for the plan. */ formatted_price: string; /** The unique identifier for the plan. */ id: string; /** The initial purchase price in the plan's base_currency (e.g., 49.99 for $49.99). For one-time plans, this is the full price. For renewal plans, this is charged on top of the first renewal_price. */ initial_price: number; /** The billing model for this plan: 'renewal' for recurring subscriptions or 'one_time' for single payments. */ plan_type: Whop.PlanTypes; /** The recurring price charged every billing_period in the plan's base_currency (e.g., 9.99 for $9.99/period). Zero for one-time plans. */ renewal_price: number; /** Free trial days before first renewal charge. `null` if no trial is configured or the user has already used a trial for this plan. */ trial_period_days: number | null; } type LineItems = LineItems.Item[]; namespace LineItems { /** * A line item on an invoice, representing a single charge with a label, quantity, and unit price. */ interface Item { /** The label or description for this line item. */ label: string; /** The display order of this line item within the invoice. */ position: number; /** The quantity of this line item. */ quantity: number; /** The computed total for this line item (quantity * unit_price). */ total: number; /** The unit price for this line item. Negative for a credit or deduction. */ unit_price: number; } } /** * The billing/mailing address associated with this invoice, if one was provided at creation time. */ interface MailingAddress { /** The city of the address. */ city: string | null; /** The country of the address. */ country: string | null; /** The line 1 of the address. */ line1: string | null; /** The line 2 of the address. */ line2: string | null; /** The name of the customer. */ name: string | null; /** The phone number of the customer. */ phone: string | null; /** The postal code of the address. */ postal_code: string | null; /** The state of the address. */ state: string | null; } /** * The member that the invoice was created for. Null when the invoice is addressed to an email address with no member record behind it. */ interface Member { /** The unique identifier for the company member. */ id: string; } /** * The payment that settled this invoice. Null while the invoice is unpaid, when the invoice was marked paid manually, and on a subscription renewal invoice, where the settling payment cannot yet be identified. */ interface Payment { /** The unique identifier for the payment. */ id: string; } /** * The product that this invoice was generated for. */ interface Product { /** The unique identifier for the product. */ id: string; /** The display name of the product shown to customers on the product page and in search results. */ title: string; } /** * The user this invoice is addressed to. Null if the user account has been removed. */ interface User { /** The user's email address. Requires the member:email:read permission to access. Null if not authorized. */ email: string | null; /** The unique identifier for the user. */ id: string; /** The user's display name shown on their public profile. */ name: string | null; /** The user's unique username shown on their public profile. */ username: string; } }