Fetch a company
import { whopSdk } from "@/lib/whop-sdk";
const result = await whopSdk.webhooks.getWebhook({
webhookId: "xxxxxxxxxxx" /* Required! */,
// ID of the company, either the tag (biz_xxx) or the page route (whop-dev)
companyId: "biz_XXXXXXXX" /* Required! */,
});
const response = {
// The webhook that has been set by a company
webhook: {
// The ID of the webhook
id: "xxxxxxxxxxx",
// The URL the webhook events will be sent to
url: "some string",
// The API version for this webhook
apiVersion: "v2" /* Valid values: v2 | v5 */,
// The timestamp of when the webhook was created
createdAt: 1716931200,
// Whether or not this webhook is turned on or not
enabled: true,
// The number of events this webhooks is configured to receive
events: [
"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 | dispute_alert_created | dispute_created | dispute_updated | membership_cancel_at_period_end_changed | 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 */,
],
// The resource ID
resourceId: "xxxxxxxxxxx",
// A unique secret key that will be sent with each webhook event
webhookSecret: "some string",
},
};
Was this page helpful?