import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js"; import * as core from "../../../../core/index.js"; import * as Whop from "../../../index.js"; export declare namespace WebhooksClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A Webhook is an endpoint on your server that Whop sends signed HTTP POST requests to when events happen, such as a payment succeeding or a membership going active. A webhook is attached to an account or an app and subscribes to the events you choose. * * Use the Webhooks API to create and update endpoints, send a test event, inspect the delivery log, and replay deliveries your server missed. See [Webhooks & Events](/developer/guides/webhooks) for verifying signatures and handling retries. */ export declare class WebhooksClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: WebhooksClient.Options); /** * Returns a paginated list of webhook endpoints configured for an account, ordered by most recently created. * * @param {Whop.ListWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.list() */ list(request?: Whop.ListWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): Promise>; /** * Creates a webhook endpoint that receives event notifications via HTTP POST. * * @param {Whop.CreateWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.create({ * url: "https://example.com/hooks" * }) */ create(request: Whop.CreateWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieves the details of an existing webhook. * * @param {Whop.RetrieveWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Permanently deletes a webhook endpoint. To stop deliveries without deleting it, set `enabled` to `false` with `PATCH /webhooks/:id`. * * @param {Whop.DeleteWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.delete({ * id: "id" * }) */ delete(request: Whop.DeleteWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Updates a webhook endpoint's URL, subscribed events, pinned payload version, or enabled state. * * @param {Whop.UpdateWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.update({ * id: "id" * }) */ update(request: Whop.UpdateWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Returns a paginated list of delivery attempts for a webhook, ordered by most recent first. Includes the request payload, response body, response code, and timing for each attempt. Filtered queries use a bounded read budget, so a page may be partial or empty. Continue with `page_info.end_cursor` while `page_info.has_next_page` is `true`. * * @param {Whop.ListDeliveriesWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.listDeliveries({ * id: "id", * resource_id: "pay_xxxxxxxxxxxxx" * }) */ listDeliveries(request: Whop.ListDeliveriesWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): Promise>; /** * Re-sends the exact payload of a past delivery to the webhook's current URL and returns the delivery result. The replay keeps the original `webhook-id` unless you pass `regenerate_id`, so consumers that deduplicate on it can drop events they already processed. Only available for enabled webhooks on API version `v1`; deliveries are retained for 30 days. * * @param {Whop.ReplayDeliveryWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.replayDelivery({ * id: "id", * delivery_id: "delivery_id" * }) */ replayDelivery(request: Whop.ReplayDeliveryWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __replayDelivery; /** * Re-sends the webhook's past deliveries within a time window, optionally limited to specific events or to failed deliveries. Use it to recover events your endpoint missed. The replay runs asynchronously and nothing about it is stored: each re-send appears as a new entry in the webhook's delivery log. Each matching message is re-sent once, with its original `webhook-id` unless you pass `regenerate_ids`. Only available for enabled webhooks on API version `v1`; deliveries are retained for 30 days. * * @param {Whop.ReplayWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.replay({ * id: "id", * sent_after: "2026-01-01T12:00:00.000Z" * }) */ replay(request: Whop.ReplayWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __replay; /** * Sends a sample payload for the given event to the webhook's URL and returns the delivery result. * * @param {Whop.TestWebhooksRequest} request * @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.webhooks.test({ * id: "id", * event: "payment.succeeded" * }) */ test(request: Whop.TestWebhooksRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise; private __test; }