import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs"; import * as core from "../../../../core/index.mjs"; import * as Whop from "../../../index.mjs"; export declare namespace PromoCodesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A Promo Code is a discount a buyer enters at checkout, either a percentage or a fixed amount off. It belongs to an account, can be limited to one product, and controls who can redeem it, how many times, until when, and for how many billing periods the discount lasts. * * Use the Promo Codes API to create codes for an account, list and retrieve them, deactivate a code to pause redemptions or activate it again, and archive codes you no longer offer. */ export declare class PromoCodesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: PromoCodesClient.Options); /** * Lists an account's promo codes. * * @param {Whop.ListPromoCodesRequest} request * @param {PromoCodesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.promoCodes.list({ * account_id: "account_id", * product_ids: ["prod_xxxxxxxxxxxxxx"], * variant_ids: ["plan_xxxxxxxxxxxxxx"] * }) */ list(request: Whop.ListPromoCodesRequest, requestOptions?: PromoCodesClient.RequestOptions): Promise>; /** * Creates a promo code for an account. * * @param {Whop.CreatePromoCodesRequest} request * @param {PromoCodesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.promoCodes.create({ * account_id: "biz_xxxxxxxxxxxxxx", * amount_off: 25, * base_currency: "usd", * code: "AFFILIATE25", * new_users_only: true, * promo_duration_months: 3, * promo_type: "percentage" * }) */ create(request: Whop.CreatePromoCodesRequest, requestOptions?: PromoCodesClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieves a promo code by ID. * * @param {Whop.RetrievePromoCodesRequest} request * @param {PromoCodesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.promoCodes.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrievePromoCodesRequest, requestOptions?: PromoCodesClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Archives a promo code so it cannot be used in future checkouts. * * @param {Whop.DeletePromoCodesRequest} request * @param {PromoCodesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.promoCodes.delete({ * id: "id" * }) */ delete(request: Whop.DeletePromoCodesRequest, requestOptions?: PromoCodesClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Turns an inactive promo code back on so it can be redeemed at checkout. * * @param {Whop.ActivatePromoCodesRequest} request * @param {PromoCodesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.promoCodes.activate({ * id: "id" * }) */ activate(request: Whop.ActivatePromoCodesRequest, requestOptions?: PromoCodesClient.RequestOptions): core.HttpResponsePromise; private __activate; /** * Turns off an active promo code so it can no longer be redeemed at checkout. * * @param {Whop.DeactivatePromoCodesRequest} request * @param {PromoCodesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.promoCodes.deactivate({ * id: "id" * }) */ deactivate(request: Whop.DeactivatePromoCodesRequest, requestOptions?: PromoCodesClient.RequestOptions): core.HttpResponsePromise; private __deactivate; }