/** * The account, variant and promo code for a purchase. */ export interface PaymentInput { /** The account the purchase belongs to, prefixed `biz_`. */ account_id: string; /** The promo code as the buyer typed it, matched within the account regardless of case and surrounding spaces, as checkout matches it. It must be valid for the variant. Send it or `promo_code_id`, not both; an empty or whitespace-only string counts as not sent. A code the account does not have, or one that is no longer active, is refused before anything is written, with the error code `promo_invalid`. A code this purchase cannot use, such as one with no uses left or one restricted to other variants, products or buyers, is refused with `promo_invalid` too, and the error's message says why. */ promo_code?: (string | null) | undefined; /** An active promo code to apply, prefixed `promo_`. It must belong to the account and be valid for the variant. Send it or `promo_code`, not both. A code this purchase cannot use is refused with the error code `promo_invalid`, and the error's message says why. */ promo_code_id?: (string | null) | undefined; /** The variant purchased, described by its attributes instead of an id: the variant with exactly these attributes is used, and one is created when none exists. Mutually exclusive with `variant_id` and `line_items`. Creating a variant requires `plan:create`; creating or updating a product requires the corresponding product permission. */ variant?: PaymentInput.Variant | undefined; /** The variant purchased, prefixed `plan_`. It must belong to the account. Mutually exclusive with `variant` and `line_items`. */ variant_id?: string | undefined; } export declare namespace PaymentInput { /** * The variant purchased, described by its attributes instead of an id: the variant with exactly these attributes is used, and one is created when none exists. Mutually exclusive with `variant_id` and `line_items`. Creating a variant requires `plan:create`; creating or updating a product requires the corresponding product permission. */ interface Variant { /** Whether more than one unit can be purchased in an order. Renewal variants cannot enable it. When `false`, checkouts, carts, and invoices reject a quantity above 1. */ allow_multiple_quantity?: (boolean | null) | undefined; /** Application fee the platform collects per unit, in the variant currency (5.00 means $5.00 for USD). Must be positive and below the initial price for one-time variants or renewal price for recurring variants. Paid to the parent account alongside other processing fees; collection is capped to remaining proceeds. Applies to subsequent payments on recurring variants. Only valid for connected accounts with a parent account. */ application_fee_amount?: (number | null) | undefined; /** Recurring billing interval in days. */ billing_period?: (number | null) | undefined; /** Billing model for the variant. */ billing_type?: (Variant.BillingType | null) | undefined; /** Currency code for the variant prices. */ currency: Variant.Currency; /** Variant description. */ description?: (string | null) | undefined; /** Days until access expires. */ expiration_days?: (number | null) | undefined; /** Create a new variant instead of reusing a matching variant. */ force_create_new_plan?: (boolean | null) | undefined; /** Additional amount charged on the first purchase, in the variant currency. For recurring variants without a trial, the first charge includes this amount plus renewal_price. */ initial_price?: (number | null) | undefined; /** Internal notes for the account. */ internal_notes?: (string | null) | undefined; /** Whether the variant's price includes tax: `inclusive` (tax is included in the price), `exclusive` (tax is added on top), or `unspecified`. Omit it or pass `null` to use the account's tax setting. On an account enrolled in the Whop tax service, `inclusive` or `exclusive` replaces the account's setting and `unspecified` keeps it. Otherwise it applies only where the account is the merchant of record: `inclusive` or `exclusive` replaces the account's setting when the account collects tax, and `unspecified` means the variant collects no tax. Where Whop is the merchant of record, the account's setting applies. Variants that differ only in this value are different variants. */ override_tax_type?: (Variant.OverrideTaxType | null) | undefined; /** Find or create a product by external identifier. Mutually exclusive with product_id. */ product?: (Variant.Product | null) | undefined; /** Existing product ID belonging to the account, prefixed `prod_`. Mutually exclusive with `product`. */ product_id?: (string | null) | undefined; /** Recurring price in the variant currency. */ renewal_price?: (number | null) | undefined; /** Variant title. */ title?: (string | null) | undefined; /** Free trial days before renewal. */ trial_period_days?: (number | null) | undefined; /** Whether the variant is visible to customers. */ visibility?: (Variant.Visibility | null) | undefined; } namespace Variant { /** Billing model for the variant. */ const BillingType: { readonly Renewal: "renewal"; readonly OneTime: "one_time"; }; type BillingType = (typeof BillingType)[keyof typeof BillingType]; /** Currency code for the variant prices. */ const Currency: { readonly Usd: "usd"; readonly Sgd: "sgd"; readonly Inr: "inr"; readonly Aud: "aud"; readonly Brl: "brl"; readonly Cad: "cad"; readonly Dkk: "dkk"; readonly Eur: "eur"; readonly Nok: "nok"; readonly Gbp: "gbp"; readonly Sek: "sek"; readonly Chf: "chf"; readonly Hkd: "hkd"; readonly Huf: "huf"; readonly Jpy: "jpy"; readonly Mxn: "mxn"; readonly Myr: "myr"; readonly Pln: "pln"; readonly Czk: "czk"; readonly Nzd: "nzd"; readonly Aed: "aed"; readonly Eth: "eth"; readonly Ape: "ape"; readonly Cop: "cop"; readonly Ron: "ron"; readonly Thb: "thb"; readonly Bgn: "bgn"; readonly Idr: "idr"; readonly Dop: "dop"; readonly Php: "php"; readonly Try: "try"; readonly Krw: "krw"; readonly Twd: "twd"; readonly Vnd: "vnd"; readonly Pkr: "pkr"; readonly Clp: "clp"; readonly Uyu: "uyu"; readonly Ars: "ars"; readonly Zar: "zar"; readonly Dzd: "dzd"; readonly Tnd: "tnd"; readonly Mad: "mad"; readonly Kes: "kes"; readonly Kwd: "kwd"; readonly Jod: "jod"; readonly All: "all"; readonly Xcd: "xcd"; readonly Amd: "amd"; readonly Bsd: "bsd"; readonly Bhd: "bhd"; readonly Bob: "bob"; readonly Bam: "bam"; readonly Khr: "khr"; readonly Crc: "crc"; readonly Xof: "xof"; readonly Egp: "egp"; readonly Etb: "etb"; readonly Gmd: "gmd"; readonly Ghs: "ghs"; readonly Gtq: "gtq"; readonly Gyd: "gyd"; readonly Ils: "ils"; readonly Jmd: "jmd"; readonly Mop: "mop"; readonly Mga: "mga"; readonly Mur: "mur"; readonly Mdl: "mdl"; readonly Mnt: "mnt"; readonly Nad: "nad"; readonly Ngn: "ngn"; readonly Mkd: "mkd"; readonly Omr: "omr"; readonly Pyg: "pyg"; readonly Pen: "pen"; readonly Qar: "qar"; readonly Rwf: "rwf"; readonly Sar: "sar"; readonly Rsd: "rsd"; readonly Lkr: "lkr"; readonly Tzs: "tzs"; readonly Ttd: "ttd"; readonly Uzs: "uzs"; readonly Rub: "rub"; readonly Btc: "btc"; readonly Cny: "cny"; readonly Usdt: "usdt"; readonly Kzt: "kzt"; readonly Awg: "awg"; readonly WhopUsd: "whop_usd"; readonly Xau: "xau"; }; type Currency = (typeof Currency)[keyof typeof Currency]; /** Whether the variant's price includes tax: `inclusive` (tax is included in the price), `exclusive` (tax is added on top), or `unspecified`. Omit it or pass `null` to use the account's tax setting. On an account enrolled in the Whop tax service, `inclusive` or `exclusive` replaces the account's setting and `unspecified` keeps it. Otherwise it applies only where the account is the merchant of record: `inclusive` or `exclusive` replaces the account's setting when the account collects tax, and `unspecified` means the variant collects no tax. Where Whop is the merchant of record, the account's setting applies. Variants that differ only in this value are different variants. */ const OverrideTaxType: { readonly Exclusive: "exclusive"; readonly Inclusive: "inclusive"; readonly Unspecified: "unspecified"; }; type OverrideTaxType = (typeof OverrideTaxType)[keyof typeof OverrideTaxType]; /** * Find or create a product by external identifier. Mutually exclusive with product_id. */ interface Product { /** Whether to collect a shipping address at checkout. */ collect_shipping_address?: (boolean | null) | undefined; /** Custom card statement descriptor for the product, starting with WHOP*. */ custom_statement_descriptor?: (string | null) | undefined; /** Product description. */ description?: (string | null) | undefined; /** Your unique identifier for the product. */ external_identifier: string; /** Percentage of revenue paid to global affiliates. */ global_affiliate_percentage?: (number | null) | undefined; /** Global affiliate program status. */ global_affiliate_status?: (Product.GlobalAffiliateStatus | null) | undefined; /** Product headline. */ headline?: (string | null) | undefined; /** Product tax code identifier. */ product_tax_code_id?: (string | null) | undefined; /** Where to redirect the buyer after purchase. */ redirect_purchase_url?: (string | null) | undefined; /** Product route. */ route?: (string | null) | undefined; /** Product title. */ title: string; /** Product visibility. Defaults to hidden. */ visibility?: Product.Visibility | undefined; } namespace Product { /** Global affiliate program status. */ const GlobalAffiliateStatus: { readonly Enabled: "enabled"; readonly Disabled: "disabled"; }; type GlobalAffiliateStatus = (typeof GlobalAffiliateStatus)[keyof typeof GlobalAffiliateStatus]; /** Product visibility. Defaults to hidden. */ const Visibility: { readonly Visible: "visible"; readonly Hidden: "hidden"; readonly Archived: "archived"; readonly QuickLink: "quick_link"; }; type Visibility = (typeof Visibility)[keyof typeof Visibility]; } /** Whether the variant is visible to customers. */ const Visibility: { readonly Visible: "visible"; readonly Hidden: "hidden"; readonly Archived: "archived"; readonly QuickLink: "quick_link"; }; type Visibility = (typeof Visibility)[keyof typeof Visibility]; } }