import type * as Whop from "../index.js"; /** * A payment represents a completed or attempted charge. Payments track the amount, status, currency, and payment method used. */ export interface PaymentLegacy { /** How much the payment is for after fees */ amount_after_fees: number; /** The application fee charged on this payment. */ application_fee: PaymentLegacy.ApplicationFee | null; /** Whether this payment was auto refunded or not */ auto_refunded: boolean; /** The address of the user who made the payment. */ billing_address: PaymentLegacy.BillingAddress | null; /** The machine-readable reason this charge was created, such as initial subscription purchase, renewal cycle, or one-time payment. */ billing_reason: Whop.BillingReasons | null; /** Card network reported by the processor (e.g., 'visa', 'mastercard', 'amex'). Present only when the payment method type is 'card'. */ card_brand: Whop.CardBrands | null; /** The expiration month (1-12) of the card used for this payment. Falls back to the declined card on failed payments with no saved card. Null when the payment was not made with a card or the expiry is unavailable. */ card_exp_month: number | null; /** The four-digit expiration year of the card used for this payment. Falls back to the declined card on failed payments with no saved card. Null when the payment was not made with a card or the expiry is unavailable. */ card_exp_year: number | null; /** The last four digits of the card used to make this payment. Null if the payment was not made with a card. */ card_last4: string | null; /** The ID of the checkout session/configuration that produced this payment, if any. Use this to map payments back to the checkout configuration that created them. */ checkout_configuration_id: string | null; /** The company for the payment. */ company: PaymentLegacy.Company | null; /** The datetime the payment was created. */ created_at: string; /** The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). */ currency: Whop.Currencies; /** Phone number the customer provided at checkout, or their verified phone number when your checkout requires phone verification. `null` when no phone number was collected. */ customer_phone: string | null; /** The reason the payment was declined. Null if the payment did not fail. */ decline_code: Whop.PaymentDeclineCodes | null; /** When an alert came in that this transaction will be disputed */ dispute_alerted_at: string | null; /** The disputes attached to this payment. Null if the actor in context does not have the payment:dispute:read permission. */ disputes: PaymentLegacy.Disputes.Item[] | null; /** If the payment failed, the reason for the failure. */ failure_message: string | null; /** The fees associated with this specific payment. */ fees: PaymentLegacy.Fees.Item[]; /** The number of financing installments for the payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.). */ financing_installments_count: number | null; /** The financing transactions attached to this payment. Present if the payment is a financing payment (e.g. Splitit, Klarna, etc.). */ financing_transactions: PaymentLegacy.FinancingTransactions.Item[]; /** The unique identifier for the payment. */ id: string; /** The time of the last payment attempt. */ last_payment_attempt: string | null; /** The member attached to this payment. */ member: PaymentLegacy.Member | null; /** The membership attached to this payment. */ membership: PaymentLegacy.Membership | null; /** The custom metadata stored on this payment. This will be copied over to the checkout configuration for which this payment was made */ metadata: Record | null; /** Whether this payment is holding funds until the order ships and has no tracking number yet. */ needs_tracking: boolean | null; /** The time of the next schedule payment retry. */ next_payment_attempt: string | null; /** The time at which this payment was successfully collected. Null if the payment has not yet succeeded. As a Unix timestamp. */ paid_at: string | null; /** The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. */ payment_instrument: PaymentLegacy.PaymentInstrument | null; /** The tokenized payment method reference used for this payment. Null if no token was used. */ payment_method: PaymentLegacy.PaymentMethod | null; /** The type of payment instrument used for this payment (e.g., card, Cash App, iDEAL, Klarna, crypto). Null when the processor does not supply a type. */ payment_method_type: Whop.PaymentMethodTypes | null; /** The number of failed payment attempts for the payment. */ payments_failed: number | null; /** The plan attached to this payment. */ plan: PaymentLegacy.Plan | null; /** The product this payment was made for */ product: PaymentLegacy.Product | null; /** The promo code used for this payment. */ promo_code: PaymentLegacy.PromoCode | null; /** Whop-hosted URL where the buyer can sign in and complete 3D Secure for an off-session charge the bank challenged — a subscription renewal or a saved-card payment. `null` when recovery is unavailable or you lack `member:basic:read`. */ recovery_url: string | null; /** True only for payments that are `paid`, have not been fully refunded, and were processed by a payment processor that allows refunds. */ refundable: boolean; /** The payment refund amount(if applicable). */ refunded_amount: number | null; /** When the payment was refunded (if applicable). */ refunded_at: string | null; /** The refunds issued against this payment, newest first, including failed and canceled refund attempts. Limited to the 100 most recent. */ refunds: PaymentLegacy.Refunds.Item[]; /** The resolution center cases opened by the customer on this payment. Null if the actor in context does not have the payment:resolution_center_case:read permission. */ resolutions: PaymentLegacy.Resolutions.Item[] | null; /** True when the payment status is `open` and its membership is in one of the retry-eligible states (`active`, `trialing`, `completed`, or `past_due`), or when it is a failed initial billing-engine payment on a `drafted` membership with an unlimited-stock plan; otherwise false. Used to decide if Whop can attempt the charge again. */ retryable: boolean; /** Whop's in-house fraud risk score for this payment, from 0 (lowest risk) to 100 (highest risk). Null when the payment has not been scored or scoring has not yet completed. */ risk_score: number | null; /** Deprecated. Always null. */ risk_signals: Record | null; /** The total amount charged to the customer for this payment, including taxes and after any discounts. In the currency specified by the currency field. */ settlement_amount: number; /** The three-letter ISO currency code for this payment (e.g., 'usd', 'eur'). */ settlement_currency: Whop.Currencies; /** Deprecated. Always returns null. */ settlement_exchange_rate: number | null; /** When this payment's funds post to the company's available balance, at midnight UTC. Known at payment time and never changes. The `financial_activity.funds_available` webhook's `posted_at` carries the same value when the settlement that clears it posts — match them to know these funds are now withdrawable. */ settlement_time_at: string | null; /** The shipment attached to this payment. */ shipment: PaymentLegacy.Shipment | null; /** The shipping address provided by the customer for physical goods. Null if no shipping address was collected. */ shipping_address: PaymentLegacy.ShippingAddress | null; /** The stock keeping unit of the variant this payment charged for (the first item, on a cart), as set by the seller. Accounts with billing-reason SKU suffixes enabled receive it stamped with why the charge happened: `-S` for a first subscription charge, `-R` for a renewal, `-C` for a one-time purchase, `-U` when the payment's own metadata carries `upsell: true`, `-F` when nothing was charged. Other billing reasons carry the bare SKU. Null when the variant has no SKU. */ sku: string | null; /** The current lifecycle state of this payment (e.g., 'draft', 'open', 'paid', 'void'). */ status: Whop.ReceiptStatus | null; /** The friendly status of the payment. */ substatus: Whop.FriendlyReceiptStatus; /** The subtotal to show to the creator (excluding buyer fees). */ subtotal: number | null; /** The calculated amount of the sales/VAT tax (if applicable). */ tax_amount: number | null; /** The type of tax inclusivity applied to the payment, for determining whether the tax is included in the final price, or paid on top. */ tax_behavior: Whop.ReceiptTaxBehaviors | null; /** The amount of tax that has been refunded (if applicable). */ tax_refunded_amount: number | null; /** Whether 3D Secure authentication was completed for this payment. */ three_ds_verified: boolean; /** The total to show to the creator (excluding buyer fees). */ total: number | null; /** The datetime the payment was last updated. */ updated_at: string; /** The total in USD to show to the creator (excluding buyer fees). */ usd_total: number | null; /** The user that made this payment. */ user: PaymentLegacy.User | null; /** The issuer's address and card security code check results for this payment. Null when the processor returned none. */ verification_checks: PaymentLegacy.VerificationChecks | null; /** True when the payment can be voided or canceled. The request is rejected if the payment is no longer eligible. */ voidable: boolean; } export declare namespace PaymentLegacy { /** * The application fee charged on this payment. */ interface ApplicationFee { /** The application fee amount. */ amount: number; /** The amount of the application fee that has been captured. */ amount_captured: number; /** The amount of the application fee that has been refunded. */ amount_refunded: number; /** The datetime the application fee was created. */ created_at: string; /** The currency of the application fee. */ currency: Whop.Currencies; /** The unique identifier for the application fee. */ id: string; } /** * The address of the user who made the payment. */ interface BillingAddress { /** 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 postal code of the address. */ postal_code: string | null; /** The state of the address. */ state: string | null; } /** * The company for the payment. */ interface Company { /** The unique identifier for the company. */ id: string; /** The slug/route of the company on the Whop site. */ route: string; /** The written name of the company. */ title: string; } type Disputes = Disputes.Item[]; namespace Disputes { /** * A dispute is a chargeback or payment challenge filed against a company, including evidence and response status. */ interface Item { /** The disputed amount in the specified currency, formatted as a decimal. */ amount: number; /** The three-letter ISO currency code for the disputed amount. */ currency: Whop.Currencies; /** Whether the dispute evidence can still be edited and submitted. */ editable: boolean | null; /** The unique identifier for the dispute. */ id: string; /** The deadline by which dispute evidence must be submitted. Null if no response deadline is set. */ needs_response_by: string | null; /** Additional freeform notes submitted by the company as part of the dispute evidence. */ notes: string | null; /** A human-readable reason for the dispute. */ reason: string | null; /** The current status of the dispute lifecycle, such as needs_response, under_review, won, or lost. */ status: Whop.DisputeStatuses; } } type Fees = Fees.Item[]; namespace Fees { /** * Represents a fee related to a payment */ interface Item { /** The value or amount to display for the fee. */ amount: number; /** The currency of the fee. */ currency: Whop.Currencies; /** The label to display for the fee. */ name: string; /** The specific origin of the fee, if applicable. */ type: Whop.SpecificFeeOrigins; } } type FinancingTransactions = FinancingTransactions.Item[]; namespace FinancingTransactions { /** * A payment transaction. */ interface Item { /** The amount of the payment transaction. */ amount: number; /** The date and time the payment transaction was created. */ created_at: string; /** The unique identifier for the payment transaction. */ id: string; /** The status of the payment transaction. */ status: Whop.PaymentTransactionStatuses; /** The type of the payment transaction. */ transaction_type: Whop.PaymentTransactionTypes; } } /** * The member attached to this payment. */ interface Member { /** The unique identifier for the company member. */ id: string; /** The phone number for the member, if available. */ phone: string | null; } /** * The membership attached to this payment. */ interface Membership { /** The unique identifier for the membership. */ id: string; /** The phone number associated with this membership. */ phone_number: string | null; /** The state of the membership. */ status: Whop.MembershipStatus; } /** * The instrument this payment was made with, shaped for display: the method type, a buyer-facing name, the standard icon set, and the card facts when it was a card. Null when the receipt names no payment method. */ interface PaymentInstrument { /** Card payments only: the card's network and last four. */ card: PaymentInstrument.Card | null; /** Buyer-facing instrument name — "Visa •••• 4242" when the card surfaced, else the method's own name ("Klarna"). */ display_name: string; /** The standard icon set: square and card shapes, each in light and dark colorways. */ icons: PaymentInstrument.Icons; /** Installment methods only: how many payments the charge splits into. Data, not copy — compose and translate the label client-side. */ installment_count: number | null; /** The payment method type identifier, e.g. `card`, `klarna`, `apple_pay`. */ payment_method_type: string; } namespace PaymentInstrument { /** * Card payments only: the card's network and last four. */ interface Card { /** The network identifier (`visa`, `amex`, …), matching `card.networks` entries and saved card payment methods. */ brand: string; /** The card's last four digits, when captured. */ last4: string | null; } /** * The standard icon set: square and card shapes, each in light and dark colorways. */ interface Icons { /** The credit-card-proportioned tile (48x30). */ card: Icons.Card; /** The square tile (32x32). */ square: Icons.Square; } namespace Icons { /** * The credit-card-proportioned tile (48x30). */ interface Card { /** The colorway for dark surfaces. */ dark: Card.Dark; /** The colorway for light surfaces. */ light: Card.Light; } namespace Card { /** * The colorway for dark surfaces. */ interface Dark { /** Raster fallback at the shape's native size. */ png_1x: string; /** Raster fallback at double density. */ png_2x: string; /** Raster fallback at quadruple density. */ png_4x: string; /** The vector file. Prefer this everywhere SVG renders. */ svg: string; } /** * The colorway for light surfaces. */ interface Light { /** Raster fallback at the shape's native size. */ png_1x: string; /** Raster fallback at double density. */ png_2x: string; /** Raster fallback at quadruple density. */ png_4x: string; /** The vector file. Prefer this everywhere SVG renders. */ svg: string; } } /** * The square tile (32x32). */ interface Square { /** The colorway for dark surfaces. */ dark: Square.Dark; /** The colorway for light surfaces. */ light: Square.Light; } namespace Square { /** * The colorway for dark surfaces. */ interface Dark { /** Raster fallback at the shape's native size. */ png_1x: string; /** Raster fallback at double density. */ png_2x: string; /** Raster fallback at quadruple density. */ png_4x: string; /** The vector file. Prefer this everywhere SVG renders. */ svg: string; } /** * The colorway for light surfaces. */ interface Light { /** Raster fallback at the shape's native size. */ png_1x: string; /** Raster fallback at double density. */ png_2x: string; /** Raster fallback at quadruple density. */ png_4x: string; /** The vector file. Prefer this everywhere SVG renders. */ svg: string; } } } } /** * The tokenized payment method reference used for this payment. Null if no token was used. */ interface PaymentMethod { /** The card data associated with the payment method, if its a debit or credit card. */ card: PaymentMethod.Card | null; /** The datetime the payment token was created. */ created_at: string; /** The unique identifier for the payment token. */ id: string; /** The payment method type of the payment method */ payment_method_type: Whop.PaymentMethodTypes; } namespace PaymentMethod { /** * The card data associated with the payment method, if its a debit or credit card. */ interface Card { /** The card network (e.g., visa, mastercard, amex). Null if the brand could not be determined. */ brand: Whop.CardBrands | null; /** The two-digit expiration month of the card (1-12). Null if not available. */ exp_month: number | null; /** The two-digit expiration year of the card (e.g., 27 for 2027). Null if not available. */ exp_year: number | null; /** A stable identifier for the underlying card. Two payment methods with the same fingerprint are the same card. Null if not available. */ fingerprint: string | null; /** The last four digits of the card number. Null if not available. */ last4: string | null; } } /** * The plan attached to this payment. */ interface Plan { /** The unique identifier for the plan. */ id: string; /** A personal description or notes section for the business. */ internal_notes: string | null; /** Custom key-value pairs stored on the plan. Included in webhook payloads for payment and membership events. Max 50 keys, 100 chars per key, 500 chars per string value. The reserved keys `custom_cta` and `custom_cta_url`, when set, override the product's checkout call to action for this plan. */ metadata: Record | null; } /** * The product this payment was made for */ interface Product { /** The unique identifier for the product. */ id: string; /** Custom key-value pairs stored on the product and included in payment and membership webhook payloads. Max 50 keys, 100 characters per key, 500 characters per string value. */ metadata: Record | null; /** URL slug in the product's public link, e.g. `pickaxe-analytics` in whop.com/company/pickaxe-analytics. */ route: string; /** The display name of the product shown to customers on the product page and in search results. */ title: string; } /** * The promo code used for this payment. */ interface PromoCode { /** The discount amount. Interpretation depends on promo_type: if 'percentage', this is the percentage (e.g., 20 means 20% off); if 'flat_amount', this is dollars off (e.g., 10.00 means $10.00 off). */ amount_off: number; /** The monetary currency of the promo code. */ base_currency: Whop.Currencies; /** The specific code used to apply the promo at checkout. */ code: string | null; /** The unique identifier for the promo code. */ id: string; /** The number of months the promo is applied for. */ number_of_intervals: number | null; /** The type (% or flat amount) of the promo. */ promo_type: Whop.PromoTypes; } type Refunds = Refunds.Item[]; namespace Refunds { /** * A refund represents a full or partial reversal of a payment, including the amount, status, and payment provider. */ interface Item { /** The refunded amount as a decimal in the specified currency, such as 10.43 for $10.43 USD. */ amount: number; /** The datetime the refund was created. */ created_at: string; /** The three-letter ISO currency code for the refunded amount. */ currency: Whop.Currencies; /** The unique identifier for the refund. */ id: string; /** The current processing status of the refund, such as pending, succeeded, or failed. */ status: Whop.RefundStatuses; } } type Resolutions = Resolutions.Item[]; namespace Resolutions { /** * A resolution center case is a dispute or support case between a user and a company, tracking the issue, status, and outcome. */ interface Item { /** Whether the customer has filed an appeal after the initial resolution decision. */ customer_appealed: boolean; /** The list of actions currently available to the customer. */ customer_response_actions: Whop.ResolutionCenterCaseCustomerResponses[]; /** The deadline by which the next response is required. Null if no deadline is currently active. As a Unix timestamp. */ due_date: string | null; /** The unique identifier for the resolution. */ id: string; /** The category of the dispute. */ issue: Whop.ResolutionCenterCaseIssueTypes; /** Whether the merchant has filed an appeal after the initial resolution decision. */ merchant_appealed: boolean; /** The list of actions currently available to the merchant. */ merchant_response_actions: Whop.ResolutionCenterCaseMerchantResponses[]; /** The list of actions currently available to the Whop platform for moderating this resolution. */ platform_response_actions: Whop.ResolutionCenterCasePlatformResponses[]; /** The current status of the resolution case, indicating which party needs to respond or if the case is closed. */ status: Whop.ResolutionCenterCaseStatuses; } } /** * The shipment attached to this payment. */ interface Shipment { /** The shipping carrier detected for this shipment. Null until a tracking update identifies it. */ carrier: string | null; /** The unique identifier for the shipment. */ id: string; /** The current delivery status of this shipment. */ status: Whop.ShipmentStatuses; /** The carrier-assigned tracking number used to look up shipment progress. */ tracking_number: string; /** A customer-facing URL to track this shipment's progress. */ tracking_url: string; } /** * The shipping address provided by the customer for physical goods. Null if no shipping address was collected. */ interface ShippingAddress { /** 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 postal code of the address. */ postal_code: string | null; /** The state of the address. */ state: string | null; } /** * The user that made this payment. */ 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; } /** * The issuer's address and card security code check results for this payment. Null when the processor returned none. */ interface VerificationChecks { /** Whether the billing street address the customer entered matched the address the issuer has on file. */ address_line1: string | null; /** The card issuer's authorization code for this charge. Null when the processor did not return one. */ authorization_code: string | null; /** Whether the cardholder name the customer entered matched the name the issuer has on file. */ card_holder_name: string | null; /** Whether the CVV / CVC the customer entered matched the card. */ card_security_code: string | null; /** Whether the billing postal code the customer entered matched the postal code the issuer has on file. */ zip_code: string | null; } }