Skip to main content
This function and all other functions in this graphql sdk are deprecated. Please migrate to the new rest api.
This operation is only available on the server.

Required Permissions

  • developer:manage_webhook

Usage

import { whopSdk } from "@/lib/whop-sdk";

const result = await whopSdk.webhooks.testWebhook({
	// The event to test the webhook for.
	event:
		"app_membership_cancel_at_period_end_changed" /* Valid values: app_membership_cancel_at_period_end_changed | app_membership_went_invalid | app_membership_went_valid | app_payment_failed | app_payment_pending | app_payment_succeeded | course_lesson_interaction_completed | dispute_alert_created | dispute_created | dispute_updated | entry_approved | entry_created | entry_deleted | entry_denied | invoice_created | invoice_paid | invoice_past_due | invoice_voided | membership_activated | membership_cancel_at_period_end_changed | membership_deactivated | membership_experience_claimed | membership_metadata_updated | membership_went_invalid | membership_went_valid | payment_affiliate_reward_created | payment_failed | payment_pending | payment_succeeded | refund_created | refund_updated | resolution_created | resolution_decided | resolution_updated | setup_intent_canceled | setup_intent_requires_action | setup_intent_succeeded | withdrawal_created | withdrawal_updated */ /* Required! */,

	// The ID of the webhook to test.
	id: "xxxxxxxxxxx" /* Required! */,
});

Example output

const result = {
	// The body of the webhook response
	body: { any: "json" },

	// The HTTP response code of this request
	status: 10,

	// Whether or not the webhook test was successful
	success: true,
};