export interface Webhook { /** The API version used to format payloads sent to this webhook endpoint. */ api_version: Webhook.ApiVersion; /** The dated API version (Api-Version-Date) that v1 payloads for this endpoint are pinned to: events serialize exactly like a REST read at this version (the native serializer where the resource has one). Null when unpinned — legacy (v2/v5) webhooks, and v1 webhooks on the legacy payload shape. */ api_version_date: string | null; /** Whether events are sent for child resources. For example, if the webhook is on an account, enabling this sends events only from its connected accounts. */ child_resource_events: boolean; /** Number of consecutive deliveries whose first attempt to this endpoint failed since it last accepted one. Later retries of the same delivery do not increment it. Resets to `0` when a delivery succeeds or the webhook is re-enabled. */ consecutive_failures: number; /** When the webhook was created, as an ISO 8601 timestamp. */ created_at: string; /** When Whop automatically disabled this webhook, as an ISO 8601 timestamp. `null` unless the webhook was disabled by Whop; a webhook you disabled yourself has `enabled: false` and a `null` `disabled_at`. */ disabled_at: string | null; /** Why Whop disabled this webhook. `delivery_failures` means every delivery failed for 3 days straight. `null` when `disabled_at` is `null`. */ disabled_reason: Webhook.DisabledReason | null; /** Whether this webhook endpoint is currently active and receiving events. */ enabled: boolean; events: Webhook.Events.Item[]; /** When the current failure streak began, as an ISO 8601 timestamp. Unlike `last_failure_at`, this is set on the streak's first failed attempt, so it shows an endpoint that is failing right now. `null` when the endpoint is healthy. */ failing_since: string | null; /** Webhook ID, prefixed `hook_`. */ id: string; /** When a delivery to this endpoint most recently failed after exhausting retries, as an ISO 8601 timestamp. `null` if no delivery has ever failed. */ last_failure_at: string | null; /** ID of the resource (account or app) this webhook is attached to. */ resource_id: string; testable_events: Webhook.TestableEvents.Item[]; /** A label for this webhook endpoint, such as `Production`, shown in the dashboard. `null` if no title was set. */ title: string | null; /** Destination URL where webhook payloads are delivered via HTTP POST. */ url: string; /** Secret key used to sign webhook payloads for verification. Include this in your HMAC validation logic. Returned on the create response and to interactive dashboard sessions; `null` for API-key and OAuth callers on later reads. */ webhook_secret: string | null; } export declare namespace Webhook { /** The API version used to format payloads sent to this webhook endpoint. */ const ApiVersion: { readonly V1: "v1"; readonly V2: "v2"; readonly V5: "v5"; }; type ApiVersion = (typeof ApiVersion)[keyof typeof ApiVersion]; /** Why Whop disabled this webhook. `delivery_failures` means every delivery failed for 3 days straight. `null` when `disabled_at` is `null`. */ const DisabledReason: { readonly DeliveryFailures: "delivery_failures"; }; type DisabledReason = (typeof DisabledReason)[keyof typeof DisabledReason]; type Events = Events.Item[]; namespace Events { /** Event types this webhook is subscribed to, in dot form (for example `payment.succeeded`). */ const Item: { readonly AccountUpdated: "account.updated"; readonly AccountFinancingApproved: "account.financing_approved"; readonly AccountFinancingDenied: "account.financing_denied"; readonly AccountFinancingDisabled: "account.financing_disabled"; readonly InvoiceCreated: "invoice.created"; readonly InvoiceMarkedUncollectible: "invoice.marked_uncollectible"; readonly InvoicePaid: "invoice.paid"; readonly InvoicePastDue: "invoice.past_due"; readonly InvoiceVoided: "invoice.voided"; readonly MembershipActivated: "membership.activated"; readonly MembershipDeactivated: "membership.deactivated"; readonly MembershipTrialEndingSoon: "membership.trial_ending_soon"; readonly MembershipUpdated: "membership.updated"; readonly EntryCreated: "entry.created"; readonly EntryApproved: "entry.approved"; readonly EntryDenied: "entry.denied"; readonly EntryDeleted: "entry.deleted"; readonly ExportCompleted: "export.completed"; readonly ExportFailed: "export.failed"; readonly SetupIntentRequiresAction: "setup_intent.requires_action"; readonly SetupIntentSucceeded: "setup_intent.succeeded"; readonly SetupIntentCanceled: "setup_intent.canceled"; readonly LedgerAccountFundsAvailable: "ledger_account.funds_available"; readonly SwapCompleted: "swap.completed"; readonly DepositSucceeded: "deposit.succeeded"; readonly FinancialActivityFundsAvailable: "financial_activity.funds_available"; readonly TransferCreated: "transfer.created"; readonly TransferCompleted: "transfer.completed"; readonly TransferFailed: "transfer.failed"; readonly WithdrawalCreated: "withdrawal.created"; readonly WithdrawalUpdated: "withdrawal.updated"; readonly WithdrawalReversed: "withdrawal.reversed"; readonly PayoutCreated: "payout.created"; readonly PayoutUpdated: "payout.updated"; readonly PayoutReversed: "payout.reversed"; readonly CardTransactionCreated: "card_transaction.created"; readonly CardTransactionUpdated: "card_transaction.updated"; readonly CardTransactionCompleted: "card_transaction.completed"; readonly CardTransactionDeclined: "card_transaction.declined"; readonly CardTransactionReversed: "card_transaction.reversed"; readonly CardCreated: "card.created"; readonly CardUpdated: "card.updated"; readonly CardFrozen: "card.frozen"; readonly CardCanceled: "card.canceled"; readonly CardApplicationCreated: "card_application.created"; readonly CardApplicationUpdated: "card_application.updated"; readonly CardApplicationApproved: "card_application.approved"; readonly CardApplicationDenied: "card_application.denied"; readonly CourseLessonInteractionCompleted: "course_lesson_interaction.completed"; readonly DomainCreated: "domain.created"; readonly DomainUpdated: "domain.updated"; readonly DomainDeleted: "domain.deleted"; readonly PayoutMethodCreated: "payout_method.created"; readonly VerificationSucceeded: "verification.succeeded"; readonly IdentityProfileApproved: "identity_profile.approved"; readonly IdentityProfileRejected: "identity_profile.rejected"; readonly IdentityProfileNeedsAction: "identity_profile.needs_action"; readonly IdentityProfileUpdated: "identity_profile.updated"; readonly PayoutAccountStatusUpdated: "payout_account.status_updated"; readonly PaymentAuthorized: "payment.authorized"; readonly PaymentCanceled: "payment.canceled"; readonly ResolutionCenterCaseCreated: "resolution_center_case.created"; readonly ResolutionCenterCaseUpdated: "resolution_center_case.updated"; readonly ResolutionCenterCaseDecided: "resolution_center_case.decided"; readonly ProductCreated: "product.created"; readonly ProductUpdated: "product.updated"; readonly ProductDeleted: "product.deleted"; readonly ProductPublished: "product.published"; readonly ProductUnpublished: "product.unpublished"; readonly PlanCreated: "plan.created"; readonly PlanUpdated: "plan.updated"; readonly PlanDeleted: "plan.deleted"; readonly ShipmentCreated: "shipment.created"; readonly ShipmentUpdated: "shipment.updated"; readonly MemberCreated: "member.created"; readonly MemberUpdated: "member.updated"; readonly AdCampaignCreated: "ad_campaign.created"; readonly AdCampaignPaymentFailed: "ad_campaign.payment_failed"; readonly AdCampaignUpdated: "ad_campaign.updated"; readonly AdCampaignEvents: "ad_campaign.events"; readonly AdGroupCreated: "ad_group.created"; readonly AdGroupUpdated: "ad_group.updated"; readonly AdCreated: "ad.created"; readonly AdUpdated: "ad.updated"; readonly AppInstallationCreated: "app_installation.created"; readonly AppInstallationDeleted: "app_installation.deleted"; readonly ChatMessageCreated: "chat.message.created"; readonly ChatReactionCreated: "chat.reaction.created"; readonly PaymentCreated: "payment.created"; readonly PaymentSucceeded: "payment.succeeded"; readonly PaymentFailed: "payment.failed"; readonly PaymentPending: "payment.pending"; readonly PaymentRequiresAction: "payment.requires_action"; readonly DisputeCreated: "dispute.created"; readonly DisputeUpdated: "dispute.updated"; readonly RefundCreated: "refund.created"; readonly RefundUpdated: "refund.updated"; readonly DisputeAlertCreated: "dispute_alert.created"; readonly MembershipCancelAtPeriodEndChanged: "membership.cancel_at_period_end_changed"; readonly MembershipWentValid: "membership.went_valid"; readonly MembershipWentInvalid: "membership.went_invalid"; readonly MembershipMetadataUpdated: "membership.metadata_updated"; readonly ResolutionCreated: "resolution.created"; readonly ResolutionUpdated: "resolution.updated"; readonly ResolutionDecided: "resolution.decided"; readonly PaymentAffiliateRewardCreated: "payment.affiliate_reward_created"; readonly MembershipExperienceClaimed: "membership.experience_claimed"; readonly AppMembershipWentValid: "app_membership.went_valid"; readonly AppMembershipWentInvalid: "app_membership.went_invalid"; readonly AppPaymentCreated: "app_payment.created"; readonly AppPaymentSucceeded: "app_payment.succeeded"; readonly AppPaymentFailed: "app_payment.failed"; readonly AppPaymentPending: "app_payment.pending"; readonly AppPaymentRequiresAction: "app_payment.requires_action"; readonly AppMembershipCancelAtPeriodEndChanged: "app_membership.cancel_at_period_end_changed"; }; type Item = (typeof Item)[keyof typeof Item]; } type TestableEvents = TestableEvents.Item[]; namespace TestableEvents { /** The subset of subscribed event types that support sending test payloads, in dot form. */ const Item: { readonly AccountUpdated: "account.updated"; readonly AccountFinancingApproved: "account.financing_approved"; readonly AccountFinancingDenied: "account.financing_denied"; readonly AccountFinancingDisabled: "account.financing_disabled"; readonly InvoiceCreated: "invoice.created"; readonly InvoiceMarkedUncollectible: "invoice.marked_uncollectible"; readonly InvoicePaid: "invoice.paid"; readonly InvoicePastDue: "invoice.past_due"; readonly InvoiceVoided: "invoice.voided"; readonly MembershipActivated: "membership.activated"; readonly MembershipDeactivated: "membership.deactivated"; readonly MembershipTrialEndingSoon: "membership.trial_ending_soon"; readonly MembershipUpdated: "membership.updated"; readonly EntryCreated: "entry.created"; readonly EntryApproved: "entry.approved"; readonly EntryDenied: "entry.denied"; readonly EntryDeleted: "entry.deleted"; readonly ExportCompleted: "export.completed"; readonly ExportFailed: "export.failed"; readonly SetupIntentRequiresAction: "setup_intent.requires_action"; readonly SetupIntentSucceeded: "setup_intent.succeeded"; readonly SetupIntentCanceled: "setup_intent.canceled"; readonly LedgerAccountFundsAvailable: "ledger_account.funds_available"; readonly SwapCompleted: "swap.completed"; readonly DepositSucceeded: "deposit.succeeded"; readonly FinancialActivityFundsAvailable: "financial_activity.funds_available"; readonly TransferCreated: "transfer.created"; readonly TransferCompleted: "transfer.completed"; readonly TransferFailed: "transfer.failed"; readonly WithdrawalCreated: "withdrawal.created"; readonly WithdrawalUpdated: "withdrawal.updated"; readonly WithdrawalReversed: "withdrawal.reversed"; readonly PayoutCreated: "payout.created"; readonly PayoutUpdated: "payout.updated"; readonly PayoutReversed: "payout.reversed"; readonly CardTransactionCreated: "card_transaction.created"; readonly CardTransactionUpdated: "card_transaction.updated"; readonly CardTransactionCompleted: "card_transaction.completed"; readonly CardTransactionDeclined: "card_transaction.declined"; readonly CardTransactionReversed: "card_transaction.reversed"; readonly CardCreated: "card.created"; readonly CardUpdated: "card.updated"; readonly CardFrozen: "card.frozen"; readonly CardCanceled: "card.canceled"; readonly CardApplicationCreated: "card_application.created"; readonly CardApplicationUpdated: "card_application.updated"; readonly CardApplicationApproved: "card_application.approved"; readonly CardApplicationDenied: "card_application.denied"; readonly CourseLessonInteractionCompleted: "course_lesson_interaction.completed"; readonly DomainCreated: "domain.created"; readonly DomainUpdated: "domain.updated"; readonly DomainDeleted: "domain.deleted"; readonly PayoutMethodCreated: "payout_method.created"; readonly VerificationSucceeded: "verification.succeeded"; readonly IdentityProfileApproved: "identity_profile.approved"; readonly IdentityProfileRejected: "identity_profile.rejected"; readonly IdentityProfileNeedsAction: "identity_profile.needs_action"; readonly IdentityProfileUpdated: "identity_profile.updated"; readonly PayoutAccountStatusUpdated: "payout_account.status_updated"; readonly PaymentAuthorized: "payment.authorized"; readonly PaymentCanceled: "payment.canceled"; readonly ResolutionCenterCaseCreated: "resolution_center_case.created"; readonly ResolutionCenterCaseUpdated: "resolution_center_case.updated"; readonly ResolutionCenterCaseDecided: "resolution_center_case.decided"; readonly ProductCreated: "product.created"; readonly ProductUpdated: "product.updated"; readonly ProductDeleted: "product.deleted"; readonly ProductPublished: "product.published"; readonly ProductUnpublished: "product.unpublished"; readonly PlanCreated: "plan.created"; readonly PlanUpdated: "plan.updated"; readonly PlanDeleted: "plan.deleted"; readonly ShipmentCreated: "shipment.created"; readonly ShipmentUpdated: "shipment.updated"; readonly MemberCreated: "member.created"; readonly MemberUpdated: "member.updated"; readonly AdCampaignCreated: "ad_campaign.created"; readonly AdCampaignPaymentFailed: "ad_campaign.payment_failed"; readonly AdCampaignUpdated: "ad_campaign.updated"; readonly AdCampaignEvents: "ad_campaign.events"; readonly AdGroupCreated: "ad_group.created"; readonly AdGroupUpdated: "ad_group.updated"; readonly AdCreated: "ad.created"; readonly AdUpdated: "ad.updated"; readonly AppInstallationCreated: "app_installation.created"; readonly AppInstallationDeleted: "app_installation.deleted"; readonly ChatMessageCreated: "chat.message.created"; readonly ChatReactionCreated: "chat.reaction.created"; readonly PaymentCreated: "payment.created"; readonly PaymentSucceeded: "payment.succeeded"; readonly PaymentFailed: "payment.failed"; readonly PaymentPending: "payment.pending"; readonly PaymentRequiresAction: "payment.requires_action"; readonly DisputeCreated: "dispute.created"; readonly DisputeUpdated: "dispute.updated"; readonly RefundCreated: "refund.created"; readonly RefundUpdated: "refund.updated"; readonly DisputeAlertCreated: "dispute_alert.created"; readonly MembershipCancelAtPeriodEndChanged: "membership.cancel_at_period_end_changed"; readonly MembershipWentValid: "membership.went_valid"; readonly MembershipWentInvalid: "membership.went_invalid"; readonly MembershipMetadataUpdated: "membership.metadata_updated"; readonly ResolutionCreated: "resolution.created"; readonly ResolutionUpdated: "resolution.updated"; readonly ResolutionDecided: "resolution.decided"; readonly PaymentAffiliateRewardCreated: "payment.affiliate_reward_created"; readonly MembershipExperienceClaimed: "membership.experience_claimed"; readonly AppMembershipWentValid: "app_membership.went_valid"; readonly AppMembershipWentInvalid: "app_membership.went_invalid"; readonly AppPaymentCreated: "app_payment.created"; readonly AppPaymentSucceeded: "app_payment.succeeded"; readonly AppPaymentFailed: "app_payment.failed"; readonly AppPaymentPending: "app_payment.pending"; readonly AppPaymentRequiresAction: "app_payment.requires_action"; readonly AppMembershipCancelAtPeriodEndChanged: "app_membership.cancel_at_period_end_changed"; }; type Item = (typeof Item)[keyof typeof Item]; } }